diff mbox series

[1/4] install_terraform: fix missing deps

Message ID 20250206-small-fixes-v1-1-4834edb167a3@samsung.com (mailing list archive)
State New
Headers show
Series kdevops: small fixes | expand

Commit Message

Daniel Gomez Feb. 6, 2025, 9:55 p.m. UTC
From: Daniel Gomez <da.gomez@samsung.com>

In a freshed Debian Testing machine, Terraform can't be extracted
because it requires zip to be present. Add a task to check Terraform
packages before unpacking Terraform release.

Error:
    "msg": "Failed to find handler for
\"/home/dagomez/.ansible/tmp/ansible-tmp-1738158342.0404465-41967-103098
632274351/terraform_1.2.3_linux_amd649158dhyg.zip\". Make sure
the required command to extract the file is installed.\nCommand
\"/usr/bin/tar\" could not handle archive: Unable to list files
in the archive: /usr/bin/tar: This does not look like a tar
archive\n/usr/bin/tar: Skipping to next header\n/usr/bin/tar: Exiting
with failure status due to previous errors\n\nUnable to find required
'unzip' or 'zipinfo' binary in the path.\nCommand \"/usr/bin/tar\"
could not handle archive: Unable to list files in the archive: xz:
(stdin): File format not recognized\n/usr/bin/tar: Child returned
status 1\n/usr/bin/tar: Error is not recoverable: exiting now\n\nUnable
to find required 'unzip' or 'unzip' binary in the path.\nCommand
\"/usr/bin/tar\" could not handle archive: Unable to list files in the
archive: zstd: /*stdin*\\: unsupported format \n/usr/bin/tar: Child
returned status 1\n/usr/bin/tar: Error is not recoverable: exiting
now\n\nCommand \"/usr/bin/tar\" could not handle archive: Unable to list
files in the archive: bzip2: (stdin) is not a bzip2 file.\n/usr/bin/tar:
Child returned status 2\n/usr/bin/tar: Error is not recoverable: exiting
now\n"
}

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
 .../roles/install_terraform/tasks/install-deps/debian/main.yml   | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/playbooks/roles/install_terraform/tasks/install-deps/debian/main.yml b/playbooks/roles/install_terraform/tasks/install-deps/debian/main.yml
index 3397f403cbf53254c0ac0d8ff0468512eaf0f758..f7753f8667d950cf7d7d2b5ccbc0a89f9b882a69 100644
--- a/playbooks/roles/install_terraform/tasks/install-deps/debian/main.yml
+++ b/playbooks/roles/install_terraform/tasks/install-deps/debian/main.yml
@@ -6,6 +6,15 @@ 
   failed_when: terraform_present.rc != 0 and terraform_present.rc != 1
   tags: [ 'terraform', 'verify' ]
 
+- name: Install Terraform Dependencies
+  become: true
+  become_method: sudo
+  ansible.builtin.apt:
+    name:
+      - unzip
+    state: present
+    update_cache: true
+
 - name: Download Terraform from the latest release and install locally
   become: yes
   become_method: sudo