summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hughes <bmhughes@bmhughes.co.uk>2021-04-26 21:19:26 +0100
committerGitHub <noreply@github.com>2021-04-26 15:19:26 -0500
commit02db2c3ecf29924690d4c4adf6ec059f36f31103 (patch)
tree6fd159e13f1f6d3d1d0887e279bb9277a48be92c
parentb2311664fa73ec85c3f85ec6ff6b092765e07975 (diff)
downloadcloud-init-git-02db2c3ecf29924690d4c4adf6ec059f36f31103.tar.gz
Fix chef module run failure when chef_license is set (#868)
Move chef_license from TPL_PATH_KEYS to TPL_KEYS as the chef license setting is not a path but must be added to the client config template. Fixes file or folder not found exception raised from ensure_dirs.
-rw-r--r--cloudinit/config/cc_chef.py2
-rw-r--r--templates/chef_client.rb.tmpl2
-rw-r--r--tools/.github-cla-signers1
3 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
index aaf71366..7b20222e 100644
--- a/cloudinit/config/cc_chef.py
+++ b/cloudinit/config/cc_chef.py
@@ -70,7 +70,6 @@ CHEF_RB_TPL_PATH_KEYS = frozenset([
'json_attribs',
'pid_file',
'encrypted_data_bag_secret',
- 'chef_license',
])
CHEF_RB_TPL_KEYS = list(CHEF_RB_TPL_DEFAULTS.keys())
CHEF_RB_TPL_KEYS.extend(CHEF_RB_TPL_BOOL_KEYS)
@@ -80,6 +79,7 @@ CHEF_RB_TPL_KEYS.extend([
'node_name',
'environment',
'validation_name',
+ 'chef_license',
])
CHEF_RB_TPL_KEYS = frozenset(CHEF_RB_TPL_KEYS)
CHEF_RB_PATH = '/etc/chef/client.rb'
diff --git a/templates/chef_client.rb.tmpl b/templates/chef_client.rb.tmpl
index 0a759b04..b9d58172 100644
--- a/templates/chef_client.rb.tmpl
+++ b/templates/chef_client.rb.tmpl
@@ -15,7 +15,7 @@ The reason these are not in quotes is because they are ruby
symbols that will be placed inside here, and not actual strings...
#}
{% if chef_license %}
-chef_license "{{chef_license}}"
+chef_license "{{chef_license}}"
{% endif%}
{% if log_level %}
log_level {{log_level}}
diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers
index 38e1ad74..d7151a59 100644
--- a/tools/.github-cla-signers
+++ b/tools/.github-cla-signers
@@ -51,3 +51,4 @@ WebSpider
xiachen-rh
xnox
hamalq
+bmhughes