Skip to content

Commit 8f4b3a3

Browse files
Update scaffolding
1 parent 3de5325 commit 8f4b3a3

File tree

10 files changed

+104
-83
lines changed

10 files changed

+104
-83
lines changed

.ansible-lint

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
skip_list:
3-
- 'risky-shell-pipe'
4-
- 'role-name'
5-
- var-naming[no-reserved]
3+
- meta-no-info
4+
- var-naming[no-role-prefix]
5+
- name[template]
66

77
warn_list:
8+
- no-handler
89
- package-latest
10+
- risky-shell-pipe
911
- unnamed-task
10-
- command-instead-of-shell
11-
- no-handler
12+
13+
exclude_paths:
14+
- .ansible/

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# 2 space indentation for YAML
12+
[{*.yml,*.yaml}]
13+
indent_style = space
14+
indent_size = 2

.envrc

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
#!/usr/bin/env zsh
2-
set -e
1+
#!/usr/bin/env bash
2+
if [ -n "$DIRENV_DIFF" ]; then
3+
# Do not `set -e` unless we're being run from direnv
4+
set -e
5+
fi
36

4-
if [ ! -f .venv/bin/activate ]
5-
then
7+
if [ ! -f venv-ansible-proserver-system/bin/activate ]; then
68
echo "Creating a virtual Python environment"
7-
python3 -m venv .venv >/dev/null
9+
uv -q venv --allow-existing --seed venv-ansible-proserver-system
810
fi
911

10-
if [ -f .venv/bin/activate ]
11-
then
12-
echo "Activating the Python virtual environment"
13-
. .venv/bin/activate
14-
fi
12+
echo "Activating the Python virtual environment"
13+
. venv-ansible-proserver-system/bin/activate
1514

16-
if [ -f .venv/bin/pip3 ]
17-
then
18-
echo "Installing Python requirements"
19-
.venv/bin/pip3 install --upgrade pip 1> /dev/null
20-
.venv/bin/pip3 install -r requirements.txt 1> /dev/null
21-
fi
15+
echo "Installing Python requirements"
16+
uv -q pip install -r requirements.txt
2217

23-
if [ ! -d .collections ]
24-
then
25-
echo "Installing Ansible requirements"
26-
.venv/bin/ansible-galaxy install -r requirements.yml
27-
fi
18+
export GITHUB_ACTIONS=maybe
19+
export ANSIBLE_HASH_BEHAVIOUR=merge

.github/workflows/test.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,57 @@ on:
55
push:
66
workflow_dispatch:
77

8+
env:
9+
ANSIBLE_ROLES_PATH: roles
10+
ANSIBLE_HASH_BEHAVIOUR: merge
11+
812
jobs:
913
lint:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout
1317
uses: actions/checkout@v3
1418

19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
1522
- name: Set up Python
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.x'
23+
run: uv python install
1924

20-
- name: Install dependencies.
21-
run: pip install -r requirements.txt
25+
- name: Install dependencies
26+
run: |
27+
uv -q venv --allow-existing --seed .venv
28+
. .venv/bin/activate
29+
uv -q pip install -r requirements.txt
2230
2331
- name: Run ansible-lint
24-
run: "ansible-lint"
32+
run: |
33+
. .venv/bin/activate
34+
ansible-lint
2535
2636
molecule:
37+
strategy:
38+
matrix:
39+
os: [ubuntu-2204, ubuntu-2404, debian-12]
2740
runs-on: ubuntu-latest
2841
steps:
2942
- name: Checkout
3043
uses: actions/checkout@v3
3144

45+
- name: Install uv
46+
uses: astral-sh/setup-uv@v5
47+
3248
- name: Set up Python
33-
uses: actions/setup-python@v2
34-
with:
35-
python-version: '3.x'
49+
run: uv python install
3650

3751
- name: Install dependencies.
3852
run: |
39-
pip install -r requirements.txt
53+
uv -q venv --allow-existing --seed .venv
54+
. .venv/bin/activate
55+
uv -q pip install -r requirements.txt
4056
ansible-galaxy install -r requirements.yml
4157
4258
- name: Run molecule
43-
run: molecule test
59+
run: |
60+
. .venv/bin/activate
61+
molecule test -p ${{ matrix.os }}

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
.idea
21
.DS_Store
32
*.pyc
43
__pycache__
4+
.idea
5+
.vscode
6+
/*.retry
7+
/.fact_cache
8+
/venv/
9+
debug.log
10+
id_ed25519*
11+
/venv*/
512
.collections
13+
roles
14+
.roles
615
.venv
16+
.ansible

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/ansible/ansible-lint.git
4-
rev: v6.17.2
4+
rev: v25.1.3
55
hooks:
66
- id: ansible-lint
7+
files: \.(yaml|yml)$

.yamllint

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
11
---
2-
# Based on ansible-lint config
32
extends: default
43

54
rules:
5+
line-length: disable
6+
truthy:
7+
allowed-values: ['true', 'false', 'yes', 'no']
8+
comments:
9+
min-spaces-from-content: 1
610
braces:
11+
min-spaces-inside: 0
712
max-spaces-inside: 1
8-
level: error
9-
brackets:
10-
max-spaces-inside: 1
11-
level: error
12-
colons:
13-
max-spaces-after: -1
14-
level: error
15-
commas:
16-
max-spaces-after: -1
17-
level: error
18-
comments: disable
19-
comments-indentation: disable
20-
document-start: disable
21-
empty-lines:
22-
max: 3
23-
level: error
24-
hyphens:
25-
level: error
26-
indentation: disable
27-
key-duplicates: enable
28-
line-length: disable
29-
new-line-at-end-of-file: disable
30-
new-lines:
31-
type: unix
32-
trailing-spaces: disable
33-
truthy: disable
13+
14+
ignore: |
15+
.cache

molecule/default/converge.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
hosts: all
44
environment:
55
GITHUB_ACTIONS: "maybe"
6+
ANSIBLE_HASH_BEHAVIOUR: merge
67
tasks:
7-
- name: "Include ansible-proserver-system"
8+
- name: Include ansible-proserver-system
89
ansible.builtin.include_role:
9-
name: "ansible-proserver-system"
10+
name: ansible-proserver-system

molecule/default/molecule.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ dependency:
44
driver:
55
name: docker
66
platforms:
7-
- name: instance
7+
- name: ubuntu-2204
88
image: geerlingguy/docker-ubuntu2204-ansible
9-
command: /lib/systemd/systemd
10-
pre_build_image: true
11-
privileged: true
12-
cgroupns_mode: host
13-
volumes:
14-
- /sys/fs/cgroup:/sys/fs/cgroup:rw
9+
<<: &default_platform
10+
command: /lib/systemd/systemd
11+
pre_build_image: true
12+
privileged: true
13+
cgroupns_mode: host
14+
volumes:
15+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
16+
- name: ubuntu-2404
17+
image: geerlingguy/docker-ubuntu2404-ansible
18+
<<: *default_platform
19+
- name: debian-12
20+
image: geerlingguy/docker-debian12-ansible
21+
<<: *default_platform
1522
provisioner:
1623
name: ansible
1724
playbooks:
1825
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
1926
verifier:
2027
name: ansible
21-
scenario:
22-
name: default
23-
test_sequence:
24-
- destroy
25-
- create
26-
- converge
27-
- verify

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ansible
22
ansible-lint
33
docker
4-
molecule
4+
molecule<25.2.0
55
molecule-plugins
66
yamllint
77
requests

0 commit comments

Comments
 (0)