Skip to content

Commit b49d739

Browse files
Merge pull request #173 from juju4/devel
chore: fix ansible-lint 6.17.2
2 parents f7f0dca + 59fe08d commit b49d739

23 files changed

+141
-114
lines changed

.ansible-lint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
12
skip_list:
23
- '106'
34
- ignore-errors
5+
- yaml[truthy]
6+
exclude_paths:
7+
- .github/workflows/

.github/workflows/lint.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,32 @@ on:
66
branches:
77
- master
88
- main
9+
- devel*
910

1011
jobs:
1112
lint:
1213
name: Lint
1314
runs-on: ubuntu-latest
15+
env:
16+
ANSIBLE_ROLE: monolithprojects.github_actions_runner
17+
SUITE: default
1418
steps:
1519
- name: Check out the codebase.
1620
uses: actions/checkout@v3
1721
with:
18-
path: "${{ github.repository }}"
22+
path: ${{ env.ANSIBLE_ROLE }}
1923

2024
- name: Set up Python 3.
2125
uses: actions/setup-python@v4
2226
with:
2327
python-version: '3.x'
2428

2529
- name: Install test dependencies.
26-
run: pip3 install ansible-lint yamllint
30+
run: |
31+
pip3 install ansible-lint yamllint
32+
[ -f molecule/${SUITE}/requirements.yml ] && ansible-galaxy install -r molecule/${SUITE}/requirements.yml
33+
{ echo '[defaults]'; echo 'callbacks_enabled = profile_tasks, timer'; echo 'roles_path = ../:/home/runner/.ansible/roles'; echo 'ansible_python_interpreter: /usr/bin/python3'; } >> ansible.cfg
2734
2835
- name: Lint code.
2936
run: |
30-
ansible-lint --exclude molecule/ --exclude .github/
37+
cd $GITHUB_WORKSPACE/$ANSIBLE_ROLE && ansible-lint --exclude molecule/ --exclude .github/

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- master
8+
- devel*
89

910
jobs:
1011
pre-commit:

.github/workflows/tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: molecule test
33
on:
44
pull_request:
55
branches:
6-
- master
7-
- main
6+
- master
7+
- main
8+
- devel*
89
types: [opened, synchronize, reopened]
910
paths:
1011
- 'defaults/**'
@@ -49,7 +50,10 @@ jobs:
4950
python-version: '3.x'
5051

5152
- name: Install test dependencies
52-
run: pip3 install ansible docker molecule molecule-plugins[docker] "requests<2.29.2" jmespath
53+
run: |
54+
pip3 install ansible docker molecule molecule-plugins[docker] "requests<2.29.2" jmespath
55+
# https://github.com/ansible/molecule/issues/4017
56+
pip3 install ansible ansible-core==2.15.2 ansible-compat==4.1.5 'molecule<6' molecule-plugins[docker] docker
5357
5458
- name: Run Molecule test - repo
5559
run: molecule test --scenario-name repo

molecule/custom_env/cleanup.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
hosts: all
55
become: yes
66
vars:
7-
- runner_user: ansible
8-
- github_repo: ansible-github_actions_runner-testrepo
9-
- github_account: monolithprojects-testorg
10-
- runner_state: absent
7+
runner_user: ansible
8+
github_repo: ansible-github_actions_runner-testrepo
9+
github_account: monolithprojects-testorg
10+
runner_state: absent
1111
roles:
12-
- ansible-github_actions_runner
12+
- monolithprojects.github_actions_runner

molecule/custom_env/converge.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
gather_facts: yes
66
become: yes
77
vars:
8-
- runner_user: ansible
9-
- github_repo: ansible-github_actions_runner-testrepo
10-
- github_account: monolithprojects-testorg
11-
- runner_version: "latest"
12-
- runner_labels:
8+
runner_user: ansible
9+
github_repo: ansible-github_actions_runner-testrepo
10+
github_account: monolithprojects-testorg
11+
runner_version: "latest"
12+
runner_labels:
1313
- label1
1414
- repo-runner
15-
- custom_env: |
15+
custom_env: |
1616
# HTTPS_PROXY=YOUR_URL_HERE
1717
1818
roles:
1919
- robertdebock.epel
20-
- ansible-github_actions_runner
20+
- monolithprojects.github_actions_runner

molecule/custom_env/requirements.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
2-
- role: robertdebock.epel
2+
3+
roles:
4+
- name: robertdebock.epel
35
version: 3.0.1

