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 | |
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')
-rw-r--r-- | cloudinit/config/cc_vyos.py | 9 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceOVF.py | 2 |
2 files changed, 10 insertions, 1 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) diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index 6330b234..2c40cf97 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -396,7 +396,7 @@ def read_ovf_environment(contents): ud = None cfg_props = ['password'] md_props = ['seedfrom', 'local-hostname', 'public-keys', 'instance-id', - 'ip0', 'netmask0', 'gateway', 'DNS', 'NTP', 'APIKEY'] + 'ip0', 'netmask0', 'gateway', 'DNS', 'NTP', 'APIKEY' ,'APIPORT', 'APIDEBUG'] for (prop, val) in props.items(): if prop == 'hostname': prop = "local-hostname" |