Skip to content

Commit 667cde3

Browse files
authored
Initial commit
0 parents  commit 667cde3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1956
-0
lines changed

.ansible-lint

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
profile: production
3+
kinds:
4+
- yaml: "**/meta/collection-requirements.yml"
5+
- playbook: "**/tests/get_coverage.yml"
6+
- yaml: "**/tests/collection-requirements.yml"
7+
- playbook: "**/tests/tests_*.yml"
8+
- playbook: "**/tests/setup-snapshot.yml"
9+
- tasks: "**/tests/*.yml"
10+
- playbook: "**/tests/playbooks/*.yml"
11+
- tasks: "**/tests/tasks/*.yml"
12+
- tasks: "**/tests/tasks/*/*.yml"
13+
- vars: "**/tests/vars/*.yml"
14+
- playbook: "**/examples/*.yml"
15+
skip_list:
16+
- fqcn-builtins
17+
- var-naming[no-role-prefix]
18+
exclude_paths:
19+
- tests/roles/
20+
- .github/
21+
- .markdownlint.yaml
22+
- examples/roles/
23+
mock_roles:
24+
- linux-system-roles.template

.commitlintrc.js

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
module.exports = {
2+
parserPreset: 'conventional-changelog-conventionalcommits',
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'body-max-line-length': [2, 'always', 100],
6+
'footer-leading-blank': [1, 'always'],
7+
'footer-max-line-length': [2, 'always', 100],
8+
'header-max-length': [2, 'always', 100],
9+
'subject-case': [
10+
2,
11+
'never',
12+
['start-case', 'pascal-case', 'upper-case'],
13+
],
14+
'subject-empty': [2, 'never'],
15+
'subject-full-stop': [2, 'never', '.'],
16+
'type-case': [2, 'always', 'lower-case'],
17+
'type-empty': [2, 'never'],
18+
'type-enum': [
19+
2,
20+
'always',
21+
[
22+
'build',
23+
'chore',
24+
'ci',
25+
'docs',
26+
'feat',
27+
'fix',
28+
'perf',
29+
'refactor',
30+
'revert',
31+
'style',
32+
'test',
33+
'tests',
34+
],
35+
],
36+
},
37+
prompt: {
38+
questions: {
39+
type: {
40+
description: "Select the type of change that you're committing",
41+
enum: {
42+
feat: {
43+
description: 'A new feature',
44+
title: 'Features',
45+
emoji: '✨',
46+
},
47+
fix: {
48+
description: 'A bug fix',
49+
title: 'Bug Fixes',
50+
emoji: '🐛',
51+
},
52+
docs: {
53+
description: 'Documentation only changes',
54+
title: 'Documentation',
55+
emoji: '📚',
56+
},
57+
style: {
58+
description:
59+
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
60+
title: 'Styles',
61+
emoji: '💎',
62+
},
63+
refactor: {
64+
description:
65+
'A code change that neither fixes a bug nor adds a feature',
66+
title: 'Code Refactoring',
67+
emoji: '📦',
68+
},
69+
perf: {
70+
description: 'A code change that improves performance',
71+
title: 'Performance Improvements',
72+
emoji: '🚀',
73+
},
74+
test: {
75+
description: 'Adding missing tests or correcting existing tests',
76+
title: 'Tests',
77+
emoji: '🚨',
78+
},
79+
tests: {
80+
description: 'Adding missing tests or correcting existing tests',
81+
title: 'Tests',
82+
emoji: '🚨',
83+
},
84+
build: {
85+
description:
86+
'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
87+
title: 'Builds',
88+
emoji: '🛠',
89+
},
90+
ci: {
91+
description:
92+
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
93+
title: 'Continuous Integrations',
94+
emoji: '⚙️',
95+
},
96+
chore: {
97+
description: "Other changes that don't modify src or test files",
98+
title: 'Chores',
99+
emoji: '♻️',
100+
},
101+
revert: {
102+
description: 'Reverts a previous commit',
103+
title: 'Reverts',
104+
emoji: '🗑',
105+
},
106+
},
107+
},
108+
scope: {
109+
description:
110+
'What is the scope of this change (e.g. component or file name)',
111+
},
112+
subject: {
113+
description:
114+
'Write a short, imperative tense description of the change',
115+
},
116+
body: {
117+
description: 'Provide a longer description of the change',
118+
},
119+
isBreaking: {
120+
description: 'Are there any breaking changes?',
121+
},
122+
breakingBody: {
123+
description:
124+
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself',
125+
},
126+
breaking: {
127+
description: 'Describe the breaking changes',
128+
},
129+
isIssueAffected: {
130+
description: 'Does this change affect any open issues?',
131+
},
132+
issuesBody: {
133+
description:
134+
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself',
135+
},
136+
issues: {
137+
description: 'Add issue references (e.g. "fix #123", "re #123".)',
138+
},
139+
},
140+
},
141+
};

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://help.github.com/en/articles/about-code-owners
2+
# Default reviewers for everything
3+
* @spetrosi @nhosoi @richm

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: monthly
8+
commit-message:
9+
prefix: ci

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Enhancement:
2+
3+
Reason:
4+
5+
Result:
6+
7+
Issue Tracker Tickets (Jira or BZ if any):