molecule/custom_env/verify.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
- name: validate Repo runners
2+
- name: Validate Repo runners
33
user: ansible
44
hosts: all
55
gather_facts: yes
66
become: yes
77
vars:
8-
- runner_user: ansible
9-
- github_repo: ansible-github_actions_runner-testrepo
10-
- github_account: monolithprojects-testorg
11-
- github_api_url: "https://api.github.com"
12-
- access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
13-
- runner_name: ubuntu16-latest
8+
runner_user: ansible
9+
github_repo: ansible-github_actions_runner-testrepo
10+
github_account: monolithprojects-testorg
11+
github_api_url: "https://api.github.com"
12+
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
13+
runner_name: ubuntu16-latest
1414

1515
tasks:
1616
- name: Check currently registered runners
17-
uri:
17+
ansible.builtin.uri:
1818
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
1919
headers:
2020
Authorization: "token {{ access_token }}"
@@ -24,23 +24,24 @@
2424
force_basic_auth: yes
2525
register: registered_runners
2626

27-
- debug:
27+
- name: Debug | var registered_runners
28+
ansible.builtin.debug:
2829
var: registered_runners.json.runners
2930

3031
- name: Check Runner
31-
assert:
32+
ansible.builtin.assert:
3233
that:
3334
- runner_name in registered_runners.json.runners|map(attribute='name')|list
3435
- registered_runners.json.runners|map(attribute='status') == ["online"]
3536
quiet: true
3637

3738
- name: Check Labels (skipped if labels are OK)
38-
fail:
39+
ansible.builtin.fail:
3940
msg: Woops some labels differ "{{ (registered_runners.json.runners.0 | json_query('labels[*].name') | difference(['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'])) }}"
4041
when: not (registered_runners.json.runners.0 | json_query('labels[*].name') | list ) == (['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'] | list)
4142

4243
- name: Check custom env file is configured
43-
lineinfile:
44+
ansible.builtin.lineinfile:
4445
dest: /opt/actions-runner/.env
4546
line: "# HTTPS_PROXY=YOUR_URL_HERE"
4647
check_mode: yes

molecule/default/cleanup.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
hosts: all
55
become: yes
66
vars:
7-
- runner_user: ansible
8-
- github_repo: ansible-github_actions_runner-testrepo
9-
- github_account: monolithprojects-testorg
10-
- runner_state: absent
11-
- runner_name: test_name
7+
runner_user: ansible
8+
github_repo: ansible-github_actions_runner-testrepo
9+
github_account: monolithprojects-testorg
10+
runner_state: absent
11+
runner_name: test_name
1212
roles:
13-
- ansible-github_actions_runner
13+
- monolithprojects.github_actions_runner

molecule/default/converge.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
gather_facts: yes
66
become: yes
77
vars:
8-
- runner_user: ansible
9-
- github_repo: ansible-github_actions_runner-testrepo
10-
- github_account: monolithprojects-testorg
11-
- runner_version: "latest"
12-
- runner_name: test_name
13-
- runner_on_ghes: yes
14-
- reinstall_runner: false
15-
- hide_sensitive_logs: no
16-
- runner_labels:
8+
runner_user: ansible
9+
github_repo: ansible-github_actions_runner-testrepo
10+
github_account: monolithprojects-testorg
11+
runner_version: "latest"
12+
runner_name: test_name
13+
runner_on_ghes: yes
14+
reinstall_runner: false
15+
hide_sensitive_logs: no
16+
runner_labels:
1717
- label1
1818
- repo-runner
1919
roles:
2020
- robertdebock.epel
21-
- ansible-github_actions_runner
21+
- monolithprojects.github_actions_runner

molecule/default/requirements.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
2-
- role: robertdebock.epel
2+
3+
roles:
4+
- name: robertdebock.epel
35
version: 3.0.1

molecule/default/verify.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
- name: validate Repo runners
2+
- name: Validate Repo runners
33
user: ansible
44
hosts: all
55
gather_facts: yes
66
become: yes
77
vars:
8-
- runner_user: ansible
9-
- github_repo: ansible-github_actions_runner-testrepo
10-
- github_account: monolithprojects-testorg
11-
- github_api_url: "https://api.github.com"
12-
- access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
13-
- runner_name: ubuntu16-latest
8+
runner_user: ansible
9+
github_repo: ansible-github_actions_runner-testrepo
10+
github_account: monolithprojects-testorg
11+
github_api_url: "https://api.github.com"
12+
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
13+
runner_name: ubuntu16-latest
1414

