summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2018-03-26 21:03:39 -0400
committerScott Moser <smoser@brickies.net>2018-03-26 21:03:39 -0400
commit4fe40704bfb998588d6a96b4a2773ddc9bd692ac (patch)
treedd3172600f7e0e418ea031bec3d2603728864b51 /cloudinit
parentbdeec31dca5d9a8dc98ae31fc20a29557a2ec59e (diff)
downloadvyos-cloud-init-4fe40704bfb998588d6a96b4a2773ddc9bd692ac.tar.gz
vyos-cloud-init-4fe40704bfb998588d6a96b4a2773ddc9bd692ac.zip
cc_puppet: Revert regression of puppet creating ssl and ssl_cert dirs
Replace regressed cc_puppet functionality from a1f678f8. The following content was inadvertently dropped: - chown /var/lib/puppet/ssl as puppet:root. - Automatic creation of /var/lib/puppet/ssl/certs
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_puppet.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cloudinit/config/cc_puppet.py b/cloudinit/config/cc_puppet.py
index 297e0721..4190a20b 100644
--- a/cloudinit/config/cc_puppet.py
+++ b/cloudinit/config/cc_puppet.py
@@ -140,6 +140,7 @@ def handle(name, cfg, cloud, log, _args):
# (TODO(harlowja) is this really needed??)
cleaned_lines = [i.lstrip() for i in contents.splitlines()]
cleaned_contents = '\n'.join(cleaned_lines)
+ # Move to puppet_config.read_file when dropping py2.7
puppet_config.readfp( # pylint: disable=W1505
StringIO(cleaned_contents),
filename=p_constants.conf_path)
@@ -150,6 +151,8 @@ def handle(name, cfg, cloud, log, _args):
# Puppet ssl sub-directory isn't created yet
# Create it with the proper permissions and ownership
util.ensure_dir(p_constants.ssl_dir, 0o771)
+ util.chownbyname(p_constants.ssl_dir, 'puppet', 'root')
+ util.ensure_dir(p_constants.ssl_cert_dir)
util.chownbyname(p_constants.ssl_cert_dir, 'puppet', 'root')
util.write_file(p_constants.ssl_cert_path, cfg)