Skip to content

Commit b68d037

Browse files
committed
Fix dubious ownership issue with git
coauthored with chatgpt codex 5.2
1 parent 9078d48 commit b68d037

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

common/configuration/puppet.yaml.tftpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ runcmd:
107107
- chmod 0640 /etc/puppetlabs/puppet/eyaml/boot_private_key.pkcs7.pem
108108
# Setup puppet environment code and modules
109109
- rm -rf /etc/puppetlabs/code/environments/production
110+
%{ if cloud_provider == "incus" && startswith(puppetenv_git, "file://") ~}
111+
# Incus mounts can have host ownership; allow git to read the repo safely.
112+
- git config --system --add safe.directory /opt/magic-castle/puppetenv/.git
113+
%{ endif ~}
110114
- git clone ${puppetenv_git} /etc/puppetlabs/code/environments/main
111115
- ln -s /etc/puppetlabs/code/environments/main /etc/puppetlabs/code/environments/production
112116
- |

0 commit comments

Comments
 (0)