diff options
author | Scott Moser <smoser@brickies.net> | 2016-08-30 16:49:10 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2016-09-01 16:51:08 -0400 |
commit | 30ca98c3bf7762c878bc6834807e262a3cbe8c2c (patch) | |
tree | 2ec080b5afbcc30836bf453c44444052684c0971 /cloudinit/config | |
parent | 2ddaa93b870bb0953a5a23b0eab155b21dd05a0f (diff) | |
download | vyos-cloud-init-30ca98c3bf7762c878bc6834807e262a3cbe8c2c.tar.gz vyos-cloud-init-30ca98c3bf7762c878bc6834807e262a3cbe8c2c.zip |
salt minion: update default pki directory for newer salt minion.
Assuming that the installed package creates the directory
/etc/salt/pki/minion (ubuntu yakkety does), this will pick that
directory for the pki_dir default.
If it does not exist, then it will maintain the old directory.
LP: #1609899
Diffstat (limited to 'cloudinit/config')
-rw-r--r-- | cloudinit/config/cc_salt_minion.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cloudinit/config/cc_salt_minion.py b/cloudinit/config/cc_salt_minion.py index f5786a31..13d70c8e 100644 --- a/cloudinit/config/cc_salt_minion.py +++ b/cloudinit/config/cc_salt_minion.py @@ -46,7 +46,12 @@ def handle(name, cfg, cloud, log, _args): # ... copy the key pair if specified if 'public_key' in salt_cfg and 'private_key' in salt_cfg: - pki_dir = salt_cfg.get('pki_dir', '/etc/salt/pki') + if os.path.isdir("/etc/salt/pki/minion"): + pki_dir_default = "/etc/salt/pki/minion" + else: + pki_dir_default = "/etc/salt/pki" + + pki_dir = salt_cfg.get('pki_dir', pki_dir_default) with util.umask(0o77): util.ensure_dir(pki_dir) pub_name = os.path.join(pki_dir, 'minion.pub') |