Commit 015e3ca36cd9e891a1f196f0a81aac8fabdc7fe4

Authored by Tallys Martins
2 parents 3a816daf 5ff1b4a5

Merge branch 'lxc_settings' into 'master'

Lxc settings

See merge request !176
Showing 2 changed files with 7 additions and 1 deletions   Show diff stats
Rakefile
... ... @@ -41,7 +41,8 @@ if $SPB_ENV == 'lxc'
41 41 end
42 42  
43 43 File.open('config/lxc/iptables-filter-rules', 'w') do |f|
44   - lxc_host_bridge_ip = '192.168.122.1' # FIXME don't hardcode
  44 + lxc_host_bridge_name = `awk '{ if ($1 == "lxc.network.link") { print($3) } }' /etc/lxc/default.conf`.strip
  45 + lxc_host_bridge_ip = ` /sbin/ifconfig #{lxc_host_bridge_name} | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }' `.strip
45 46 f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 22 -j ACCEPT"
46 47 f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 5555 -j ACCEPT"
47 48 end
... ...
local.rake.example
1 1 # copy this file to local.rake and adjust to your local environment
2 2 ENV['CHAKE_RSYNC_OPTIONS'] = '--exclude tmp/dump'
  3 +
  4 +# if you have vagrant lxc installed and want to use it, just copy the settings below to your local.rake
  5 +# and run vagrant up --provider lxc
  6 +#ENV['VAGRANT_BOX'] = 'frensjan/centos-7-64-lxc' #you can figure out a different lxc box if you want
  7 +#ENV['SPB_ENV'] = 'lxc'
... ...