add code to detect if epel is already installed and skip it if it is
add option for generic
This commit is contained in:
parent
fd64f4d2a0
commit
831a54e9b7
1 changed files with 10 additions and 3 deletions
|
@ -48,8 +48,8 @@
|
||||||
|
|
||||||
- name: check cloud_provider value
|
- name: check cloud_provider value
|
||||||
fail:
|
fail:
|
||||||
msg: "If set the 'cloud_provider' var must be set either to 'gce', 'aws' or 'openstack'"
|
msg: "If set the 'cloud_provider' var must be set either to 'generic', gce', 'aws' or 'openstack'"
|
||||||
when: cloud_provider is defined and cloud_provider not in ['gce', 'aws', 'openstack']
|
when: cloud_provider is defined and cloud_provider not in ['generic', 'gce', 'aws', 'openstack']
|
||||||
|
|
||||||
- include: openstack-credential-check.yml
|
- include: openstack-credential-check.yml
|
||||||
when: cloud_provider is defined and cloud_provider == 'openstack'
|
when: cloud_provider is defined and cloud_provider == 'openstack'
|
||||||
|
@ -78,10 +78,17 @@
|
||||||
ansible_distribution_major_version > 21
|
ansible_distribution_major_version > 21
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
|
- name: Check if epel-release-7-5.noarch is installed
|
||||||
|
command: rpm -q epel-release-7-5.noarch
|
||||||
|
register: epel_check
|
||||||
|
when: ansible_distribution in ["CentOS","RedHat"] and
|
||||||
|
ansible_distribution_major_version >= 7
|
||||||
|
|
||||||
- name: Install epel-release on RedHat/CentOS
|
- name: Install epel-release on RedHat/CentOS
|
||||||
command: rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
command: rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||||
when: ansible_distribution in ["CentOS","RedHat"] and
|
when: ansible_distribution in ["CentOS","RedHat"] and
|
||||||
ansible_distribution_major_version >= 7
|
ansible_distribution_major_version >= 7 and
|
||||||
|
epel_check.stdout.find('is not installed') != -1
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: Install packages requirements
|
- name: Install packages requirements
|
||||||
|
|
Loading…
Reference in a new issue