molecule-libvirt-ng 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. molecule_libvirt_ng-1.0.0/.flake8 +8 -0
  2. molecule_libvirt_ng-1.0.0/.github/CODEOWNERS +1 -0
  3. molecule_libvirt_ng-1.0.0/.github/workflows/release.yml +34 -0
  4. molecule_libvirt_ng-1.0.0/.github/workflows/tox.yml +51 -0
  5. molecule_libvirt_ng-1.0.0/.gitignore +129 -0
  6. molecule_libvirt_ng-1.0.0/.pre-commit-config.yaml +29 -0
  7. molecule_libvirt_ng-1.0.0/.yamllint +19 -0
  8. molecule_libvirt_ng-1.0.0/LICENSE +21 -0
  9. molecule_libvirt_ng-1.0.0/PKG-INFO +222 -0
  10. molecule_libvirt_ng-1.0.0/README.rst +184 -0
  11. molecule_libvirt_ng-1.0.0/bindep.txt +18 -0
  12. molecule_libvirt_ng-1.0.0/conftest.py +0 -0
  13. molecule_libvirt_ng-1.0.0/molecule_libvirt/__init__.py +0 -0
  14. molecule_libvirt_ng-1.0.0/molecule_libvirt/driver.py +157 -0
  15. molecule_libvirt_ng-1.0.0/molecule_libvirt/playbooks/create.yml +313 -0
  16. molecule_libvirt_ng-1.0.0/molecule_libvirt/playbooks/destroy.yml +169 -0
  17. molecule_libvirt_ng-1.0.0/molecule_libvirt/playbooks/templates/meta-data.j2 +2 -0
  18. molecule_libvirt_ng-1.0.0/molecule_libvirt/playbooks/templates/network/network.xml.j2 +10 -0
  19. molecule_libvirt_ng-1.0.0/molecule_libvirt/playbooks/templates/user-data.j2 +30 -0
  20. molecule_libvirt_ng-1.0.0/molecule_libvirt/playbooks/templates/vm/vm.xml.j2 +96 -0
  21. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/__init__.py +0 -0
  22. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/functional/.ansible-lint +9 -0
  23. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/functional/__init__.py +0 -0
  24. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/functional/conftest.py +23 -0
  25. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/functional/test_libvirt.py +61 -0
  26. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/default/molecule.yml +11 -0
  27. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/default/playbook.yml +7 -0
  28. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/default/tests/test_default.py +29 -0
  29. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/multi-node/molecule.yml +18 -0
  30. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/multi-node/playbook.yml +28 -0
  31. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/multi-node/prepare.yml +9 -0
  32. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/multi-node/tests/__init__.py +0 -0
  33. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/scenarios/driver/libvirt/molecule/multi-node/tests/test_default.py +31 -0
  34. molecule_libvirt_ng-1.0.0/molecule_libvirt/test/test_driver.py +5 -0
  35. molecule_libvirt_ng-1.0.0/molecule_libvirt_ng.egg-info/PKG-INFO +222 -0
  36. molecule_libvirt_ng-1.0.0/molecule_libvirt_ng.egg-info/SOURCES.txt +45 -0
  37. molecule_libvirt_ng-1.0.0/molecule_libvirt_ng.egg-info/dependency_links.txt +1 -0
  38. molecule_libvirt_ng-1.0.0/molecule_libvirt_ng.egg-info/entry_points.txt +2 -0
  39. molecule_libvirt_ng-1.0.0/molecule_libvirt_ng.egg-info/requires.txt +10 -0
  40. molecule_libvirt_ng-1.0.0/molecule_libvirt_ng.egg-info/top_level.txt +3 -0
  41. molecule_libvirt_ng-1.0.0/pyproject.toml +70 -0
  42. molecule_libvirt_ng-1.0.0/pytest.ini +5 -0
  43. molecule_libvirt_ng-1.0.0/setup.cfg +4 -0
  44. molecule_libvirt_ng-1.0.0/test_requirements.yml +8 -0
  45. molecule_libvirt_ng-1.0.0/tools/test-setup.sh +16 -0
  46. molecule_libvirt_ng-1.0.0/tox.ini +51 -0
  47. molecule_libvirt_ng-1.0.0/zuul.d/layout.yaml +47 -0
