You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- while [ ! -e "/etc/puppetlabs/data/terraform_data.yaml" ]; do echo "$(date -I'seconds') Waiting for terraform to scp terraform_data.yaml"; sleep 5; done
103
-
%{ endif ~}
104
114
%{ if node_name != keys(puppetservers)[0] }
105
115
- sed -e '/certificate-authority-service/ s/^/#/' -i /etc/puppetlabs/puppetserver/services.d/ca.cfg
106
116
- sed -e '/certificate-authority-disabled-service/ s/^#//' -i /etc/puppetlabs/puppetserver/services.d/ca.cfg
@@ -133,7 +143,8 @@ runcmd:
133
143
- test -f /etc/magic-castle-release && systemctl start puppet || true
134
144
135
145
write_files:
136
-
- content: restrict%{ if contains(tags, "puppet") },pty%{ else }%{ for host, ip in puppetservers },permitopen="${ip}:22"%{ endfor },port-forwarding,command="/sbin/nologin"%{ endif } ${tf_ssh_public_key}
146
+
# If the ip addresses of the puppet servers are not known in advance, we cannot restrict the ssh connection to them.
147
+
- content: restrict,%{ if contains(tags, "puppet") }pty%{ else }%{if length(compact(values(puppetservers))) == length(keys(puppetservers)) }%{ for host, ip in puppetservers }permitopen="${ip}:22"%{ endfor }%{ else }pty%{ endif },port-forwarding,command="/sbin/nologin"%{ endif } ${tf_ssh_public_key}
137
148
path: /etc/ssh/authorized_keys.tf
138
149
permissions: "0644"
139
150
- content: |
@@ -183,7 +194,7 @@ write_files:
183
194
if [ -f /usr/local/bin/consul ] && [ -f /usr/bin/jq ]; then
0 commit comments