From 68c729a226e57c61ff361bf401ef88e2b04c638d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez=20Di=20Antonio?= Date: Thu, 24 Jun 2021 20:26:31 +0200 Subject: [PATCH] fix: added support for Ubuntu 16.04 to fix issue #5 ft: added Ubuntu 16.04 to pipeline test in develop branch --- .github/workflows/develop.yaml | 2 +- CHANGELOG.md | 5 +++++ README.md | 1 + meta/main.yml | 1 + molecule/ubuntu-16.04/INSTALL.rst | 16 +++++++++++++ molecule/ubuntu-16.04/converge.yml | 25 +++++++++++++++++++++ molecule/ubuntu-16.04/molecule.yml | 20 +++++++++++++++++ molecule/ubuntu-16.04/requirements.yml | 2 ++ molecule/ubuntu-16.04/tests/test_default.py | 14 ++++++++++++ vars/ubuntu-16.yml | 4 ++++ 10 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 molecule/ubuntu-16.04/INSTALL.rst create mode 100644 molecule/ubuntu-16.04/converge.yml create mode 100644 molecule/ubuntu-16.04/molecule.yml create mode 100644 molecule/ubuntu-16.04/requirements.yml create mode 100644 molecule/ubuntu-16.04/tests/test_default.py create mode 100644 vars/ubuntu-16.yml diff --git a/.github/workflows/develop.yaml b/.github/workflows/develop.yaml index a4d56ee..771dbb7 100644 --- a/.github/workflows/develop.yaml +++ b/.github/workflows/develop.yaml @@ -29,7 +29,7 @@ jobs: matrix: python: [2.7, 3.9] ansible: ["~=2.9", "~=3.4", "~=4.1"] - scenario: ["centos-8", "ubuntu-21.04"] + scenario: ["centos-8", "ubuntu-21.04", "ubuntu-16.04"] steps: - name: Check out the codebase. diff --git a/CHANGELOG.md b/CHANGELOG.md index ec03239..ded1cd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # VERSION +## 1.0.2 + +* added support for Ubuntu 16.04 to fix issue #5 +* added Ubuntu 16.04 to pipeline test in develop branch + ## 1.0.1 * fixed issue #2 diff --git a/README.md b/README.md index 70c6702..5415b8f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ This role work on RedHat, CentOS, Debian and Ubuntu distributions * 7 * 8 * Ubuntu + * 16.* * 18.* * 20.* * 21.* diff --git a/meta/main.yml b/meta/main.yml index 9d7f3c0..37776ba 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -20,6 +20,7 @@ galaxy_info: - bullseye - name: Ubuntu version: + - xenial - bionic - focal - hirsute diff --git a/molecule/ubuntu-16.04/INSTALL.rst b/molecule/ubuntu-16.04/INSTALL.rst new file mode 100644 index 0000000..b42edf5 --- /dev/null +++ b/molecule/ubuntu-16.04/INSTALL.rst @@ -0,0 +1,16 @@ +******* +Docker driver installation guide +******* + +Requirements +============ + +* General molecule dependencies (see https://molecule.readthedocs.io/en/latest/installation.html) +* Docker Engine +* docker-py +* docker + +Install +======= + + $ sudo pip install docker-py diff --git a/molecule/ubuntu-16.04/converge.yml b/molecule/ubuntu-16.04/converge.yml new file mode 100644 index 0000000..2ce8355 --- /dev/null +++ b/molecule/ubuntu-16.04/converge.yml @@ -0,0 +1,25 @@ +--- +- name: Converge + hosts: all + + pre_tasks: + - name: Update apt cache. + apt: update_cache=true cache_valid_time=600 + when: ansible_os_family == 'Debian' + changed_when: false + + tasks: + - name: "Include christiangda.epel_repo" + include_role: + name: christiangda.epel_repo + + roles: + - role: christiangda.epel_repo + when: > + ansible_os_family == 'RedHat' and ( + ansible_distribution == 'CentOS' or + ansible_distribution == 'RedHat' or + ansible_distribution == 'Amazon' + ) + changed_when: false + - role: christiangda.awscli diff --git a/molecule/ubuntu-16.04/molecule.yml b/molecule/ubuntu-16.04/molecule.yml new file mode 100644 index 0000000..adcf0e9 --- /dev/null +++ b/molecule/ubuntu-16.04/molecule.yml @@ -0,0 +1,20 @@ +--- +dependency: + name: galaxy + +driver: + name: docker + +provisioner: + name: ansible + # log: true + +verifier: + name: ansible + +scenario: + name: ubuntu-16.04 + +platforms: + - name: ubuntu-16.04 + image: ubuntu:16.04 diff --git a/molecule/ubuntu-16.04/requirements.yml b/molecule/ubuntu-16.04/requirements.yml new file mode 100644 index 0000000..41c3cbf --- /dev/null +++ b/molecule/ubuntu-16.04/requirements.yml @@ -0,0 +1,2 @@ +--- +- src: christiangda.epel_repo diff --git a/molecule/ubuntu-16.04/tests/test_default.py b/molecule/ubuntu-16.04/tests/test_default.py new file mode 100644 index 0000000..eedd64a --- /dev/null +++ b/molecule/ubuntu-16.04/tests/test_default.py @@ -0,0 +1,14 @@ +import os + +import testinfra.utils.ansible_runner + +testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( + os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') + + +def test_hosts_file(host): + f = host.file('/etc/hosts') + + assert f.exists + assert f.user == 'root' + assert f.group == 'root' diff --git a/vars/ubuntu-16.yml b/vars/ubuntu-16.yml new file mode 100644 index 0000000..04871a3 --- /dev/null +++ b/vars/ubuntu-16.yml @@ -0,0 +1,4 @@ +--- +cli_dependencies_packages: + - python3-setuptools + - python3-pip