@@ -0,0 +1,8 @@
1
+ [flake8]
2
+ # do not add excludes for files in repo
3
+ exclude = .venv/,.tox/,dist/,build/,.eggs/
4
+ format = pylint
5
+ # E203: https://github.com/python/black/issues/315
6
+ ignore = E741,W503,W504,H,E501,E203
7
+ # 88 is official black default:
8
+ max-line-length = 88
@@ -0,0 +1 @@
1
+ * @ssbarnea @jamesregis
@@ -0,0 +1,34 @@
1
+ name: release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ pypi:
9
+ name: Publish to PyPI registry
10
+ environment: release
11
+ runs-on: ubuntu-latest
12
+
13
+ env:
14
+ FORCE_COLOR: 1
15
+ PY_COLORS: 1
16
+
17
+ permissions:
18
+ id-token: write
19
+
20
+ steps:
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ - name: Install build tools
26
+ run: python3 -m pip install --user build twine
27
+ - name: Check out src from Git
28
+ uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0
31
+ - name: Build dists
32
+ run: python -m build
33
+ - name: Publish to PyPI
34
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,51 @@
1
+ name: tox
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ tags-ignore:
8
+ - "**"
9
+ pull_request:
10
+
11
+ jobs:
12
+ build:
13
+ name: ${{ matrix.tox_env }}
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ include:
19
+ - tox_env: lint
20
+ python-version: "3.12"
21
+ - tox_env: py310
22
+ python-version: "3.10"
23
+ - tox_env: py311
24
+ python-version: "3.11"
25
+ - tox_env: py312
26
+ python-version: "3.12"
27
+ - tox_env: py313
28
+ python-version: "3.13"
29
+ - tox_env: packaging
30
+ python-version: "3.12"
31
+
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0
36
+ - name: Set up Python ${{ matrix.python-version }}
37
+ uses: actions/setup-python@v5
38
+ with:
39
+ python-version: ${{ matrix.python-version }}
40
+ - name: Install system dependencies
41
+ run: |
42
+ sudo apt-get update
43
+ sudo apt-get install -y libvirt-dev pkg-config
44
+ - name: Install dependencies
45
+ run: |
46
+ python -m pip install -U pip
47
+ pip install tox
48
+ - name: Run tox
49
+ env:
50
+ TOX_ENV: ${{ matrix.tox_env }}
51
+ run: tox -e "$TOX_ENV"
@@ -0,0 +1,129 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
@@ -0,0 +1,29 @@
1
+ ---
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks.git
4
+ rev: v5.0.0
5
+ hooks:
6
+ - id: end-of-file-fixer
7
+ - id: trailing-whitespace
8
+ - id: mixed-line-ending
9
+ - id: check-byte-order-marker
10
+ - id: check-executables-have-shebangs
11
+ - id: check-merge-conflict
12
+ - id: debug-statements
13
+ - repo: https://github.com/astral-sh/ruff-pre-commit
14
+ rev: v0.9.7
15
+ hooks:
16
+ - id: ruff
17
+ args: [--fix]
18
+ - id: ruff-format
19
+ - repo: https://github.com/adrienverge/yamllint.git
20
+ rev: v1.35.1
21
+ hooks:
22
+ - id: yamllint
23
+ files: \.(yaml|yml)$
24
+ types: [file, yaml]
25
+ entry: yamllint --strict
26
+ - repo: https://github.com/codespell-project/codespell.git
27
+ rev: v2.4.1
28
+ hooks:
29
+ - id: codespell
@@ -0,0 +1,19 @@
1
+ extends: default
2
+ ignore: |
3
+ .tox
4
+
5
+ rules:
6
+ braces:
7
+ max-spaces-inside: 1
8
+ level: error
9
+ brackets:
10
+ max-spaces-inside: 1
11
+ level: error
12
+ comments:
13
+ min-spaces-from-content: 1
14
+ comments-indentation: disable
15
+ document-start: disable
16
+ line-length: disable
17
+ octal-values:
18
+ forbid-implicit-octal: true
19
+ forbid-explicit-octal: true
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 PyContribs
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.
@@ -0,0 +1,222 @@
1
+ Metadata-Version: 2.4
2
+ Name: molecule-libvirt-ng
3
+ Version: 1.0.0
4
+ Summary: libvirt Molecule Plugin :: run molecule tests on libvirt
5
+ Author-email: Ansible by Red Hat <info@ansible.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/codanael/molecule-libvirt
8
+ Project-URL: Bug Tracker, https://github.com/codanael/molecule-libvirt/issues
9
+ Project-URL: Source Code, https://github.com/codanael/molecule-libvirt
10
+ Keywords: ansible,roles,testing,molecule,plugin,libvirt
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Information Technology
15
+ Classifier: Intended Audience :: System Administrators
16
+ Classifier: Natural Language :: English
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: System :: Systems Administration
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/x-rst
27
+ License-File: LICENSE
28
+ Requires-Dist: molecule>=24.2.0
29
+ Requires-Dist: pyyaml>=5.1
30
+ Requires-Dist: jmespath
31
+ Requires-Dist: lxml
32
+ Requires-Dist: netaddr
33
+ Requires-Dist: pycdlib
34
+ Provides-Extra: test
35
+ Requires-Dist: molecule[test]; extra == "test"
36
+ Requires-Dist: pytest; extra == "test"
37
+ Dynamic: license-file
38
+
39
+ ***********************
40
+ Molecule libvirt Plugin
41
+ ***********************
42
+
43
+ .. image:: https://badge.fury.io/py/molecule-libvirt.svg
44
+ :target: https://badge.fury.io/py/molecule-libvirt
45
+ :alt: PyPI Package
46
+
47
+ .. image:: https://zuul-ci.org/gated.svg
48
+ :target: https://dashboard.zuul.ansible.com/t/ansible/builds?project=ansible-community/molecule
49
+
50
+ .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
51
+ :target: https://github.com/python/black
52
+ :alt: Python Black Code Style
53
+
54
+ .. image:: https://img.shields.io/badge/Code%20of%20Conduct-Ansible-silver.svg
55
+ :target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
56
+ :alt: Ansible Code of Conduct
57
+
58
+ .. image:: https://img.shields.io/badge/Mailing%20lists-Ansible-orange.svg
59
+ :target: https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
60
+ :alt: Ansible mailing lists
61
+
62
+ .. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
63
+ :target: LICENSE
64
+ :alt: Repository License
65
+
66
+ Molecule libvirt is designed to allow use of libvirt for provisioning test
67
+ resources.
68
+
69
+ Please note that this driver is currently in its early stage of development,
70
+ do not even try to install or use it until this message is removed.
71
+
72
+ .. _quickstart:
73
+
74
+ Quickstart
75
+ ==========
76
+
77
+ Installation
78
+ ------------
79
+ .. code-block:: bash
80
+
81
+ pip install molecule-libvirt
82
+
83
+ Create a scenario
84
+ -----------------
85
+
86
+ With a new role
87
+ ^^^^^^^^^^^^^^^
88
+
89
+ .. code-block:: bash
90
+
91
+   molecule init role -d libvirt my-role
92
+
93
+ This will create a new folder *my-role* containing a bare-bone generated
94
+ role like you would do with ``ansible-galaxy init`` command.
95
+
96
+ It will also contain a molecule folder with a default scenario
97
+ using the libvirt driver (using ansible community.libvirt collection).
98
+
99
+ Install the collection using:
100
+
101
+ ``ansible-galaxy install -r test_requirements.yml``.
102
+
103
+ Example
104
+ -------
105
+ This is a `molecule.yml` example file
106
+
107
+ .. code-block:: yaml
108
+
109
+ dependency:
110
+ name: galaxy
111
+ driver:
112
+ name: libvirt
113
+ platforms:
114
+ - name: instance-1
115
+ cpu: 1
116
+ cpu_model: "qemu64"
117
+ image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
118
+ disk_size: "10G"
119
+ ssh_port: 22
120
+ memory_size: "1" # in GB
121
+ - name: instance-2
122
+ memory: "1"
123
+ cpus: 1
124
+ image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
125
+ libvirt_host: "server.home.lan"
126
+ libvirt_user: "james"
127
+ bridge_name: "bridge0"
128
+ - name: instance-3
129
+ memory: "1"
130
+ cpus: 1
131
+ image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
132
+ libvirt_host: "server.home.lan"
133
+ libvirt_user: "james"
134
+ bridge_name: "bridge0"
135
+ provisioner:
136
+ name: ansible
137
+ verifier:
138
+ name: ansible
139
+
140
+ Optional parameters
141
+ -------------------
142
+
143
+ ``molecule_bridge``: existing bridge on local host. Can be useful if you
144
+ want to set network interface name created for molecule.
145
+ default value is: **molecule-br0**.
146
+
147
+ ``molecule_network_cidr``: ip address range that should be bind to molecule
148
+ virtual network.
149
+ default value is: **10.10.10.0/24**.
150
+
151
+ ``qemu_user``: qemu process user. On RHEL like system qemu user is **qemu**.
152
+ On Debian like, qemu user is **libvirt-qemu**.
153
+ default value is: **qemu**.
154
+
155
+ ``cpu_model``: specifies CPU model requested by the guest virtual machine.
156
+ default is : **qemu64**.
157
+
158
+ ``arch``: specifying the CPU architecture to virtualization. default is
159
+ **x86_64**.
160
+
161
+ ``timezone``: vm's timezone. default is **America/Toronto**.
162
+
163
+ ``bridge_name``: existing bridge on remote host. This bridge should allow VM
164
+ being reachable with an ip address.
165
+
166
+ ``libvirt_host`` and ``libvirt_user``: remote host parameters. **libvirt_user**
167
+ should belongs to *libvirt* group.
168
+
169
+ Once set, you will have to run:
170
+
171
+ .. code-block:: bash
172
+
173
+ molecule test
174
+
175
+
176
+ Documentation
177
+ =============
178
+
179
+ Read the documentation and more at https://molecule.readthedocs.io/.
180
+
181
+ .. _get-involved:
182
+
183
+ Get Involved
184
+ ============
185
+
186
+ * Join us in the ``#ansible-molecule`` channel on `Freenode`_.
187
+ * Join the discussion in `molecule-users Forum`_.
188
+ * Join the community working group by checking the `wiki`_.
189
+ * Want to know about releases, subscribe to `ansible-announce list`_.
190
+ * For the full list of Ansible email Lists, IRC channels see the
191
+ `communication page`_.
192
+
193
+ .. _`Freenode`: https://freenode.net
194
+ .. _`molecule-users Forum`: https://groups.google.com/forum/#!forum/molecule-users
195
+ .. _`wiki`: https://github.com/ansible/community/wiki/Molecule
196
+ .. _`ansible-announce list`: https://groups.google.com/group/ansible-announce
197
+ .. _`communication page`: https://docs.ansible.com/ansible/latest/community/communication.html
198
+
199
+ .. _authors:
200
+
201
+ Authors
202
+ =======
203
+
204
+ * James Regis
205
+ * Gaëtan Trellu
206
+ * Gariele Cerami
207
+ * Sorin Sbarnea
208
+
209
+ .. _license:
210
+
211
+ License
212
+ =======
213
+
214
+ The `MIT`_ License.
215
+
216
+ .. _`MIT`: https://github.com/ansible/molecule/blob/master/LICENSE
217
+
218
+ The logo is licensed under the `Creative Commons NoDerivatives 4.0 License`_.
219
+
220
+ If you have some other use in mind, contact us.
221
+
222
+ .. _`Creative Commons NoDerivatives 4.0 License`: https://creativecommons.org/licenses/by-nd/4.0/
@@ -0,0 +1,184 @@
1
+ ***********************
2
+ Molecule libvirt Plugin
3
+ ***********************
4
+
5
+ .. image:: https://badge.fury.io/py/molecule-libvirt.svg
6
+ :target: https://badge.fury.io/py/molecule-libvirt
7
+ :alt: PyPI Package
8
+
9
+ .. image:: https://zuul-ci.org/gated.svg
10
+ :target: https://dashboard.zuul.ansible.com/t/ansible/builds?project=ansible-community/molecule
11
+
12
+ .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
13
+ :target: https://github.com/python/black
14
+ :alt: Python Black Code Style
15
+
16
+ .. image:: https://img.shields.io/badge/Code%20of%20Conduct-Ansible-silver.svg
17
+ :target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
18
+ :alt: Ansible Code of Conduct
19
+
20
+ .. image:: https://img.shields.io/badge/Mailing%20lists-Ansible-orange.svg
21
+ :target: https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
22
+ :alt: Ansible mailing lists
23
+
24
+ .. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
25
+ :target: LICENSE
26
+ :alt: Repository License
27
+
28
+ Molecule libvirt is designed to allow use of libvirt for provisioning test
29
+ resources.
30
+
31
+ Please note that this driver is currently in its early stage of development,
32
+ do not even try to install or use it until this message is removed.
33
+
34
+ .. _quickstart:
35
+
36
+ Quickstart
37
+ ==========
38
+
39
+ Installation
40
+ ------------
41
+ .. code-block:: bash
42
+
43
+ pip install molecule-libvirt
44
+
45
+ Create a scenario
46
+ -----------------
47
+
48
+ With a new role
49
+ ^^^^^^^^^^^^^^^
50
+
51
+ .. code-block:: bash
52
+
53
+   molecule init role -d libvirt my-role
54
+
55
+ This will create a new folder *my-role* containing a bare-bone generated
56
+ role like you would do with ``ansible-galaxy init`` command.
57
+
58
+ It will also contain a molecule folder with a default scenario
59
+ using the libvirt driver (using ansible community.libvirt collection).
60
+
61
+ Install the collection using:
62
+
63
+ ``ansible-galaxy install -r test_requirements.yml``.
64
+
65
+ Example
66
+ -------
67
+ This is a `molecule.yml` example file
68
+
69
+ .. code-block:: yaml
70
+
71
+ dependency:
72
+ name: galaxy
73
+ driver:
74
+ name: libvirt
75
+ platforms:
76
+ - name: instance-1
77
+ cpu: 1
78
+ cpu_model: "qemu64"
79
+ image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
80
+ disk_size: "10G"
81
+ ssh_port: 22
82
+ memory_size: "1" # in GB
83
+ - name: instance-2
84
+ memory: "1"
85
+ cpus: 1
86
+ image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
87
+ libvirt_host: "server.home.lan"
88
+ libvirt_user: "james"
89
+ bridge_name: "bridge0"
90
+ - name: instance-3
91
+ memory: "1"
92
+ cpus: 1
93
+ image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
94
+ libvirt_host: "server.home.lan"
95
+ libvirt_user: "james"
96
+ bridge_name: "bridge0"
97
+ provisioner:
98
+ name: ansible
99
+ verifier:
100
+ name: ansible
101
+
102
+ Optional parameters
103
+ -------------------
104
+
105
+ ``molecule_bridge``: existing bridge on local host. Can be useful if you
106
+ want to set network interface name created for molecule.
107
+ default value is: **molecule-br0**.
108
+
109
+ ``molecule_network_cidr``: ip address range that should be bind to molecule
110
+ virtual network.
111
+ default value is: **10.10.10.0/24**.
112
+
113
+ ``qemu_user``: qemu process user. On RHEL like system qemu user is **qemu**.
114
+ On Debian like, qemu user is **libvirt-qemu**.
115
+ default value is: **qemu**.
116
+
117
+ ``cpu_model``: specifies CPU model requested by the guest virtual machine.
118
+ default is : **qemu64**.
119
+
120
+ ``arch``: specifying the CPU architecture to virtualization. default is
121
+ **x86_64**.
122
+
123
+ ``timezone``: vm's timezone. default is **America/Toronto**.
124
+
125
+ ``bridge_name``: existing bridge on remote host. This bridge should allow VM
126
+ being reachable with an ip address.
127
+
128
+ ``libvirt_host`` and ``libvirt_user``: remote host parameters. **libvirt_user**
129
+ should belongs to *libvirt* group.
130
+
131
+ Once set, you will have to run:
132
+
133
+ .. code-block:: bash
134
+
135
+ molecule test
136
+
137
+
138
+ Documentation
139
+ =============
140
+
141
+ Read the documentation and more at https://molecule.readthedocs.io/.
142
+
143
+ .. _get-involved:
144
+
145
+ Get Involved
146
+ ============
147
+
148
+ * Join us in the ``#ansible-molecule`` channel on `Freenode`_.
149
+ * Join the discussion in `molecule-users Forum`_.
150
+ * Join the community working group by checking the `wiki`_.
151
+ * Want to know about releases, subscribe to `ansible-announce list`_.
152
+ * For the full list of Ansible email Lists, IRC channels see the
153
+ `communication page`_.
154
+
155
+ .. _`Freenode`: https://freenode.net
156
+ .. _`molecule-users Forum`: https://groups.google.com/forum/#!forum/molecule-users
157
+ .. _`wiki`: https://github.com/ansible/community/wiki/Molecule
158
+ .. _`ansible-announce list`: https://groups.google.com/group/ansible-announce
159
+ .. _`communication page`: https://docs.ansible.com/ansible/latest/community/communication.html
160
+
161
+ .. _authors:
162
+
163
+ Authors
164
+ =======
165
+
166
+ * James Regis
167
+ * Gaëtan Trellu
168
+ * Gariele Cerami
169
+ * Sorin Sbarnea
170
+
171
+ .. _license:
172
+
173
+ License
174
+ =======
175
+
176
+ The `MIT`_ License.
177
+
178
+ .. _`MIT`: https://github.com/ansible/molecule/blob/master/LICENSE
179
+
180
+ The logo is licensed under the `Creative Commons NoDerivatives 4.0 License`_.
181
+
182
+ If you have some other use in mind, contact us.
183
+
184
+ .. _`Creative Commons NoDerivatives 4.0 License`: https://creativecommons.org/licenses/by-nd/4.0/