1515
tasks:
1616
- name: Check currently registered runners
17-
uri:
17+
ansible.builtin.uri:
1818
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
1919
headers:
2020
Authorization: "token {{ access_token }}"
@@ -24,17 +24,18 @@
2424
force_basic_auth: yes
2525
register: registered_runners
2626

27-
- debug:
27+
- name: Debug | var registered_runners
28+
ansible.builtin.debug:
2829
var: registered_runners.json.runners
2930

3031
- name: Check Runner
31-
assert:
32+
ansible.builtin.assert:
3233
that:
3334
- runner_name in registered_runners.json.runners|map(attribute='name')|list
3435
- registered_runners.json.runners|map(attribute='status') == ["online"]
3536
quiet: true
3637

3738
- name: Check Labels (skipped if labels are OK)
38-
fail:
39+
ansible.builtin.fail:
3940
msg: Woops some labels differ "{{ (registered_runners.json.runners.0 | json_query('labels[*].name') | difference(['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'])) }}"
4041
when: not (registered_runners.json.runners.0 | json_query('labels[*].name') | list ) == (['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'] | list)

molecule/org/cleanup.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
hosts: all
55
become: yes
66
vars:
7-
- runner_user: ansible
8-
- github_account: monolithprojects-testorg
9-
- runner_org: yes
10-
- runner_state: absent
7+
runner_user: ansible
8+
github_account: monolithprojects-testorg
9+
runner_org: yes
10+
runner_state: absent
1111
roles:
12-
- ansible-github_actions_runner
12+
- monolithprojects.github_actions_runner

molecule/org/converge.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
hosts: all
55
become: yes
66
vars:
7-
- runner_user: ansible
8-
- github_account: monolithprojects-testorg
9-
- runner_org: yes
10-
- runner_state: "stopped"
11-
- runner_version: "2.303.0"
7+
runner_user: ansible
8+
github_account: monolithprojects-testorg
9+
runner_org: yes
10+
runner_state: "stopped"
11+
runner_version: "2.303.0"
1212
roles:
1313
- robertdebock.epel
14-
- ansible-github_actions_runner
14+
- monolithprojects.github_actions_runner

molecule/org/requirements.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
2-
- role: robertdebock.epel
2+
3+
roles:
4+
- name: robertdebock.epel
35
version: 3.0.1

molecule/org/verify.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
2-
- name: validate Repo runners
2+
- name: Validate Repo runners
33
user: ansible
44
hosts: all
55
gather_facts: yes
66
become: yes
77
vars:
8-
- runner_user: ansible
9-
- github_account: monolithprojects-testorg
10-
- runner_org: yes
11-
- github_api_url: "https://api.github.com"
12-
- access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
13-
- runner_name: "{{ ansible_hostname }}"
8+
runner_user: ansible
9+
github_account: monolithprojects-testorg
10+
runner_org: yes
11+
github_api_url: "https://api.github.com"
12+
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
13+
runner_name: "{{ ansible_hostname }}"
1414

1515
tasks:
1616
- name: Give the runners a minute
17-
pause:
17+
ansible.builtin.pause:
1818
seconds: 30
1919

2020
- name: Check currently registered runners
21-
uri:
21+
ansible.builtin.uri:
2222
url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners"
2323
headers:
2424
Authorization: "token {{ access_token }}"
@@ -29,7 +29,7 @@
2929
register: registered_runners
3030

3131
- name: Check Runner
32-
assert:
32+
ansible.builtin.assert:
3333
that:
3434
- runner_name in registered_runners.json.runners|map(attribute='name')|list
3535
quiet: true

molecule/repo/cleanup.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
hosts: all
55
become: yes
66
vars:
7-
- runner_user: ansible
8-
- github_repo: ansible-github_actions_runner-testrepo
9-
- github_account: monolithprojects-testorg
10-
- runner_state: absent
7+
runner_user: ansible
8+
github_repo: ansible-github_actions_runner-testrepo
9+
github_account: monolithprojects-testorg
10+
runner_state: absent
1111
roles:
12-
- ansible-github_actions_runner
12+
- monolithprojects.github_actions_runner

0 commit comments

Comments
 (0)