.github/workflows/ansible-lint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Ansible Lint
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
merge_group:
6+
branches:
7+
- main
8+
types:
9+
- checks_requested
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
env:
15+
LSR_ROLE2COLL_NAMESPACE: fedora
16+
LSR_ROLE2COLL_NAME: linux_system_roles
17+
permissions:
18+
contents: read
19+
jobs:
20+
ansible_lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Update pip, git
24+
run: |
25+
set -euxo pipefail
26+
sudo apt update
27+
sudo apt install -y git
28+
29+
- name: Checkout repo
30+
uses: actions/checkout@v4
31+
32+
- name: Install tox, tox-lsr
33+
run: |
34+
set -euxo pipefail
35+
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
36+
37+
- name: Convert role to collection format
38+
run: |
39+
set -euxo pipefail
40+
TOXENV=collection lsr_ci_runtox
41+
coll_dir=".tox/ansible_collections/$LSR_ROLE2COLL_NAMESPACE/$LSR_ROLE2COLL_NAME"
42+
# ansible-lint action requires a .git directory???
43+
# https://github.com/ansible/ansible-lint/blob/main/action.yml#L45
44+
mkdir -p "$coll_dir/.git"
45+
46+
- name: Run ansible-lint
47+
uses: ansible/ansible-lint@v24
48+
with:
49+
working_directory: .tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Check for ansible_managed variable use in comments
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
merge_group:
6+
branches:
7+
- main
8+
types:
9+
- checks_requested
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
permissions:
15+
contents: read
16+
jobs:
17+
ansible_managed_var_comment:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Update pip, git
21+
run: |
22+
set -euxo pipefail
23+
python3 -m pip install --upgrade pip
24+
sudo apt update
25+
sudo apt install -y git
26+
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Install tox, tox-lsr
31+
run: |
32+
set -euxo pipefail
33+
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
34+
35+
- name: Run ansible-plugin-scan
36+
run: |
37+
set -euxo pipefail
38+
TOXENV=ansible-managed-var-comment lsr_ci_runtox
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Ansible Plugin Scan
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
merge_group:
6+
branches:
7+
- main
8+
types:
9+
- checks_requested
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
permissions:
15+
contents: read
16+
jobs:
17+
ansible_plugin_scan:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Update pip, git
21+
run: |
22+
set -euxo pipefail
23+
python3 -m pip install --upgrade pip
24+
sudo apt update
25+
sudo apt install -y git
26+
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Install tox, tox-lsr
31+
run: |
32+
set -euxo pipefail
33+
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
34+
35+
- name: Run ansible-plugin-scan
36+
run: |
37+
set -euxo pipefail
38+
TOXENV=ansible-plugin-scan lsr_ci_runtox

.github/workflows/ansible-test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Ansible Test
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
merge_group:
6+
branches:
7+
- main
8+
types:
9+
- checks_requested
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
env:
15+
LSR_ROLE2COLL_NAMESPACE: fedora
16+
LSR_ROLE2COLL_NAME: linux_system_roles
17+
permissions:
18+
contents: read
19+
jobs:
20+
ansible_test:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Update pip, git
24+
run: |
25+
set -euxo pipefail
26+
python3 -m pip install --upgrade pip
27+
sudo apt update
28+
sudo apt install -y git
29+
30+
- name: Checkout repo
31+
uses: actions/checkout@v4
32+
33+
- name: Install tox, tox-lsr
34+
run: |
35+
set -euxo pipefail
36+
pip3 install "git+https://github.com/linux-system-roles/[email protected]"
37+
38+
- name: Convert role to collection format
39+
run: |
40+
set -euxo pipefail
41+
TOXENV=collection lsr_ci_runtox
42+
43+
- name: Run ansible-test
44+
uses: ansible-community/ansible-test-gh-action@release/v1
45+
with:
46+
testing-type: sanity # wokeignore:rule=sanity
47+
collection-src-directory: .tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}

0 commit comments

Comments
 (0)