Rolle aktualisiert: ansible (#466)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: #466
This commit is contained in:
Michael Grote 2023-02-17 11:49:21 +01:00
parent 791b2adac5
commit 4098803311
10 changed files with 29 additions and 13 deletions

View file

@ -1,2 +1,3 @@
skip_list:
- '106'
- 'yaml'
- 'role-name'

View file

@ -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

View file

@ -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:

View file

@ -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)

View file

@ -1,3 +1,5 @@
*.retry
*/__pycache__
*.pyc
.cache

View file

@ -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

View file

@ -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: ''

View file

@ -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:

View file

@ -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

View file

@ -3,3 +3,4 @@
pip:
name: ansible
version: "{{ ansible_install_version_pip | default(omit) }}"
extra_args: "{{ ansible_install_pip_extra_args | default(omit) }}"