Skip to content

Commit 28cb840

Browse files
authored
Replace Ansible community distribution with Ansible base (#365)
1 parent 71d9cb1 commit 28cb840

10 files changed

+37
-9
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ updates:
66
schedule:
77
interval: "daily"
88
- package-ecosystem: "pip"
9-
directory: "/.github/workflows"
9+
directory: "/.github/workflows/requirements"
1010
schedule:
1111
interval: "daily"

.github/workflows/galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: 3.x
1919

2020
- name: Install Ansible
21-
run: pip3 install -r .github/workflows/requirements_galaxy.txt
21+
run: pip3 install -r .github/workflows/requirements/requirements_galaxy.txt
2222

2323
- name: Import release to Ansible Galaxy
2424
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)

.github/workflows/molecule.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ jobs:
4343

4444
- name: Install Molecule dependencies
4545
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
46-
run: pip3 install -r .github/workflows/requirements_molecule.txt
46+
run: pip3 install -r .github/workflows/requirements/requirements_molecule.txt
47+
48+
- name: Uninstall Ansible community distribution (temporary)
49+
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
50+
run: pip3 uninstall -y ansible
51+
52+
- name: Install Ansible base dependencies
53+
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
54+
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
4755

4856
- name: Run Molecule tests
4957
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
collections:
3+
- name: community.general
4+
version: 2.0.1
5+
- name: ansible.posix
6+
version: 1.1.1
7+
- name: community.docker
8+
version: 1.2.0

.github/workflows/requirements_molecule.txt renamed to .github/workflows/requirements/requirements_molecule.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ansible-base==2.10.5
2-
ansible==2.10.6
32
ansible-lint==4.3.7
43
yamllint==1.26.0
54
molecule[docker]==3.2.3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Thumbs.db
1313

1414
# Ansible specific #
1515
####################
16+
.cache
1617
*.retry
1718

1819
# Python specific #

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44

55
FEATURES:
66

7-
Add support for Dependabot.
7+
* Replace Ansible community distribution with Ansible base and add the necessary extra collections as a dependency requirement. For reference, these are:
8+
* `community.general`
9+
* `ansible.posix`
10+
* Add support for Dependabot.
811

912
ENHANCEMENTS:
1013

1114
* Only run GitHub actions Galaxy CI/CD workflow when a new release is published.
1215
* Specify GitHub actions Ubuntu release.
1316
* Minor GitHub template tweaks, including the creation of a SECURITY doc.
1417
* Update list of supported platforms.
15-
* Update Ansible base to `2.10.5`, Ansible to `2.10.6`, Molecule to `3.2.3` and yamllint to `1.26.0`.
18+
* Update Ansible base to `2.10.5`, Molecule to `3.2.3` and yamllint to `1.26.0`.
1619

1720
BUG FIXES:
1821

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@ With the advent of Ansible collections and the release of the [NGINX Core Ansibl
2121

2222
### Ansible
2323

24-
* 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.
25-
* Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
24+
* 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:
25+
```yaml
26+
---
27+
collections:
28+
- name: community.general
29+
version: 2.0.0
30+
- name: ansible.posix
31+
version: 1.1.1
32+
```
33+
**Note:** You can alternatively install the Ansible community distribution if you don't want to manage individual collections.
34+
* 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).
2635
2736
### Molecule
2837

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ galaxy_info:
77

88
license: Apache License, Version 2.0
99

10-
min_ansible_version: 2.9
10+
min_ansible_version: 2.10
1111

1212
platforms:
1313
- name: Alpine

0 commit comments

Comments
 (0)