mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 23:14:02 -07:00
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
Added docs Inventory Guide. (#10239)
* Added docs Inventory Guide.
* Errata docs Inventory Guide.
* Fix docs Inventory Guide error: use ASCII quotes.
* Fix docs Inventory Guide various lint errors.
* Added docs Inventory Guide BOTMETA entries.
* Fix docs Inventory Guide lint errors: trailing whitespace
* Fix docs Inventory Guide lint errors: force yaml pygment
* Fix docs Inventory Guide lint errors: No way to force yaml pygment in code-block
* Update docs/docsite/rst/inventory_guide_iocage.rst
* Update docs/docsite/rst/inventory_guide_iocage_aliases.rst
Thank you for the explanation!
* Update docs/docsite/rst/inventory_guide_iocage_aliases.rst
* Updated docs Inventory Guide.
* Problematic pygments changed to 'console'.
* Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
Update docs/docsite/rst/inventory_guide_iocage_properties.rst
Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
* Put dhclient-exit-hooks into the sh code-block.
* Fix the code-block.
* Update docs/docsite/rst/inventory_guide_iocage.rst
Update docs/docsite/rst/inventory_guide_iocage_aliases.rst
Update docs/docsite/rst/inventory_guide_iocage_basics.rst
* Remove tabs.
* Update docs/docsite/rst/inventory_guide_iocage_basics.rst
* Indent the note block.
* Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
Update docs/docsite/rst/inventory_guide_iocage_dhcp.rst
Update docs/docsite/rst/inventory_guide_iocage_hooks.rst
* Fix ansval.
* Add guide_iocage.rst and inventory_guide_iocage*.rst
* Fix 'disallowed language sh found'.
* Remove note block.
* Remove include which triggers a bug in rstcheck.
* Update docs/docsite/extra-docs.yml
Update docs/docsite/rst/iocage_inventory_guide_basics.rst
Update docs/docsite/rst/iocage_inventory_guide_dhcp.rst
Update docs/docsite/rst/iocage_inventory_guide_hooks.rst
Update docs/docsite/rst/iocage_inventory_guide_properties.rst
Update docs/docsite/rst/iocage_inventory_guide_tags.rst
Update docs/docsite/rst/iocage_inventory_guide_hooks.rst
Update docs/docsite/rst/iocage_inventory_guide_properties.rst
* Put man iocage quotation into the text code block.
---------
(cherry picked from commit 563b29e12a
)
Co-authored-by: Vladimir Botka <vbotka@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
128 lines
5.4 KiB
ReStructuredText
128 lines
5.4 KiB
ReStructuredText
..
|
|
Copyright (c) Ansible Project
|
|
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
.. _ansible_collections.community.general.docsite.guide_iocage.iocage_inventory_guide.iocage_inventory_guide_basics:
|
|
|
|
Basics
|
|
------
|
|
|
|
As root at the iocage host, create three VNET jails with a DHCP interface from the template
|
|
*ansible_client*:
|
|
|
|
.. code-block:: console
|
|
|
|
shell> iocage create --template ansible_client --name srv_1 bpf=1 dhcp=1 vnet=1
|
|
srv_1 successfully created!
|
|
shell> iocage create --template ansible_client --name srv_2 bpf=1 dhcp=1 vnet=1
|
|
srv_2 successfully created!
|
|
shell> iocage create --template ansible_client --name srv_3 bpf=1 dhcp=1 vnet=1
|
|
srv_3 successfully created!
|
|
|
|
See: `Configuring a VNET Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-vnet-jail>`_.
|
|
|
|
As admin at the controller, list the jails:
|
|
|
|
.. code-block:: console
|
|
|
|
shell> ssh admin@10.1.0.73 iocage list -l
|
|
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
|
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
|
+======+=======+======+=======+======+=================+====================+=====+================+==========+
|
|
| None | srv_1 | off | down | jail | 14.2-RELEASE-p3 | DHCP (not running) | - | ansible_client | no |
|
|
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
|
| None | srv_2 | off | down | jail | 14.2-RELEASE-p3 | DHCP (not running) | - | ansible_client | no |
|
|
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
|
| None | srv_3 | off | down | jail | 14.2-RELEASE-p3 | DHCP (not running) | - | ansible_client | no |
|
|
+------+-------+------+-------+------+-----------------+--------------------+-----+----------------+----------+
|
|
|
|
Create the inventory file ``hosts/02_iocage.yml``
|
|
|
|
.. code-block:: yaml
|
|
|
|
plugin: community.general.iocage
|
|
host: 10.1.0.73
|
|
user: admin
|
|
|
|
Display the inventory:
|
|
|
|
.. code-block:: console
|
|
|
|
shell> ansible-inventory -i hosts/02_iocage.yml --list --yaml
|
|
all:
|
|
children:
|
|
ungrouped:
|
|
hosts:
|
|
srv_1:
|
|
iocage_basejail: 'no'
|
|
iocage_boot: 'off'
|
|
iocage_ip4: '-'
|
|
iocage_ip4_dict:
|
|
ip4: []
|
|
msg: DHCP (not running)
|
|
iocage_ip6: '-'
|
|
iocage_jid: None
|
|
iocage_release: 14.2-RELEASE-p3
|
|
iocage_state: down
|
|
iocage_template: ansible_client
|
|
iocage_type: jail
|
|
srv_2:
|
|
iocage_basejail: 'no'
|
|
iocage_boot: 'off'
|
|
iocage_ip4: '-'
|
|
iocage_ip4_dict:
|
|
ip4: []
|
|
msg: DHCP (not running)
|
|
iocage_ip6: '-'
|
|
iocage_jid: None
|
|
iocage_release: 14.2-RELEASE-p3
|
|
iocage_state: down
|
|
iocage_template: ansible_client
|
|
iocage_type: jail
|
|
srv_3:
|
|
iocage_basejail: 'no'
|
|
iocage_boot: 'off'
|
|
iocage_ip4: '-'
|
|
iocage_ip4_dict:
|
|
ip4: []
|
|
msg: DHCP (not running)
|
|
iocage_ip6: '-'
|
|
iocage_jid: None
|
|
iocage_release: 14.2-RELEASE-p3
|
|
iocage_state: down
|
|
iocage_template: ansible_client
|
|
iocage_type: jail
|
|
|
|
Optionally, create shared IP jails:
|
|
|
|
.. code-block:: console
|
|
|
|
shell> iocage create --template ansible_client --name srv_1 ip4_addr="em0|10.1.0.101/24"
|
|
srv_1 successfully created!
|
|
shell> iocage create --template ansible_client --name srv_2 ip4_addr="em0|10.1.0.102/24"
|
|
srv_2 successfully created!
|
|
shell> iocage create --template ansible_client --name srv_3 ip4_addr="em0|10.1.0.103/24"
|
|
srv_3 successfully created!
|
|
shell> iocage list -l
|
|
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
|
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL |
|
|
+======+=======+======+=======+======+=================+===================+=====+================+==========+
|
|
| None | srv_1 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.101/24 | - | ansible_client | no |
|
|
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
|
| None | srv_2 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.102/24 | - | ansible_client | no |
|
|
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
|
| None | srv_3 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.103/24 | - | ansible_client | no |
|
|
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
|
|
|
|
See: `Configuring a Shared IP Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-shared-ip-jail>`_
|
|
|
|
If iocage needs environment variable(s), use the option :ansopt:`community.general.iocage#inventory:env`. For example,
|
|
|
|
.. code-block:: yaml
|
|
|
|
plugin: community.general.iocage
|
|
host: 10.1.0.73
|
|
user: admin
|
|
env:
|
|
CRYPTOGRAPHY_OPENSSL_NO_LEGACY: 1
|