Skip to content

Commit 03e7f9c

Browse files
mkarpiarzMariusz Karpiarz
andauthored
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 <m.karpiarz@eschercloud.ai>
1 parent f12a807 commit 03e7f9c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

defaults/main/install.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ ondemand_package_excludes: []
3131
disable_gpg_check_rpm_repo: true
3232
apt_update_cache: true
3333

34+
# Set to "true" to skip installation of custom repo config files
35+
ood_use_exiting_repo_file: false
36+
3437
# flip this flag if you want to install the ondemand-dex RPM
3538
install_ondemand_dex: false
3639
# This will default to latest ondemand-dex package if install_ondemand_dex

tasks/install-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
name: "{{ rpm_repo_url }}"
2020
state: present
2121
disable_gpg_check: "{{ disable_gpg_check_rpm_repo | bool }}"
22-
when: ansible_os_family == "RedHat"
22+
when: ansible_os_family == "RedHat" and not ood_use_exiting_repo_file
2323

2424
- name: Install the apt repo
2525
ansible.builtin.apt:
2626
deb: "{{ apt_repo_url }}"
2727
state: present
2828
update_cache: "{{ apt_update_cache | bool }}"
2929
dpkg_options: 'force-confnew'
30-
when: ansible_os_family == "Debian"
30+
when: ansible_os_family == "Debian" and not ood_use_exiting_repo_file
3131

3232
- name: Enable epel
3333
ansible.builtin.package:
3434
name: 'epel-release'
3535
state: present
36-
when: ansible_os_family == "RedHat"
36+
when: ansible_os_family == "RedHat" and not ood_use_exiting_repo_file
3737

3838
- name: Install rhel/centos:8 dependencies
3939
ansible.builtin.dnf:

0 commit comments

Comments
 (0)