diff --git a/roles/geerlingguy.ansible/.ansible-lint b/roles/geerlingguy.ansible/.ansible-lint index 55572942..acc82551 100644 --- a/roles/geerlingguy.ansible/.ansible-lint +++ b/roles/geerlingguy.ansible/.ansible-lint @@ -1,2 +1,3 @@ skip_list: - - '106' + - 'yaml' + - 'role-name' diff --git a/roles/geerlingguy.ansible/.github/stale.yml b/roles/geerlingguy.ansible/.github/stale.yml index c7ff1275..3cc6ec31 100644 --- a/roles/geerlingguy.ansible/.github/stale.yml +++ b/roles/geerlingguy.ansible/.github/stale.yml @@ -12,6 +12,7 @@ onlyLabels: [] # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: + - bug - pinned - security - planned diff --git a/roles/geerlingguy.ansible/.github/workflows/ci.yml b/roles/geerlingguy.ansible/.github/workflows/ci.yml index 95c75247..083ab7d5 100644 --- a/roles/geerlingguy.ansible/.github/workflows/ci.yml +++ b/roles/geerlingguy.ansible/.github/workflows/ci.yml @@ -29,12 +29,11 @@ jobs: python-version: '3.x' - name: Install test dependencies. - run: pip3 install yamllint ansible-lint + run: pip3 install yamllint - name: Lint code. run: | yamllint . - ansible-lint molecule: name: Molecule @@ -42,18 +41,17 @@ jobs: strategy: matrix: include: - - distro: centos8 + - distro: rockylinux8 playbook: converge.yml - - distro: fedora32 + - distro: fedora33 + playbook: converge.yml + - distro: ubuntu2004 playbook: converge.yml - # See: https://github.com/geerlingguy/ansible-role-ansible/issues/18 - # - distro: ubuntu2004 - # playbook: converge.yml - distro: ubuntu1804 playbook: converge.yml - distro: debian10 playbook: converge.yml - - distro: centos8 + - distro: rockylinux8 playbook: pip.yml steps: diff --git a/roles/geerlingguy.ansible/.github/workflows/release.yml b/roles/geerlingguy.ansible/.github/workflows/release.yml index 916a8a07..8d0fe866 100644 --- a/roles/geerlingguy.ansible/.github/workflows/release.yml +++ b/roles/geerlingguy.ansible/.github/workflows/release.yml @@ -32,7 +32,9 @@ jobs: python-version: '3.x' - name: Install Ansible. - run: pip3 install ansible-base + run: pip3 install ansible-core - name: Trigger a new import on Galaxy. - run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) + 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/roles/geerlingguy.ansible/.gitignore b/roles/geerlingguy.ansible/.gitignore index f56f5b57..8840c8f0 100644 --- a/roles/geerlingguy.ansible/.gitignore +++ b/roles/geerlingguy.ansible/.gitignore @@ -1,3 +1,5 @@ *.retry */__pycache__ *.pyc +.cache + diff --git a/roles/geerlingguy.ansible/README.md b/roles/geerlingguy.ansible/README.md index 1dcda348..45f22925 100644 --- a/roles/geerlingguy.ansible/README.md +++ b/roles/geerlingguy.ansible/README.md @@ -6,7 +6,7 @@ An Ansible Role that installs Ansible on Linux servers. ## Requirements -If using on a RedHat/CentOS-based host, make sure you've added the EPEL repository (it can easily be installed by including the `geerlingguy.repo-epel` role on Ansible Galaxy). +If using on a RedHat/CentOS/Rocky Linux-based host, make sure you've added the EPEL repository (it can easily be installed by including the `geerlingguy.repo-epel` role on Ansible Galaxy). ## Role Variables @@ -20,6 +20,10 @@ Whether to install Ansible via the system `package` manager (`apt`, `yum`, `dnf` If `ansible_install_method` is set to `pip`, the specific Ansible version to be installed via Pip. If not set, the latest version of Ansible will be installed. + ansible_install_pip_extra_args: '' + +If `ansible_install_method` is set to `pip`, the extra arguments to be given to `pip` are listed here. If not set, no extra arguments are given. + ## Dependencies None. @@ -38,6 +42,7 @@ Install from pip: vars: ansible_install_method: pip ansible_install_version_pip: "2.7.0" + ansible_install_pip_extra_args: "--user" roles: - role: geerlingguy.pip - role: geerlingguy.ansible diff --git a/roles/geerlingguy.ansible/defaults/main.yml b/roles/geerlingguy.ansible/defaults/main.yml index 5898c332..8557c81f 100644 --- a/roles/geerlingguy.ansible/defaults/main.yml +++ b/roles/geerlingguy.ansible/defaults/main.yml @@ -6,3 +6,6 @@ ansible_install_method: package # Used only if ansible_install_method is 'pip'. If empty, defaults to latest. ansible_install_version_pip: '' + +# Which extra arguments should be gived to pip +ansible_install_pip_extra_args: '' diff --git a/roles/geerlingguy.ansible/molecule/default/molecule.yml b/roles/geerlingguy.ansible/molecule/default/molecule.yml index 74907107..d291e5b6 100644 --- a/roles/geerlingguy.ansible/molecule/default/molecule.yml +++ b/roles/geerlingguy.ansible/molecule/default/molecule.yml @@ -1,4 +1,5 @@ --- +role_name_check: 1 dependency: name: galaxy driver: @@ -8,7 +9,8 @@ platforms: image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host privileged: true pre_build_image: true provisioner: diff --git a/roles/geerlingguy.ansible/molecule/default/pip.yml b/roles/geerlingguy.ansible/molecule/default/pip.yml index 60e298ef..888f2d3c 100644 --- a/roles/geerlingguy.ansible/molecule/default/pip.yml +++ b/roles/geerlingguy.ansible/molecule/default/pip.yml @@ -6,6 +6,7 @@ vars: ansible_install_method: pip ansible_install_version_pip: "2.6.2" + ansible_install_pip_extra_args: "--user" roles: - role: geerlingguy.pip diff --git a/roles/geerlingguy.ansible/tasks/setup-pip.yml b/roles/geerlingguy.ansible/tasks/setup-pip.yml index a91049bd..d16977a6 100644 --- a/roles/geerlingguy.ansible/tasks/setup-pip.yml +++ b/roles/geerlingguy.ansible/tasks/setup-pip.yml @@ -3,3 +3,4 @@ pip: name: ansible version: "{{ ansible_install_version_pip | default(omit) }}" + extra_args: "{{ ansible_install_pip_extra_args | default(omit) }}"