only set vars and group, if non-nil

This commit is contained in:
Jörg Thalheim 2015-01-30 08:31:03 +00:00
parent dfd703afde
commit 4d42b9bfcd
2 changed files with 6 additions and 30 deletions

View File

@ -233,8 +233,6 @@
"teamspeak": { "teamspeak": {
"ipv4": "192.168.66.21/32", "ipv4": "192.168.66.21/32",
"ipv6": "2a01:4f8:210:31fd:1::15/128", "ipv6": "2a01:4f8:210:31fd:1::15/128",
"group": null,
"vars": null,
"backup-paths": [ "backup-paths": [
"var/lib/teamspeak3-server" "var/lib/teamspeak3-server"
] ]
@ -242,8 +240,6 @@
"prosody": { "prosody": {
"ipv4": "192.168.66.22/32", "ipv4": "192.168.66.22/32",
"ipv6": "2a01:4f8:210:31fd:1::16/128", "ipv6": "2a01:4f8:210:31fd:1::16/128",
"group": null,
"vars": null,
"rdns6": "jabber.higgsboson.tk", "rdns6": "jabber.higgsboson.tk",
"backup-paths": [ "backup-paths": [
"var/lib/prosody" "var/lib/prosody"
@ -279,55 +275,37 @@
"etherpad": { "etherpad": {
"ipv4": "192.168.66.25/32", "ipv4": "192.168.66.25/32",
"ipv6": "2a01:4f8:210:31fd:1::19/128", "ipv6": "2a01:4f8:210:31fd:1::19/128",
"group": null,
"vars": null
}, },
"pyload": { "pyload": {
"ipv4": "192.168.66.26/32", "ipv4": "192.168.66.26/32",
"ipv6": "2a01:4f8:210:31fd:1::1a/128", "ipv6": "2a01:4f8:210:31fd:1::1a/128",
"group": null,
"vars": null
}, },
"squid": { "squid": {
"ipv4": "192.168.66.27/32", "ipv4": "192.168.66.27/32",
"ipv6": "2a01:4f8:210:31fd:1::1b/128", "ipv6": "2a01:4f8:210:31fd:1::1b/128",
"group": null,
"vars": null
}, },
"classifier": { "classifier": {
"ipv4": "192.168.66.28/32", "ipv4": "192.168.66.28/32",
"ipv6": "2a01:4f8:210:31fd:1::1c/128", "ipv6": "2a01:4f8:210:31fd:1::1c/128",
"group": null,
"vars": null
}, },
"seafile": { "seafile": {
"ipv4": "192.168.66.29/32", "ipv4": "192.168.66.29/32",
"ipv6": "2a01:4f8:210:31fd:1::1d/128", "ipv6": "2a01:4f8:210:31fd:1::1d/128",
"group": null,
"vars": null
}, },
"login": { "login": {
"ipv4": "192.168.66.30/32", "ipv4": "192.168.66.30/32",
"ipv6": "2a01:4f8:210:31fd:1::1e/128", "ipv6": "2a01:4f8:210:31fd:1::1e/128",
"group": null, "rdns6": "login.higgsboson.tk",
"vars": { "vars": {
"ssh_ldap": true "ssh_ldap": true
} }
}, },
"dn42": {
"ipv4": "192.168.66.31/32",
"ipv6": "2a01:4f8:210:31fd:1::1f/128",
"group": null,
"vars": null
},
"halfcode": { "halfcode": {
"ipv4": "192.168.66.32/32", "ipv4": "192.168.66.32/32",
"ipv6": "2a01:4f8:210:31fd:1::20/128", "ipv6": "2a01:4f8:210:31fd:1::20/128",
"group": "php", "group": "php",
"vars": { "vars": {
"php_extensions": [ "php_extensions": []
]
} }
}, },
"phonefinder": { "phonefinder": {
@ -335,9 +313,7 @@
"ipv6": "2a01:4f8:210:31fd:1::21/128", "ipv6": "2a01:4f8:210:31fd:1::21/128",
"group": "php", "group": "php",
"vars": { "vars": {
"php_extensions": [ "php_extensions": []
"[@]"
]
} }
} }
} }

View File

@ -40,8 +40,8 @@ module Lxc
c = @data["network"][@name] || {} c = @data["network"][@name] || {}
c["ipv4"] = NetAddr::CIDR.create(@ipv4).to_s(Short: true) c["ipv4"] = NetAddr::CIDR.create(@ipv4).to_s(Short: true)
c["ipv6"] = NetAddr::CIDR.create(@ipv6).to_s(Short: true) c["ipv6"] = NetAddr::CIDR.create(@ipv6).to_s(Short: true)
c["group"] = @options[:group] c["group"] = @options[:group] if @options[:group]
c["vars"] = @options[:vars] c["vars"] = @options[:vars] if @options[:vars]
opts = @options.merge(name: @name, opts = @options.merge(name: @name,
ipv4: format_address(@ipv4, @ipv4_subnet.to_i(:netmask)), ipv4: format_address(@ipv4, @ipv4_subnet.to_i(:netmask)),
ipv6: format_address(@ipv6, @ipv6_subnet.to_i(:netmask))) ipv6: format_address(@ipv6, @ipv6_subnet.to_i(:netmask)))