You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/latest/_sources/inventory-data.rst.txt
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ By default, pyinfra assumes hosts are SSH servers and the name of the host is us
8
8
Inventory Files
9
9
---------------
10
10
11
-
Inventory files contain groups of hosts. Groups are defined as a ``list``. For example, this inventory creates two groups, ``app_servers`` and ``db_servers``:
11
+
Inventory files contain groups of hosts. Groups are defined as a ``list`` or ``tuple``. For example, this inventory creates two groups, ``app_servers`` and ``db_servers``:
12
12
13
13
.. code:: python
14
14
@@ -17,19 +17,17 @@ Inventory files contain groups of hosts. Groups are defined as a ``list``. For e
If you save this file as ``inventory.py``, you can then use it in when executing pyinfra:
22
+
If you save this file as ``inventory.py``, you can then use it when executing pyinfra:
27
23
28
24
.. code:: shell
29
25
30
26
pyinfra inventory.py OPERATIONS...
31
27
32
28
.. Note::
29
+
Group names starting with a leading ``_`` are intentionally ignored.
30
+
33
31
In addition to the groups defined in the inventory, all the hosts are added to a group with the name of the inventory file (eg ``production.py`` becomes ``production``).
Copy file name to clipboardExpand all lines: en/latest/inventory-data.html
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -151,25 +151,22 @@ <h1>Inventory & Data<a class="headerlink" href="#inventory-data" title="Perm
151
151
<p>By default, pyinfra assumes hosts are SSH servers and the name of the host is used as the SSH hostname. Prefixing the name of the host with <codeclass="docutils literal notranslate"><spanclass="pre">@<connector-name>/</span></code> is used to activate alternative connectors. See: <aclass="reference internal" href="connectors.html"><spanclass="doc">Connectors Index</span></a>.</p>
152
152
<divclass="section" id="inventory-files">
153
153
<h2>Inventory Files<aclass="headerlink" href="#inventory-files" title="Permalink to this heading">¶</a></h2>
154
-
<p>Inventory files contain groups of hosts. Groups are defined as a <codeclass="docutils literal notranslate"><spanclass="pre">list</span></code>. For example, this inventory creates two groups, <codeclass="docutils literal notranslate"><spanclass="pre">app_servers</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">db_servers</span></code>:</p>
154
+
<p>Inventory files contain groups of hosts. Groups are defined as a <codeclass="docutils literal notranslate"><spanclass="pre">list</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">tuple</span></code>. For example, this inventory creates two groups, <codeclass="docutils literal notranslate"><spanclass="pre">app_servers</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">db_servers</span></code>:</p>
<p>If you save this file as <codeclass="docutils literal notranslate"><spanclass="pre">inventory.py</span></code>, you can then use it in when executing pyinfra:</p>
163
+
<p>If you save this file as <codeclass="docutils literal notranslate"><spanclass="pre">inventory.py</span></code>, you can then use it when executing pyinfra:</p>
<p>Group names starting with a leading <codeclass="docutils literal notranslate"><spanclass="pre">_</span></code> are intentionally ignored.</p>
173
170
<pclass="last">In addition to the groups defined in the inventory, all the hosts are added to a group with the name of the inventory file (eg <codeclass="docutils literal notranslate"><spanclass="pre">production.py</span></code> becomes <codeclass="docutils literal notranslate"><spanclass="pre">production</span></code>).</p>
Copy file name to clipboardExpand all lines: en/next/_sources/inventory-data.rst.txt
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ By default, pyinfra assumes hosts are SSH servers and the name of the host is us
8
8
Inventory Files
9
9
---------------
10
10
11
-
Inventory files contain groups of hosts. Groups are defined as a ``list``. For example, this inventory creates two groups, ``app_servers`` and ``db_servers``:
11
+
Inventory files contain groups of hosts. Groups are defined as a ``list`` or ``tuple``. For example, this inventory creates two groups, ``app_servers`` and ``db_servers``:
12
12
13
13
.. code:: python
14
14
@@ -17,19 +17,17 @@ Inventory files contain groups of hosts. Groups are defined as a ``list``. For e
If you save this file as ``inventory.py``, you can then use it in when executing pyinfra:
22
+
If you save this file as ``inventory.py``, you can then use it when executing pyinfra:
27
23
28
24
.. code:: shell
29
25
30
26
pyinfra inventory.py OPERATIONS...
31
27
32
28
.. Note::
29
+
Group names starting with a leading ``_`` are intentionally ignored.
30
+
33
31
In addition to the groups defined in the inventory, all the hosts are added to a group with the name of the inventory file (eg ``production.py`` becomes ``production``).
Copy file name to clipboardExpand all lines: en/next/inventory-data.html
+4-7Lines changed: 4 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -151,25 +151,22 @@ <h1>Inventory & Data<a class="headerlink" href="#inventory-data" title="Perm
151
151
<p>By default, pyinfra assumes hosts are SSH servers and the name of the host is used as the SSH hostname. Prefixing the name of the host with <codeclass="docutils literal notranslate"><spanclass="pre">@<connector-name>/</span></code> is used to activate alternative connectors. See: <aclass="reference internal" href="connectors.html"><spanclass="doc">Connectors Index</span></a>.</p>
152
152
<divclass="section" id="inventory-files">
153
153
<h2>Inventory Files<aclass="headerlink" href="#inventory-files" title="Permalink to this heading">¶</a></h2>
154
-
<p>Inventory files contain groups of hosts. Groups are defined as a <codeclass="docutils literal notranslate"><spanclass="pre">list</span></code>. For example, this inventory creates two groups, <codeclass="docutils literal notranslate"><spanclass="pre">app_servers</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">db_servers</span></code>:</p>
154
+
<p>Inventory files contain groups of hosts. Groups are defined as a <codeclass="docutils literal notranslate"><spanclass="pre">list</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">tuple</span></code>. For example, this inventory creates two groups, <codeclass="docutils literal notranslate"><spanclass="pre">app_servers</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">db_servers</span></code>:</p>
<p>If you save this file as <codeclass="docutils literal notranslate"><spanclass="pre">inventory.py</span></code>, you can then use it in when executing pyinfra:</p>
163
+
<p>If you save this file as <codeclass="docutils literal notranslate"><spanclass="pre">inventory.py</span></code>, you can then use it when executing pyinfra:</p>
<p>Group names starting with a leading <codeclass="docutils literal notranslate"><spanclass="pre">_</span></code> are intentionally ignored.</p>
173
170
<pclass="last">In addition to the groups defined in the inventory, all the hosts are added to a group with the name of the inventory file (eg <codeclass="docutils literal notranslate"><spanclass="pre">production.py</span></code> becomes <codeclass="docutils literal notranslate"><spanclass="pre">production</span></code>).</p>
0 commit comments