From 30ca98c3bf7762c878bc6834807e262a3cbe8c2c Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 30 Aug 2016 16:49:10 -0400 Subject: 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 --- cloudinit/config/cc_salt_minion.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cloudinit/config/cc_salt_minion.py') 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') -- cgit v1.2.3