feat: add more distros to test the role
All checks were successful
checks-test / Lint (push) Successful in 14s
checks-test / molecule (debian11) (push) Successful in 1m38s
checks-test / molecule (debian12) (push) Successful in 1m46s
checks-test / molecule (rockylinux9) (push) Successful in 1m52s
checks-test / molecule (ubuntu2204) (push) Successful in 1m50s
checks-test / molecule (ubuntu2404) (push) Successful in 1m21s

This commit is contained in:
2025-04-27 15:06:11 +03:00
parent ca0601345d
commit 0b25b8b669
2 changed files with 27 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
--- ---
name: checks-test name: checks-test
'on': "on":
pull_request: pull_request:
push: push:
branches: branches:
@@ -10,7 +10,7 @@ name: checks-test
defaults: defaults:
run: run:
working-directory: 'palkx.users' working-directory: "palkx.users"
jobs: jobs:
lint: lint:
@@ -20,17 +20,17 @@ jobs:
- name: Checkout the codebase - name: Checkout the codebase
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: 'palkx.users' path: "palkx.users"
- name: Setup Python 3 - name: Setup Python 3
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.x' python-version: "3.x"
- name: Intall test dependencies - name: Intall test dependencies
run: pip3 install yamllint ansible-lint run: pip3 install yamllint ansible-lint
- name: Lint code with yamllint - name: Lint code with yamllint
run: 'yamllint .' run: "yamllint ."
- name: Lint code with yamllint - name: Lint code with yamllint
run: 'ansible-lint --profile production --show-relpath .' run: "ansible-lint --profile production --show-relpath ."
molecule: molecule:
name: molecule name: molecule
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -39,21 +39,24 @@ jobs:
distro: distro:
- rockylinux9 - rockylinux9
- ubuntu2204 - ubuntu2204
- ubuntu2404
- debian11 - debian11
- debian12
steps: steps:
- name: Checkout the codebase - name: Checkout the codebase
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: 'palkx.users' path: "palkx.users"
- name: Setup Python 3 - name: Setup Python 3
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.x' python-version: "3.x"
- name: Intall test dependencies - name: Intall test dependencies
run: pip3 install ansible molecule molecule-plugins[docker] docker run: pip3 install ansible molecule molecule-plugins[docker] docker
- name: Run Molecule tests - name: Run Molecule tests
run: molecule test run: molecule test
env: env:
PY_COLORS: '1' PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: '1' ANSIBLE_FORCE_COLOR: "1"
MOLECULE_DISTRO: ${{ matrix.distro }} MOLECULE_DISTRO: ${{ matrix.distro }}

View File

@@ -45,22 +45,22 @@
vars: vars:
users_groups: users_groups:
admin: admin:
gid: 1000
admin1:
gid: 1001 gid: 1001
admin2: admin1:
gid: 1002 gid: 1002
admin3: admin2:
gid: 1003 gid: 1003
admin4: admin3:
gid: 1004 gid: 1004
admin4:
gid: 1005
remote-users: remote-users:
gid: 856 gid: 856
no-gid-group: {} no-gid-group: {}
users: users:
admin: admin:
shell: /bin/sh shell: /bin/sh
uid: 1000 uid: 1001
groups: groups:
- admin - admin
- remote-users - remote-users
@@ -70,10 +70,10 @@
authorized_keys: authorized_keys:
default: default:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390' key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390"
admin1: admin1:
shell: /bin/sh shell: /bin/sh
uid: 1001 uid: 1002
groups: groups:
- admin1 - admin1
- remote-users - remote-users
@@ -83,10 +83,10 @@
authorized_keys: authorized_keys:
default: default:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390' key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390"
admin2: admin2:
shell: /bin/sh shell: /bin/sh
uid: 1002 uid: 1003
groups: groups:
- admin2 - admin2
- remote-users - remote-users
@@ -96,10 +96,10 @@
authorized_keys: authorized_keys:
default: default:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390' key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390"
admin3: admin3:
shell: /bin/sh shell: /bin/sh
uid: 1003 uid: 1004
groups: groups:
- admin3 - admin3
- remote-users - remote-users
@@ -109,7 +109,7 @@
authorized_keys: authorized_keys:
default: default:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390' key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390"
admin4: admin4:
shell: /bin/bash shell: /bin/bash
groups: groups:
@@ -121,4 +121,4 @@
authorized_keys: authorized_keys:
default: default:
# yamllint disable-line rule:line-length # yamllint disable-line rule:line-length
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390' key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAxFJolWPmbFVMMyD9kxQb353ngyUsEebgkK9AcnjOI cardno:13_460_390"