Skip to content

Commit

Permalink
Added 2 variables for enabling/disabling extra yum repositories:
Browse files Browse the repository at this point in the history
- extrarepos_enabled
- extrarepos_disabled

Comma separated list of repositories that should be enabled/disabled.
e.g
If running a RHEL7 based AMI on aws, the following repos should be enabled for getting access to compat- packages

extrarepos_enabled: "rhui-REGION-rhel-server-extras,rhui-REGION-rhel-server-optional"
  • Loading branch information
oravirt committed Apr 23, 2018
1 parent b518550 commit 5e1cf4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions roles/orahost/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
- /tmp/authorized_keys
keyfile: /tmp/known_hosts

# Extra repositories that should be enabled
extrarepos_enabled:
extrarepos_disabled:

#epel_rpm: "http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"
asmlib_rpm: "{% if ansible_distribution_major_version|int==6%}{{asmlib_rpm_el6}}{%elif ansible_distribution_major_version|int==7 %}{{asmlib_rpm_el7}}{% else %}None{% endif %}"
Expand Down
12 changes: 10 additions & 2 deletions roles/orahost/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
- oscheck

- name: Install packages required by Oracle on OL/RHEL
yum: name={{ item }} state=installed enablerepo=*
yum:
name: "{{ item }}"
state: installed
enablerepo: "{{ extrarepos_enabled |default (omit) }}"
disablerepo: "{{ extrarepos_disabled |default (omit) }}"
with_items: "{{oracle_packages}}"
when: install_os_packages and ansible_os_family == 'RedHat'
tags: os_packages, oscheck
Expand All @@ -22,7 +26,11 @@
tags: os_packages, oscheck

- name: Install packages required by Oracle for ASMlib on OL/RHEL
yum: name={{ item }} state=installed enablerepo=*
yum:
name: "{{ item }}"
state: installed
enablerepo: "{{ extrarepos_enabled |default (omit) }}"
disablerepo: "{{ extrarepos_disabled |default (omit) }}"
with_items: "{{oracle_asm_packages}}"
when: install_os_packages and device_persistence == 'asmlib' and ansible_os_family == 'RedHat'
tags: os_packages, oscheck
Expand Down

0 comments on commit 5e1cf4e

Please sign in to comment.