diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1781e07..8a337e0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,6 @@ updates: schedule: interval: "daily" - package-ecosystem: "pip" - directory: "/.github/workflows" + directory: "/.github/workflows/requirements" schedule: interval: "daily" diff --git a/.github/workflows/galaxy.yml b/.github/workflows/galaxy.yml index cb5f69e..5a2b8a5 100644 --- a/.github/workflows/galaxy.yml +++ b/.github/workflows/galaxy.yml @@ -18,7 +18,7 @@ jobs: python-version: 3.x - name: Install Ansible - run: pip3 install -r .github/workflows/requirements_galaxy.txt + run: pip3 install -r .github/workflows/requirements/requirements_galaxy.txt - name: Import release to Ansible Galaxy run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 4dee296..78ab8b1 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -43,7 +43,15 @@ jobs: - name: Install Molecule dependencies if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)" - run: pip3 install -r .github/workflows/requirements_molecule.txt + run: pip3 install -r .github/workflows/requirements/requirements_molecule.txt + + - name: Uninstall Ansible community distribution (temporary) + if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)" + run: pip3 uninstall -y ansible + + - name: Install Ansible base dependencies + if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)" + run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml - name: Run Molecule tests if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)" diff --git a/.github/workflows/requirements/requirements_ansible.yml b/.github/workflows/requirements/requirements_ansible.yml new file mode 100644 index 0000000..dac1c72 --- /dev/null +++ b/.github/workflows/requirements/requirements_ansible.yml @@ -0,0 +1,8 @@ +--- +collections: + - name: community.general + version: 2.0.1 + - name: ansible.posix + version: 1.1.1 + - name: community.docker + version: 1.2.0 diff --git a/.github/workflows/requirements_galaxy.txt b/.github/workflows/requirements/requirements_galaxy.txt similarity index 100% rename from .github/workflows/requirements_galaxy.txt rename to .github/workflows/requirements/requirements_galaxy.txt diff --git a/.github/workflows/requirements_molecule.txt b/.github/workflows/requirements/requirements_molecule.txt similarity index 85% rename from .github/workflows/requirements_molecule.txt rename to .github/workflows/requirements/requirements_molecule.txt index f1ead29..6d5d45d 100644 --- a/.github/workflows/requirements_molecule.txt +++ b/.github/workflows/requirements/requirements_molecule.txt @@ -1,5 +1,4 @@ ansible-base==2.10.5 -ansible==2.10.6 ansible-lint==4.3.7 yamllint==1.26.0 molecule[docker]==3.2.3 diff --git a/.gitignore b/.gitignore index a11ae27..4bb7c3f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ Thumbs.db # Ansible specific # #################### +.cache *.retry # Python specific # diff --git a/CHANGELOG.md b/CHANGELOG.md index f030a8c..231bac4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ FEATURES: -Add support for Dependabot. +* Replace Ansible community distribution with Ansible base and add the necessary extra collections as a dependency requirement. For reference, these are: + * `community.general` + * `ansible.posix` +* Add support for Dependabot. ENHANCEMENTS: @@ -12,7 +15,7 @@ ENHANCEMENTS: * Specify GitHub actions Ubuntu release. * Minor GitHub template tweaks, including the creation of a SECURITY doc. * Update list of supported platforms. -* Update Ansible base to `2.10.5`, Ansible to `2.10.6`, Molecule to `3.2.3` and yamllint to `1.26.0`. +* Update Ansible base to `2.10.5`, Molecule to `3.2.3` and yamllint to `1.26.0`. BUG FIXES: diff --git a/README.md b/README.md index 76e90ec..fea320f 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,17 @@ With the advent of Ansible collections and the release of the [NGINX Core Ansibl ### Ansible -* This role is developed and tested with [maintained](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status) versions of Ansible. Backwards compatibility is not guaranteed. -* Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html). +* This role is developed and tested with [maintained](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) versions of Ansible base. When using Ansible base, you will also need to install the following collections: + ```yaml + --- + collections: + - name: community.general + version: 2.0.0 + - name: ansible.posix + version: 1.1.1 + ``` + **Note:** You can alternatively install the Ansible community distribution if you don't want to manage individual collections. +* Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#upgrading-ansible-from-version-2-9-and-older-to-version-2-10-or-later). ### Molecule diff --git a/meta/main.yml b/meta/main.yml index b2ee342..82a5fc7 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,7 +7,7 @@ galaxy_info: license: Apache License, Version 2.0 - min_ansible_version: 2.9 + min_ansible_version: 2.10 platforms: - name: Alpine