diff options
author | Kim Hagen <kim.sidney@gmail.com> | 2019-12-03 14:24:10 +0100 |
---|---|---|
committer | Kim Hagen <kim.sidney@gmail.com> | 2019-12-03 14:24:10 +0100 |
commit | 46cdd473cdf8994765fbd7ccbb49a75afd5b148a (patch) | |
tree | f5450c1b6b692aa9a022922ae18e988c8cde9a1b /cloudinit/config | |
parent | 70b99d4dedfffeee58f7b85e337ebf92472f4e2d (diff) | |
download | vyos-cloud-init-46cdd473cdf8994765fbd7ccbb49a75afd5b148a.tar.gz vyos-cloud-init-46cdd473cdf8994765fbd7ccbb49a75afd5b148a.zip |
option to enable http api options
Diffstat (limited to 'cloudinit/config')
-rw-r--r-- | cloudinit/config/cc_vyos.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cloudinit/config/cc_vyos.py b/cloudinit/config/cc_vyos.py index 8172a501..a1445e09 100644 --- a/cloudinit/config/cc_vyos.py +++ b/cloudinit/config/cc_vyos.py @@ -101,6 +101,8 @@ def set_config_ovf(config, hostname, metadata): DNS = list(metadata['DNS'].replace(' ', '').split(',')) NTP = list(metadata['NTP'].replace(' ', '').split(',')) APIKEY = metadata['APIKEY'] + APIPORT = metadata['APIPORT'] + APIDEBUG = metadata['APIDEBUG'] if ip_0 != '' and mask_0 != '' and gateway != '': cidr = str(IPv4Network('0.0.0.0/' + mask_0).prefixlen) @@ -130,6 +132,13 @@ def set_config_ovf(config, hostname, metadata): config.set(['service', 'https', 'api', 'keys', 'id', 'cloud-init', 'key'], value=APIKEY, replace=True) config.set_tag(['service', 'https', 'api', 'keys', 'id']) + if APIDEBUG != 'False' and APIKEY != '': + config.set(['service', 'https', 'api', 'debug'], replace=True) + + if APIPORT != '' and APIKEY != '': + config.set(['service', 'https', 'listen-address', '0.0.0.0', 'listen-port'], value=APIPORT, replace=True) + config.set_tag(['service', 'https', 'listen-address']) + config.set(['service', 'ssh'], replace=True) config.set(['service', 'ssh', 'port'], value='22', replace=True) |