Skip to content

Commit 7b63943

Browse files
authored
fix: linting, syntax, workflow and os-support (#4)
* add .ansible-lint * add supported os * fix molecule * reordering key names * mv `daemon_reload` from tasks to handlers * fix molecule workflow * add amazon linux support * fix amazonlinux version
1 parent 59292ee commit 7b63943

File tree

14 files changed

+48
-32
lines changed

14 files changed

+48
-32
lines changed

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
skip_list:
2+
- 'fqcn'

.github/workflows/molecule.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
push:
66
branches:
77
- main
8-
- master
98

109
jobs:
1110
test:
@@ -14,16 +13,13 @@ jobs:
1413
strategy:
1514
matrix:
1615
include:
17-
- distro: 'rockylinux8'
18-
command: '/usr/sbin/init'
19-
- distro: 'ubuntu2004'
20-
command: '/lib/systemd/systemd'
21-
- distro: 'debian11'
22-
command: '/lib/systemd/systemd'
16+
- distro: 'debian-11'
17+
- distro: 'rockylinux-8'
18+
- distro: 'ubuntu-22.04'
2319

2420
steps:
2521
- name: 'Checkout the codebase'
26-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2723

2824
- name: 'Test role'
2925
uses: gofrolist/molecule-action@v2
@@ -33,4 +29,3 @@ jobs:
3329
PY_COLORS: '1'
3430
ANSIBLE_FORCE_COLOR: '1'
3531
MOLECULE_DISTRO: ${{ matrix.distro }}
36-
MOLECULE_DOCKER_COMMAND: ${{ matrix.command }}

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@ Requirements
99
- Supported version of Ansible: 2.9 and highter.
1010
- `gnu-tar` on Mac as deployer host (`brew install gnu-tar`).
1111
- `pywinrm` is a python library for connection Ansible to Windows hosts via [WinRM](https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html).
12-
- List of all supported platforms described in role meta.
12+
- Supported platforms:
13+
- Amazon Linux
14+
- all
15+
- Debian
16+
- 10
17+
- 11
18+
- RHEL
19+
- 7
20+
- 8
21+
- Ubuntu
22+
- 18.04
23+
- 20.04
24+
- 22.04
25+
- Windows
26+
- 2016
27+
- 2019
28+
- 2022
1329

1430
Role Variables
1531
--------------

handlers/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
- name: 'Linux | Restart Postgres Exporter'
33
ansible.builtin.systemd:
44
name: postgres_exporter
5+
daemon_reload: true
56
state: restarted
67
become: true

meta/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ galaxy_info:
1010
min_ansible_version: '2.9'
1111

1212
platforms:
13+
- name: Amazon Linux
14+
versions:
15+
- 'all'
16+
- name: Debian
17+
versions:
18+
- 'buster'
19+
- 'bullseye'
1320
- name: EL
1421
versions:
1522
- '7'
@@ -18,17 +25,16 @@ galaxy_info:
1825
versions:
1926
- 'bionic'
2027
- 'focal'
21-
- name: Debian
22-
versions:
23-
- 'bullseye'
28+
- 'jammy'
2429
- name: Windows
2530
versions:
2631
- '2016'
2732
- '2019'
33+
- '2022'
2834

2935
galaxy_tags:
3036
- monitoring
3137
- prometheus
32-
- postgres_exporter
38+
- postgresql
3339

3440
dependencies: []

molecule/default/molecule.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ driver:
77
lint: |
88
set -e
99
yamllint .
10+
ansible-lint
1011
platforms:
1112
- name: instance
12-
image: 'geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest'
13-
command: "${MOLECULE_DOCKER_COMMAND:-'/lib/systemd/systemd'}"
13+
image: 'antmelekhin/docker-systemd:${MOLECULE_DISTRO:-ubuntu-20.04}'
1414
published_ports:
1515
- 0.0.0.0:9187:9187/udp
1616
- 0.0.0.0:9187:9187/tcp
@@ -23,6 +23,6 @@ platforms:
2323
provisioner:
2424
name: ansible
2525
playbooks:
26-
verify: ../resources/tests/verify.yml
26+
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
2727
verifier:
2828
name: ansible

molecule/vagrant-windows/molecule.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
22
dependency:
33
name: galaxy
4+
enabled: true
45
driver:
56
name: vagrant
67
lint: |
78
set -e
89
yamllint .
10+
ansible-lint
911
platforms:
1012
- name: instance
1113
box: 'jborean93/WindowsServer2019'
@@ -28,6 +30,6 @@ provisioner:
2830
ansible_winrm_server_cert_validation: ignore
2931
ansible_become: false
3032
playbooks:
31-
verify: ../resources/tests/win_verify.yml
33+
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
3234
verifier:
3335
name: ansible

0 commit comments

Comments
 (0)