From 03e7f9cac21a0ea38fb04ecd9d53d13da3badf41 Mon Sep 17 00:00:00 2001 From: Mariusz Karpiarz Date: Thu, 26 Oct 2023 20:38:59 +0100 Subject: [PATCH] Add parameter allowing to skip installation of repo config files (#216) In some cases (for example when using a repo mirror) repo config files may already be present on the server and with this change makes it possible to skip tasks trying to modify existing configs. Co-authored-by: Mariusz Karpiarz --- defaults/main/install.yml | 3 +++ tasks/install-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defaults/main/install.yml b/defaults/main/install.yml index 403d614..301d0e8 100644 --- a/defaults/main/install.yml +++ b/defaults/main/install.yml @@ -31,6 +31,9 @@ ondemand_package_excludes: [] disable_gpg_check_rpm_repo: true apt_update_cache: true +# Set to "true" to skip installation of custom repo config files +ood_use_exiting_repo_file: false + # flip this flag if you want to install the ondemand-dex RPM install_ondemand_dex: false # This will default to latest ondemand-dex package if install_ondemand_dex diff --git a/tasks/install-package.yml b/tasks/install-package.yml index d750a9a..7dd4080 100644 --- a/tasks/install-package.yml +++ b/tasks/install-package.yml @@ -19,7 +19,7 @@ name: "{{ rpm_repo_url }}" state: present disable_gpg_check: "{{ disable_gpg_check_rpm_repo | bool }}" - when: ansible_os_family == "RedHat" + when: ansible_os_family == "RedHat" and not ood_use_exiting_repo_file - name: Install the apt repo ansible.builtin.apt: @@ -27,13 +27,13 @@ state: present update_cache: "{{ apt_update_cache | bool }}" dpkg_options: 'force-confnew' - when: ansible_os_family == "Debian" + when: ansible_os_family == "Debian" and not ood_use_exiting_repo_file - name: Enable epel ansible.builtin.package: name: 'epel-release' state: present - when: ansible_os_family == "RedHat" + when: ansible_os_family == "RedHat" and not ood_use_exiting_repo_file - name: Install rhel/centos:8 dependencies ansible.builtin.dnf: