forked from openstack-k8s-operators/edpm-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add optional vagrant senairo for local testing and development.
The libvirt and nova roles currently uses the delegated driver which runs molecule agaisnt localhost. This is requried for ci as the podman driver cannot be used with this role however it also means you must use a seperate development vm. This change readds supprot for using the molecule vagrant plugin for this role and configures the vagrant senario to use the prepare, converge and verify playbooks from the default delegated senario. Addtionally this change updates yamllint and ansible-lint to not scan files in a venv i.e. .venv in the root of the edpm-ansible repo. .venv is already ignored by .gitignore so this also only affect local development. the molecule-plugins min version is raised to 23.5.0 to include ansible-community/molecule-plugins#142
- Loading branch information
1 parent
467848f
commit 3c252d0
Showing
13 changed files
with
147 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ rules: | |
|
||
ignore: | | ||
zuul.d/*.yaml | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ verifier: | |
name: ansible | ||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
********************************* | ||
Vagrant driver installation guide | ||
********************************* | ||
|
||
Requirements | ||
============ | ||
|
||
* Vagrant | ||
* Libvirt | ||
|
||
Install | ||
======= | ||
|
||
Please refer to the `Virtual environment`_ documentation for installation best | ||
practices. If not using a virtual environment, please consider passing the | ||
widely recommended `'--user' flag`_ when invoking ``pip``. | ||
|
||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ | ||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site | ||
|
||
.. code-block:: bash | ||
|
||
$ pip install 'molecule-plugins[vagrant]\>=23.5.0' | ||
|
||
23.5.0+ is required to avoid a bug in the vagrant driver where molecule utils were not being imported correctly. | ||
This molecule env will be used for local devleopment only and the default delegated env will be used for ci. | ||
as a result its imporant that this senairo mearly contains the the info requried to prepare the vm | ||
and calls the prepare, convernge and verify playbooks from default to keep them in sync. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
provider: | ||
name: libvirt | ||
provision: no | ||
parallel: true | ||
# default_box: 'generic/rocky9' | ||
default_box: 'generic/centos9s' | ||
platforms: | ||
- name: compute-1 | ||
memory: 8192 | ||
cpus: 8 | ||
provider_options: | ||
cpu_mode: 'host-passthrough' | ||
nested: true | ||
machine_type: 'q35' | ||
groups: | ||
- compute | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
converge: ../default/converge.yml | ||
prepare: ../default/prepare.yml | ||
verifier: | ||
name: ansible | ||
scenario: | ||
# we disable all tests so that we dont | ||
# run this in ci. | ||
test_sequence: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
- name: run default scenario verify playbooks | ||
ansible.builtin.import_playbook: ../default/verify.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ verifier: | |
name: ansible | ||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
********************************* | ||
Vagrant driver installation guide | ||
********************************* | ||
|
||
Requirements | ||
============ | ||
|
||
* Vagrant | ||
* Libvirt | ||
|
||
Install | ||
======= | ||
|
||
Please refer to the `Virtual environment`_ documentation for installation best | ||
practices. If not using a virtual environment, please consider passing the | ||
widely recommended `'--user' flag`_ when invoking ``pip``. | ||
|
||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ | ||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site | ||
|
||
.. code-block:: bash | ||
|
||
$ pip install 'molecule-plugins[vagrant]\>=23.5.0' | ||
|
||
23.5.0+ is required to avoid a bug in the vagrant driver where molecule utils were not being imported correctly. | ||
This molecule env will be used for local devleopment only and the default delegated env will be used for ci. | ||
as a result its imporant that this senairo mearly contains the the info requried to prepare the vm | ||
and calls the prepare, convernge and verify playbooks from default to keep them in sync. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
provider: | ||
name: libvirt | ||
provision: no | ||
parallel: true | ||
default_box: 'generic/rocky9' | ||
platforms: | ||
- name: compute-1 | ||
memory: 8192 | ||
cpus: 8 | ||
provider_options: | ||
cpu_mode: 'host-passthrough' | ||
nested: true | ||
machine_type: 'q35' | ||
groups: | ||
- compute | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
converge: ../default/converge.yml | ||
prepare: ../default/prepare.yml | ||
inventory: | ||
hosts: | ||
all: | ||
hosts: | ||
compute-1: | ||
ctlplane_ip: 10.0.0.3 | ||
verifier: | ||
name: ansible | ||
scenario: | ||
# we disable all tests so that we dont | ||
# run this in ci. | ||
test_sequence: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
- name: run default scenario verify playbooks | ||
ansible.builtin.import_playbook: ../default/verify.yml |