Skip to content

Commit a9d7cc7

Browse files
committed
Merge branch 'release/2.5.0'
2 parents 431b235 + bbb98d8 commit a9d7cc7

33 files changed

+2092
-1403
lines changed

.ansible-lint

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
# Ansible-lint rules https://ansible-lint.readthedocs.io/en/latest/default_rules.html
12
exclude_paths:
23
- ./box-example
4+
- ./molecule
5+
- ./tests
36
parseable: true
47
quiet: true
58
skip_list:
69
- skip_linting
7-
- '602'
10+
- '106'
811
- '204'
12+
- '602'
13+
- 'schema[meta]'
914
use_default_rules: true
1015
verbosity: 1

.gitignore

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,11 @@ box-example/roles
33
tempfile
44
local*.sh
55
.idea
6-
__pycache__
6+
__pycache__/
77
**/*/__pycache__
88
*.pyc
9-
*/**/.terraform
10-
releases
11-
roles/**/box-example
12-
roles/**/molecule
13-
roles/**/tests/
14-
roles/**/meta
15-
roles/**/.travis.yml
16-
roles/**/.gitignore
17-
roles/**/Pipfile*
18-
roles/**/.ansible-lint
19-
*.bak
20-
*.gz
21-
*.tar.gz
22-
*.tgz
239
.venv
10+
.cache
11+
.aid*
12+
.ansible
13+
auto-patch.sh

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-added-large-files
9+
- id: detect-private-key
10+
- repo: https://github.com/PyCQA/flake8.git
11+
rev: 7.2.0
12+
hooks:
13+
- id: flake8
14+
- repo: https://github.com/adrienverge/yamllint.git
15+
rev: v1.37.1
16+
hooks:
17+
- id: yamllint
18+
files: \.(yaml|yml)$
19+
types: [file, yaml]
20+
entry: yamllint --strict -f parsable
21+
- repo: https://github.com/ansible/ansible-lint
22+
rev: v25.4.0
23+
hooks:
24+
- id: ansible-lint
25+
always_run: true
26+
pass_filenames: false
27+
# do not add file filters here as ansible-lint does not give reliable
28+
# results when called with individual files.
29+
# https://github.com/ansible/ansible-lint/issues/611
30+
# https://ansible-lint.readthedocs.io/en/latest/default_rules.html
31+
verbose: true
32+
# plugins is the standard collection dir for modules
33+
entry: env ANSIBLE_LIBRARY=plugins ansible-lint --force-color -p -v .
34+
additional_dependencies:
35+
- 'ansible>11,<12'
36+
- repo: https://github.com/openstack-dev/bashate.git
37+
rev: 2.1.1
38+
hooks:
39+
- id: bashate
40+
# Run bashate check for all bash scripts
41+
# Ignores the following rules:
42+
# E003: Indends are not multiple of 4
43+
# E006: Line longer than 79 columns (as many scripts use jinja
44+
# templating, this is very difficult)
45+
# E040: Syntax error determined using `bash -n` (as many scripts
46+
# use jinja templating, this will often fail and the syntax
47+
# error will be discovered in execution anyway)
48+
entry: bashate --error . --verbose --ignore=E006,E040,E003

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ansible-molecule-v3

.travis.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.yamllint

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@ ignore: |
55
.venv
66
molecule
77
.travis.yml
8+
.github
89

910
rules:
1011
braces: {max-spaces-inside: 1, level: error}
1112
brackets: {max-spaces-inside: 1, level: error}
1213
colons: {max-spaces-after: -1, level: error}
1314
commas: {max-spaces-after: -1, level: error}
14-
comments: disable
15-
comments-indentation: disable
15+
comments-indentation: false
16+
comments:
17+
min-spaces-from-content: 1
1618
document-start: disable
1719
empty-lines: {max: 3, level: error}
1820
hyphens: {level: error}
1921
indentation: disable
2022
key-duplicates: enable
2123
line-length:
22-
max: 140
24+
max: 290
2325
level: warning
2426
new-line-at-end-of-file: disable
2527
new-lines: {type: unix}
28+
octal-values:
29+
forbid-implicit-octal: true
30+
forbid-explicit-octal: true
2631
trailing-spaces: disable
2732
truthy: disable

CONVENTIONS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
When we are developing ansible roles we should follow the conventions below.
2+
3+
## General
4+
Do not change role logic, and remove any existing code without confirmation or PR review,
5+
other code might depend on role logic, instead, confirm.
6+
7+
In yaml files, use 2 spaces for indentation.
8+
9+
## Roles
10+
### Role name
11+
Role name should be in the format of `sa_<service_name>`
12+
13+
## Tasks
14+
15+
We should use fully qualified names for modules, as per ansible documentation.
16+
Some validated names include:
17+
ansible.builtin.apt_key
18+
ansible.builtin.apt_repository
19+
When calling a module, always specify name in a format GOAL | What step does.
20+
21+
Example:
22+
```
23+
- name: GIT | Install modern git ppa repo
24+
```
25+
26+
usually goal is the word after tasks_, in tasks file name, like GIT for tasks_git.yml
27+
28+
### Arguments
29+
30+
When calling a module, do not pass arguments in the same line inline,
31+
prefer yaml style with sub-nodes.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 softasap
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
init:
2+
pipenv install --python 3
3+
4+
vagrant-login:
5+
molecule login -s default
6+
7+
update-from-requirements:
8+
pipenv install -r ./molecule/requirements-dev.txt
9+
10+
molecule-docker-centos7:
11+
ansible-galaxy collection install community.docker
12+
MOLECULE_DISTRO=centos7 MOLECULE_TEST_ROLE=$(notdir $(CURDIR)) molecule converge -s docker
13+
14+
molecule-docker-fedora33:
15+
ansible-galaxy collection install community.docker
16+
MOLECULE_DISTRO=fedora33 MOLECULE_TEST_ROLE=$(notdir $(CURDIR)) molecule converge -s docker
17+
18+
molecule-docker-xenial:
19+
ansible-galaxy collection install community.docker
20+
MOLECULE_DISTRO=ubuntu1604 MOLECULE_TEST_ROLE=$(notdir $(CURDIR)) molecule converge -s docker
21+
22+
molecule-docker-beaver:
23+
ansible-galaxy collection install community.docker
24+
MOLECULE_DISTRO=ubuntu1804 MOLECULE_TEST_ROLE=$(notdir $(CURDIR)) molecule converge -s docker
25+
26+
molecule-docker-focal:
27+
ansible-galaxy collection install community.docker
28+
MOLECULE_DISTRO=ubuntu2004 MOLECULE_TEST_ROLE=$(notdir $(CURDIR)) molecule converge -s docker

Pipfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)