Skip to content

Commit 0482997

Browse files
committed
updated special ansible instructions
1 parent e6f4a40 commit 0482997

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

docs/contribute/__ansible_dev_guidelines.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,28 @@ __sample_role_register_installed_packages
3434

3535
### Ansible-lint Cleaning
3636

37-
Only ansible-lint clean collections can be imported into Ansible Galaxy.
37+
Only ansible-lint clean collections can be imported into Ansible Galaxy. To avoid errors we recommend installing and using [pre-commit](__install_pre_commit.md).
3838

39-
- Always install and use the latest version of ansible-lint. As of 02-Dec-2021, it's ansible-lint-5.3.0. Install with:
39+
Then the linting files `.ansible-lint` and `.yamllint.yml` are automatically maintained and installed by any `git clone` or `git pull` request.
40+
The correct linting version is maintained by the `.pre-commit-config.yml` file.
41+
42+
If you do not want to use pre-commit follow this guideline:
43+
44+
45+
- Always install and use the latest version of ansible-lint. You can find the latest release version [here](https://github.com/ansible-community/ansible-lint/releases/).
46+
Install with:
4047
```
4148
# pip3 install ansible-lint --user
4249
```
4350

4451
- Put the following two files in the home directory of each role:
45-
- [.ansible-lint](https://github.com/berndfinger/sap-preconfigure/blob/bz2003630/.ansible-lint)
46-
- [.yamllint.yml](https://github.com/berndfinger/sap-preconfigure/blob/bz2003630/.yamllint.yml)
52+
- [.ansible-lint](https://raw.githubusercontent.com/berndfinger/sap-preconfigure/master/.ansible-lint)
53+
- [.yamllint.yml](https://raw.githubusercontent.com/berndfinger/sap-preconfigure/master/.yamllint.yml)
4754

4855
The files are configured to enforce most default ansible-lint rules but skip others based on certain development requirements and experiences.
4956

5057
- Put the following file into directory .github/workflow of each role:
51-
- [.github/workflows/ansible-lint.yml](https://github.com/berndfinger/sap-preconfigure/blob/bz2003630/.github/workflows/ansible-lint.yml)
58+
- [.github/workflows/ansible-lint.yml](https://raw.githubusercontent.com/berndfinger/sap-preconfigure/master/.github/workflows/ansible-lint.yml)
5259

5360
This will trigger an ansible-lint v. 5.3.0 run in a freshly created virtual system on GitHub after each git push or pull request.
5461

docs/contribute/__install_pre_commit.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@
88

99
## Installation on RHEL8 (defaults to pyhton 3.6)
1010

11-
1. Install Python 3.9
12-
13-
```
14-
$ sudo dnf install python39-3.9.7
15-
```
11+
1. Install Python 3.9 <pre> <code>
12+
sudo dnf install python39-3.9.7
13+
</code></pre>
1614

1715
2. Create a venv and activate it <pre> <code>
18-
$ /usr/bin/python3.9 -m venv ~/.venv/pre-commit
19-
$ . ~/.venv/pre-commit/bin/activate
16+
/usr/bin/python3.9 -m venv ~/.venv/pre-commit
17+
. ~/.venv/pre-commit/bin/activate
2018
</code></pre>
2119

2220
3. Install pre-commit <pre> <code>
23-
$ pip install --upgrade pip
24-
$ pip install pre-commit
21+
pip install --upgrade pip
22+
pip install pre-commit
2523
</code></pre>
2624

2725
4. Set an alias or link to `~/.venv/pre-commit/bin/pre-commit` to use it
2826

29-
On other Linux distributions with newer python versions, you can either create a virtual environment or install with `pip install --user pre-commit`
27+
On other Linux distributions with python 3.7 and later, you can either create a virtual environment or install with `pip install --user pre-commit`
3028

3129
## Using pre-commit
3230

0 commit comments

Comments
 (0)