Skip to content

Instantly share code, notes, and snippets.

@askb
Created April 24, 2025 09:53
Show Gist options
  • Select an option

  • Save askb/55d69f025023c724ec11a49381e0d1a2 to your computer and use it in GitHub Desktop.

Select an option

Save askb/55d69f025023c724ec11a49381e0d1a2 to your computer and use it in GitHub Desktop.
Changes required for conditionally building packer images locally outside the cloud tenat
$ git diff
diff --git a/templates/builder.pkr.hcl b/templates/builder.pkr.hcl
index ab331b0..316c9ef 100644
--- a/templates/builder.pkr.hcl
+++ b/templates/builder.pkr.hcl
@@ -149,11 +149,12 @@ build {
"ANSIBLE_HOST_KEY_CHECKING=False",
"ANSIBLE_ROLES_PATH=${var.ansible_roles_path}",
"ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
- "ANSIBLE_STDOUT_CALLBACK=debug"
+ "ANSIBLE_STDOUT_CALLBACK=debug",
+ "ANSIBLE_SSH_TYPE=paramiko"
]
command = "./common-packer/ansible-playbook.sh"
extra_arguments = [
- "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa"
+ "-vv", "--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa"
]
playbook_file = "provision/local-builder.yaml"
skip_version_check = true
@askb
Copy link
Author

askb commented Apr 24, 2025

// to build the image run the cmd:
source ~/.virtualenvs/ansible/bin/activate
OS_CLOUD=ecompci packer.io build -only=openstack.docker -var-file=cloud-env.json -var-file=common-packer/vars/ubuntu-22.04.pkrvars.hcl templates/docker.pkr.hcl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment