Skip to content

Instantly share code, notes, and snippets.

View igalic's full-sized avatar
🔇
dnd

Mina Galić igalic

🔇
dnd
View GitHub Profile
@igalic
igalic / gist:6812082
Created October 3, 2013 15:49
My development environment
5,3G vagrant-puppet-dev_db_1377861032
11G vagrant-puppet-dev_kvmhost03_1380367854
7,0G vagrant-puppet-dev_lb_1377860266
9,0G vagrant-puppet-dev_web02_1377860123
Error: /Stage[main]/Kvmhost::Config::Cobbler/Cobblersystem[hosting02.esotericsystems.at]: Could not evaluate: no implicit conversion from nil to integer
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:65:in `[]'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:65:in `block (2 levels) in insync?'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:64:in `uniq'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:64:in `block in insync?'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:59:in `each'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:59:in `insync?'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/property.rb:314:in `safe_insync?'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction/resource_harness.rb:60:in `block in perform_changes'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction/resource_harness.rb:59:in `each'
# special bots
node /bots(32|26)/ {
# make sure our base profile is applied first:
anchor { 'bots-begin': } ->
class { 'base': } ->
# These bots are speshul:
class { 'specialbot': } ->
anchor { 'bots-end': }
}
---
libvirt::networks_defaults:
autostart: true
libvirt::networks:
pxe:
forward_mode: nat
ip:
address: 192.168.122.1
prefix: 24
@igalic
igalic / hieradata_roles_kvmhost.yml
Created October 18, 2013 06:28
A short scrapping of how I use hiera+cobbler to setup my kvmhosts
---
# customize the installation of apache for cobbler
apache::default_vhost: false
cobblerdistros:
ubuntu-12.04.3-x86_64:
arch: x86_64
breed: ubuntu
os_version: precise
@igalic
igalic / gist:7488407
Created November 15, 2013 17:39
puppetlabs-apache rspec failure
2) apache::vhost os-independent items .conf content when scriptalias is /usr/scripts should accept a scriptalias: matches
Failure/Error: should contain_file("25-#{title}.conf").with_content( match )
expected that the catalogue would contain File[25-rspec.example.com.conf] with content set to `" <Directory \"/usr/scripts\">"` but it is set to `"# ************************************\n# Vhost template in module puppetlabs-apache\n# Managed by Puppet\n# ************************************\n\n<VirtualHost *:84>\n ServerName rspec.example.com\n\n ## Vhost docroot\n DocumentRoot /rspec/docroot\n\n\n\n ## Directories, there should at least be a declaration for /rspec/docroot\n\n\n <Directory /rspec/docroot>\n Options Indexes FollowSymLinks MultiViews\n\n AllowOverride None\n Order allow,deny\n Allow from all\n </Directory>\n\n\n ## Load additional static includes\n\n\n ## Logging\n ErrorLog /var/log/apache2/rspec.example.com_error.log\n LogLevel warn\n ServerSignature Off\n Cu
@igalic
igalic / ip6tables
Last active December 29, 2015 19:29
network defined creates iptables and ip6tables rules
# Generated by ip6tables-save v1.4.12 on Sat Nov 30 11:46:47 2013
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [3:288]
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
@igalic
igalic / Host iptables
Last active December 30, 2015 00:39
VM cannot communicate with world
igalic@bacon ~ % sudo iptables-save
# Generated by iptables-save v1.4.12 on Mon Dec 2 16:37:12 2013
*nat
:PREROUTING ACCEPT [15590:962380]
:INPUT ACCEPT [383:18942]
:OUTPUT ACCEPT [21641:1493556]
:POSTROUTING ACCEPT [23729:1615627]
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
# KVM Hosts
node /steak|bacon/ inherits default {
$role = 'kvmhost'
class { $role: }
}
# Infrastructure Servers
node /git.*\.esat/ inherits default {
@igalic
igalic / bacon.yaml
Last active December 31, 2015 00:39
# bacon is a KVM Host.
---
# These IP addresses are needed to setup virbr1
#
# n.b.: We can't use facter for these values because as soon as we start
# managing /etc/network/interfaces the "facts will change".. in a way..
#
kvmhost::ip: 176.9.39.38
kvmhost::netmask: 255.255.255.224
kvmhost::gateway: 176.9.39.33