Commit 5ff1b4a5a9647c5da59821d2c90804230f09a627
1 parent
01a3ad8d
Exists in
lxc_settings
Fixes lxc bridge to be dynamically set
Signed-off-by: Tallys Martins <tallysmartins@yahoo.com.br>
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
Rakefile
| @@ -41,7 +41,8 @@ if $SPB_ENV == 'lxc' | @@ -41,7 +41,8 @@ if $SPB_ENV == 'lxc' | ||
| 41 | end | 41 | end |
| 42 | 42 | ||
| 43 | File.open('config/lxc/iptables-filter-rules', 'w') do |f| | 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 | f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 22 -j ACCEPT" | 46 | f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 22 -j ACCEPT" |
| 46 | f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 5555 -j ACCEPT" | 47 | f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 5555 -j ACCEPT" |
| 47 | end | 48 | end |
local.rake.example
| 1 | # copy this file to local.rake and adjust to your local environment | 1 | # copy this file to local.rake and adjust to your local environment |
| 2 | ENV['CHAKE_RSYNC_OPTIONS'] = '--exclude tmp/dump' | 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' |