Skip to content

Commit f0862e4

Browse files
committed
Fix Permissions for Hiera, Puppet Server and eYaml Configs
Fix the following errors: (1) Running /docker-entrypoint.d/30-set-permissions.sh chown: changing ownership of '/etc/puppetlabs/puppet/manifests/site.pp': Read-only file system chown: changing ownership of '/etc/puppetlabs/puppet/keys/private_key.pkcs7.pem': Read-only file system chown: changing ownership of '/etc/puppetlabs/puppet/keys/public_key.pkcs7.pem': Read-only file system (2) Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Neither PU key nor PRIV key: (file: /etc/puppetlabs/code/environments/dev/manifests/site.pp, line: 1, column: 1) on node ...
1 parent ca306fb commit f0862e4

1 file changed

Lines changed: 36 additions & 18 deletions

File tree

templates/puppetserver-deployment.yaml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,23 @@ spec:
3030
command: [ "sh", "-c" ]
3131
args:
3232
- mkdir -p /etc/puppetlabs/code/environments;
33+
mkdir -p /etc/puppetlabs/puppet/keys;
34+
mkdir -p /etc/puppetlabs/puppet/manifests;
3335
chown -R puppet:puppet /etc/puppetlabs;
36+
{{- if .Values.hiera.config }}
37+
cp /etc/puppetlabs/puppet/configmap/hiera.yaml /etc/puppetlabs/puppet/hiera.yaml;
38+
chown puppet:puppet /etc/puppetlabs/puppet/hiera.yaml;
39+
{{- end }}
40+
cp /etc/puppetlabs/puppet/configmap/site.pp /etc/puppetlabs/puppet/manifests/site.pp;
41+
chown puppet:puppet /etc/puppetlabs/puppet/manifests/site.pp;
42+
{{- if .Values.hiera.eyaml.private_key }}
43+
cp /etc/puppetlabs/puppet/configmap/private_key.pkcs7.pem /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem;
44+
chown puppet:puppet /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem;
45+
{{- end }}
46+
{{- if .Values.hiera.eyaml.public_key }}
47+
cp /etc/puppetlabs/puppet/configmap/public_key.pkcs7.pem /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem;
48+
chown puppet:puppet /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem;
49+
{{- end }}
3450
chmod -R 0777 /tmp;
3551
securityContext:
3652
runAsUser: 0
@@ -39,6 +55,26 @@ spec:
3955
volumeMounts:
4056
- name: puppet-code-storage
4157
mountPath: /etc/puppetlabs/code/
58+
- name: puppet-puppet-storage
59+
mountPath: /etc/puppetlabs/puppet/
60+
{{- if .Values.hiera.config }}
61+
- name: hiera-volume
62+
mountPath: /etc/puppetlabs/puppet/configmap/hiera.yaml
63+
subPath: hiera.yaml
64+
{{- end }}
65+
- name: manifests-volume
66+
mountPath: /etc/puppetlabs/puppet/configmap/site.pp
67+
subPath: site.pp
68+
{{- if .Values.hiera.eyaml.public_key }}
69+
- name: eyamlpub-volume
70+
mountPath: /etc/puppetlabs/puppet/configmap/public_key.pkcs7.pem
71+
subPath: public_key.pkcs7.pem
72+
{{- end }}
73+
{{- if .Values.hiera.eyaml.private_key }}
74+
- name: eyamlpriv-volume
75+
mountPath: /etc/puppetlabs/puppet/configmap/private_key.pkcs7.pem
76+
subPath: private_key.pkcs7.pem
77+
{{- end }}
4278
- name: puppet-hiera-storage
4379
mountPath: /tmp/
4480
containers:
@@ -69,24 +105,6 @@ spec:
69105
mountPath: /opt/puppetlabs/server/data/puppetserver/
70106
- name: puppet-hiera-storage
71107
mountPath: /hiera
72-
{{- if .Values.hiera.config }}
73-
- name: hiera-volume
74-
mountPath: /etc/puppetlabs/puppet/hiera.yaml
75-
subPath: hiera.yaml
76-
{{- end }}
77-
- name: manifests-volume
78-
mountPath: /etc/puppetlabs/puppet/manifests/site.pp
79-
subPath: site.pp
80-
{{- if .Values.hiera.eyaml.public_key }}
81-
- name: eyamlpub-volume
82-
mountPath: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem
83-
subPath: public_key.pkcs7.pem
84-
{{- end }}
85-
{{- if .Values.hiera.eyaml.private_key }}
86-
- name: eyamlpriv-volume
87-
mountPath: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
88-
subPath: private_key.pkcs7.pem
89-
{{- end }}
90108
{{- if .Values.hiera.hieradataurl }}
91109
- name: git-sync-hiera
92110
image: "{{.Values.git_sync.image}}:{{.Values.git_sync.tag}}"

0 commit comments

Comments
 (0)