Files
common/roles/tasks/install-cellmodem-package.yml
T

30 lines
818 B
YAML

- name: Extract cellmodem package
ansible.builtin.unarchive:
src: packages/cellmodem-scripts-v15.tar.bz2
dest: /tmp
remote_src: false
become: true
- name: Find the top-level extracted directory
ansible.builtin.find:
paths: /tmp
file_type: directory
recurse: false
patterns: "cellmodem-scripts-*"
register: extracted_dir
become: true
- name: Fail if the archive layout is unexpected
ansible.builtin.assert:
that:
- extracted_dir.matched == 1
fail_msg: >-
Expected exactly one cellmodem-scripts-* directory in /tmp,
found {{ extracted_dir.matched }}. Check the archive structure.
- name: Run the install script from the top-level directory
ansible.builtin.command:
cmd: ./install.sh
chdir: "{{ extracted_dir.files[0].path }}"
become: true