Skip to content

Commit

Permalink
Add parameter allowing to skip installation of repo config files (#216)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mkarpiarz and Mariusz Karpiarz authored Oct 26, 2023
1 parent f12a807 commit 03e7f9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions defaults/main/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tasks/install-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
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:
deb: "{{ apt_repo_url }}"
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:
Expand Down

0 comments on commit 03e7f9c

Please sign in to comment.