Created
April 24, 2025 09:53
-
-
Save askb/55d69f025023c724ec11a49381e0d1a2 to your computer and use it in GitHub Desktop.
Changes required for conditionally building packer images locally outside the cloud tenat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// 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