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: docs/compatibility.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@ Compatibility
3
3
4
4
pyinfra aims to be compatible with all Unix-like operating systems and is currently tested against:
5
5
6
-
+ Ubuntu 14/16
7
-
+ Debian 7/8
6
+
+ Ubuntu 14/15/16
7
+
+ Debian 7/8/9
8
8
+ CentOS 6/7
9
-
+ Fedora 23
10
-
+ OpenBSD 5.8
11
-
+ macOS 10.12
9
+
+ Fedora 24
10
+
+ OpenBSD 6
11
+
+ macOS 10.13
12
12
13
13
In general, the only requirement (beyond a SSH server) on the remote side is shell access. POSIX commands are used where possible for facts and operations, so most of the ``server`` and ``files`` operations should work anywhere POSIX.
Copy file name to clipboardExpand all lines: docs/deploys.rst
+7-15Lines changed: 7 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ The same keys can be defined for host and group data - this means we can set a d
103
103
+ Normal group data
104
104
+ "all" group data
105
105
106
-
Debugging data issues:
106
+
.. note::
107
107
pyinfra contains a ``--debug-data`` option which can be used to explore the data output per-host for a given inventory/deploy.
108
108
109
109
Data Example
@@ -180,16 +180,8 @@ For example, this deploy will ensure that user "pyinfra" exists with home direct
180
180
181
181
Uses the :doc:`server module <./modules/server>` and :doc:`files module <./modules/files>`. You can see all the modules in :doc:`the modules index <./operations>`.
182
182
183
-
Naming operations:
184
-
Pass a ``set`` object as the first argument to name the operation, which will appear during a deploy. By default the operation module, name and arguments are shown:
185
-
186
-
.. code:: python
187
-
188
-
server.user(
189
-
{'Ensure user pyinfra'}, # the contents of the set will become the op name
190
-
'pyinfra',
191
-
home='/home/pyinfra'
192
-
)
183
+
.. note::
184
+
Pass a ``set`` object as the first argument to name the operation (as above), which will appear during a deploy. By default the operation module, name and arguments are shown.
193
185
194
186
Using Data
195
187
~~~~~~~~~~
@@ -208,7 +200,7 @@ Adding data to inventories was :ref:`described above <data-ref-label>` - you can
208
200
home=host.data.app_dir,
209
201
)
210
202
211
-
String formatting:
203
+
.. warning::
212
204
pyinfra supports jinja2 style string arguments, which should be used over Python's builtin string formatting where you expect the final string to change per host. This is because pyinfra groups operations by their arguments. See: :doc:`using Python <./using_python>` for more information; an example of this is:
213
205
214
206
.. code:: python
@@ -243,7 +235,7 @@ Operation meta can be used during a deploy to change the desired operations:
243
235
with state.when(create_user.changed):
244
236
server.shell('# add user to sudo, etc...')
245
237
246
-
Conditionals:
238
+
.. warning::
247
239
pyinfra supports conditional branches with the ``state.limit``and``state.when`` control structures (as shown above). These should be used in place of normal Python ``if`` statements. This prevents operations being executed in unexpected orders. For more information, see: :doc:`using Python <./using_python>`.
248
240
249
241
Facts
@@ -323,8 +315,8 @@ There are a number of configuration options for how deploys are managed. These c
323
315
# Fail the entire deploy after 10% of hosts fail
324
316
FAIL_PERCENT=10
325
317
326
-
config.py advantage:
327
-
When added to ``config.py``, these options will take affect when using pyinfra ``--fact``or``--run``.
318
+
.. note::
319
+
When added to ``config.py`` (vs the deploy file), these options will take affect when using pyinfra ``--fact``or``--run``.
Copy file name to clipboardExpand all lines: docs/using_python.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,5 +60,5 @@ pyinfra also has a global ``limit`` keyword argument and a matching ``state.limi
60
60
limit=inventory.get_host('my-host.net'),
61
61
)
62
62
63
-
Note:
64
-
pyinfra ensures that operations are always executed in order **per host**, so there's no risk of, say, trying to use ``docker`` before installing it.
63
+
.. note::
64
+
Despite the above, pyinfra always ensures that operations are always executed in order **per host** so there's no risk of, say, trying to use ``docker`` before installing it.
0 commit comments