Skip to content
Snippets Groups Projects
Commit 5251cd22 authored by Alice Heaton's avatar Alice Heaton :speech_balloon:
Browse files

Merge branch 'elliots-centos7' into 'master'

Enable use of role on CentOS 7

See merge request !3
parents 254e1fe2 08b04d38
Branches
No related tags found
1 merge request!3Enable use of role on CentOS 7
Pipeline #2502 passed
......@@ -46,7 +46,7 @@ To run the tests do:
$pipenv run molecule test
```
The tests should pass. As this is a CentOs 6 only module at the moment, the default scenario only runs on CentOS 6. To make sure the role fails with an error on other platforms, you can test the 'fail' scenario:
The tests should pass. As this is a CentOs 6 and 7 module at the moment, the default scenario runs on CentOS 6 and 7. To make sure the role fails with an error on other platforms, you can test the 'fail' scenario:
```
$pipenv run molecule test -s fail
......
......@@ -8,6 +8,8 @@ lint:
platforms:
- name: CentOs6
image: centos:6
- name: CentOs7
image: centos:7
provisioner:
name: ansible
lint:
......
......@@ -7,7 +7,7 @@ lint:
name: yamllint
platforms:
- name: instance
image: centos:7
image: debian:7
provisioner:
name: ansible
lint:
......
---
- name: Check OS distribution and version
set_fact:
distro_ok: "{{ ansible_distribution == 'CentOS' }}"
version_ok: "{{ ansible_distribution_major_version in ['6', '7'] }}"
- name: Ensure an error is raised on unsupported OS
fail:
msg: "Currently Software Collections are only supported on CentOS 6. Do not install on other setups - see role README"
when: ansible_distribution != "CentOS" or ansible_distribution_major_version != "6"
register: os_is_supported_check
msg: "Only CentOS 6 and 7 are supported"
when: not (distro_ok and version_ok)
- name: Add Software Collections
- name: Add Software Collections for CentOS
yum:
name: centos-release-scl
state: present
when: os_is_supported_check is succeeded
name: centos-release-scl
state: present
when:
- distro_ok
- version_ok
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment