From 4c630b5860d93757569903b10d08b7dfe55c690c Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 7 Jul 2022 19:36:12 +0000 Subject: [PATCH 1/3] Fix ansible provisioner See: - https://github.com/ansible/ansible/issues/74072 - https://github.com/hashicorp/packer/issues/6379 --- packer/debian-bullseye.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packer/debian-bullseye.yaml b/packer/debian-bullseye.yaml index 8ac119d..121eaaf 100644 --- a/packer/debian-bullseye.yaml +++ b/packer/debian-bullseye.yaml @@ -66,7 +66,7 @@ provisioners: type: shell - playbook_file: ansible/playbook.yml type: ansible - user: root + user: "{{user `ssh_user`}}" ansible_env_vars: - "ANSIBLE_SSH_ARGS='-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa'" - "ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3" From 522d95694bee15850b6d3aae3ef435cb589d951a Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 7 Jul 2022 19:57:26 +0000 Subject: [PATCH 2/3] Increase ansible verbosity --- packer/debian-bullseye.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packer/debian-bullseye.yaml b/packer/debian-bullseye.yaml index 121eaaf..fd0f862 100644 --- a/packer/debian-bullseye.yaml +++ b/packer/debian-bullseye.yaml @@ -70,6 +70,7 @@ provisioners: ansible_env_vars: - "ANSIBLE_SSH_ARGS='-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa'" - "ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3" + - "ANSIBLE_VERBOSITY=4" - inline: - rm /boot && mkdir /boot type: shell From bf1995b532916629c3f4d4ac573945d06264c705 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 7 Jul 2022 20:22:56 +0000 Subject: [PATCH 3/3] attempt to create ansible temp dir --- packer/debian-bullseye.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packer/debian-bullseye.yaml b/packer/debian-bullseye.yaml index fd0f862..f4dcc0e 100644 --- a/packer/debian-bullseye.yaml +++ b/packer/debian-bullseye.yaml @@ -63,6 +63,7 @@ provisioners: type: shell - inline: - apt-get -y install openssh-server python lsb-release + - mkdir -p /root/.ansible/tmp type: shell - playbook_file: ansible/playbook.yml type: ansible