From b407c304a47e55a4cd6df71d4a35b0dbd6e46673 Mon Sep 17 00:00:00 2001 From: Joerg Kastning Date: Tue, 10 Sep 2024 09:41:18 +0200 Subject: [PATCH] Fix: Missing dependency of package rsync - The package 'rsync' is used by the module ansible.posix.synchronize - Task 'extract_files | Extract files of mounted ISO to work directory' fails when package is missing - Added 'rsync' as a dependency in the same way as 'xorriso' Signed-off-by: Joerg Kastning --- README.md | 2 ++ defaults/main.yml | 3 +++ tasks/assert.yml | 1 + tasks/extract_files.yml | 6 ++++++ vars/main.yml | 3 +++ 5 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 566997b..9280379 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Role Variables | `quiet_assert` | `true` | false | whether to quiet asserts | | `redhat_portal_auth_url` | Check in `defaults/main.yml` | false | URL to the Red Hat Portal to authenticate against | | `redhat_portal_download_base_url` | Check in `defaults/main.yml` | false | base URL for image downloading from the Red Hat Customer Portal | +| `rsync_package_name` | `rsync` | false | name of the package that provides the command `rsync` | | `temporary_mount_path` | `/mnt` | false | path to a temporary (empty) mount point to mount the downloaded ISO to | | `temporary_work_dir_path` | `{{ playbook_dir }}/workdir` | false | temporary directory which will be used to extract the ISO files to | | `temporary_work_dir_path_group` | `root` | false | group of the temporary directory to apply | @@ -190,6 +191,7 @@ Dependencies This role makes use of the [Ansible Posix collection](https://github.com/ansible-collections/ansible.posix). Depending on whether certain actions are required, the role needs to install the following packages: +- `rsync`: To extract files from mounted ISO to work directory - `xorriso`: To create a custom ISO - `isomd5sum`: To implant a MD5 checksum into a custom ISO - `pykickstart`: To validate a given Kickstart file diff --git a/defaults/main.yml b/defaults/main.yml index 95e53a0..922b77f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,6 +45,9 @@ _def_dest_dir_path_mode: '0755' # name of the package that provides xorriso _def_xorriso_package_name: 'xorriso' +# name of the package that provides rsync +_def_rsync_package_name: 'rsync' + # relative path within the temporary_work_dir_source_files_path to the isolinux.bin file _def_isolinux_bin_path: 'isolinux/isolinux.bin' diff --git a/tasks/assert.yml b/tasks/assert.yml index 512ce4d..a6a282c 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -51,6 +51,7 @@ - '_dest_dir_path_group' - '_dest_dir_path_mode' - '_xorriso_package_name' + - '_rsync_package_name' - '_isolinux_bin_path' - '_boot_cat_path' - '_pxelinux_cfg_path' diff --git a/tasks/extract_files.yml b/tasks/extract_files.yml index 8a98fb5..821e54c 100644 --- a/tasks/extract_files.yml +++ b/tasks/extract_files.yml @@ -5,6 +5,12 @@ state: 'unmounted' become: true +- name: 'extract_files | Ensure rsync is present' + ansible.builtin.package: + name: '{{ _rsync_package_name }}' + state: 'present' + become: true + - name: 'extract_files | Mount downloaded ISO to extract contents' ansible.posix.mount: path: '{{ _temporary_mount_path }}' diff --git a/vars/main.yml b/vars/main.yml index 0e29ab5..2112e0e 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -84,6 +84,9 @@ _dest_iso_filename: '{{ dest_iso_filename | default(None) }}' # name of the package that provides xorriso _xorriso_package_name: '{{ xorriso_package_name | default(_def_xorriso_package_name) }}' +# name of the package that provides rsync +_rsync_package_name: '{{ rsync_package_name | default(_def_rsync_package_name) }}' + # relative path within the temporary_work_dir_source_files_path to the isolinux.bin file _isolinux_bin_path: '{{ isolinux_bin_path | default(_def_isolinux_bin_path) }}'