Skip to content

Commit 535486a

Browse files
authored
Ansible refresh (#2)
* added gitflow branches to flow * improve(tests) adjusted for ansible 2.9.20 * refactor: use FQCN for ansible modules * adjusted for 24.04 * refactor: update module names to use FQCN per Ansible 2.18+ * refactor: update tasks_nodejs.yml with FQCN module references * style: convert single-line module calls to multiline YAML format * refactor: Update module names to use FQCN per Ansible 2.18+ * refactor: update ansible modules to use FQCN in tasks_py_anaconda.yml * refactor: update module names to use FQCN per Ansible 2.18 * refactor: update ansible modules to use FQCN in jupyterlab tasks * migration to poetry * adjusted for initial vagrant testing * replaced sudo spawner with systemd spawner * adjusted template
1 parent a900ecf commit 535486a

30 files changed

+1339
-1187
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ name: CI
66
branches:
77
- master
88
- develop
9-
- 'feat*'
10-
- 'hotfix*'
119
- '!release/*'
1210
schedule:
1311
- cron: "10 5 * * 2"
@@ -33,7 +31,10 @@ jobs:
3331
python-version: '3.6'
3432

3533
- name: Install test dependencies.
36-
run: pip3 install yamllint ansible-lint ansible==2.9.6
34+
run: pip3 install yamllint ansible-lint ansible==2.9.20
35+
36+
- name: Install ansible-galaxy dependencies
37+
run: ansible-galaxy collection install community.docker
3738

3839
- name: Lint code.
3940
run: |
@@ -46,11 +47,11 @@ jobs:
4647
strategy:
4748
matrix:
4849
distro:
49-
# - name: fedora33
50-
# - name: centos7
51-
# - name: ubuntu1604
52-
- name: ubuntu1804
53-
- name: ubuntu2004
50+
- fedora33
51+
- centos7
52+
- ubuntu1604
53+
- ubuntu1804
54+
- ubuntu2004
5455

5556
steps:
5657
- name: Check out the codebase.
@@ -80,10 +81,13 @@ jobs:
8081
# - name: Install test dependencies.
8182
# run: pip3 install ansible==2.9.6 molecule[docker] docker
8283

83-
- name: Run simplified molecule tests.
84-
run: pipenv run molecule converge -s docker
84+
- name: Install ansible-galaxy dependencies
85+
run: pipenv run ansible-galaxy collection install community.docker
86+
87+
- name: Run Molecule tests.
88+
run: pipenv run molecule test -s docker
8589
env:
8690
PY_COLORS: '1'
8791
ANSIBLE_FORCE_COLOR: '1'
88-
MOLECULE_DISTRO: ${{ matrix.distro.name }}
92+
MOLECULE_DISTRO: ${{ matrix.distro }}
8993
MOLECULE_TEST_ROLE: role_under_test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ __pycache__/
88
*.pyc
99
.venv
1010
.cache
11+
.aider*

.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 & 108 deletions
This file was deleted.

CONVENTIONS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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.
32+
33+

Makefile

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

Pipfile

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

0 commit comments

Comments
 (0)