faq.rst (ansible-2.14.0) | : | faq.rst (ansible-2.14.1rc1) | ||
---|---|---|---|---|
skipping to change at line 139 | skipping to change at line 139 | |||
With earlier versions of Ansible, it was necessary to configure a | With earlier versions of Ansible, it was necessary to configure a | |||
suitable ``ProxyCommand`` for one or more hosts in ``~/.ssh/config``, | suitable ``ProxyCommand`` for one or more hosts in ``~/.ssh/config``, | |||
or globally by setting ``ssh_args`` in ``ansible.cfg``. | or globally by setting ``ssh_args`` in ``ansible.cfg``. | |||
.. _ssh_serveraliveinterval: | .. _ssh_serveraliveinterval: | |||
How do I get Ansible to notice a dead target in a timely manner? | How do I get Ansible to notice a dead target in a timely manner? | |||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |||
You can add ``-o ServerAliveInterval=NumberOfSeconds`` in ``ssh_args`` from ``an sible.cfg``. Without this option, | You can add ``-o ServerAliveInterval=NumberOfSeconds`` with the ``ssh_args`` par ameter in `SSH connection plugin <https://docs.ansible.com/ansible-core/devel/co llections/ansible/builtin/ssh_connection.html#parameter-ssh_args>`_. Without thi s option, | |||
SSH and therefore Ansible will wait until the TCP connection times out. Another solution is to add ``ServerAliveInterval`` | SSH and therefore Ansible will wait until the TCP connection times out. Another solution is to add ``ServerAliveInterval`` | |||
into your global SSH configuration. A good value for ``ServerAliveInterval`` is up to you to decide; keep in mind that | into your global SSH configuration. A good value for ``ServerAliveInterval`` is up to you to decide; keep in mind that | |||
``ServerAliveCountMax=3`` is the SSH default so any value you set will be triple d before terminating the SSH session. | ``ServerAliveCountMax=3`` is the SSH default so any value you set will be triple d before terminating the SSH session. | |||
.. _cloud_provider_performance: | .. _cloud_provider_performance: | |||
How do I speed up run of ansible for servers from cloud providers (EC2, openstac k,.. )? | How do I speed up run of ansible for servers from cloud providers (EC2, openstac k,.. )? | |||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++ | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++ | |||
Don't try to manage a fleet of machines of a cloud provider from your laptop. | Don't try to manage a fleet of machines of a cloud provider from your laptop. | |||
skipping to change at line 604 | skipping to change at line 604 | |||
item[0]['checksum:md5'] | item[0]['checksum:md5'] | |||
item['section']['2.1'] | item['section']['2.1'] | |||
item['region']['Mid-Atlantic'] | item['region']['Mid-Atlantic'] | |||
It is {{ temperature['Celsius']['-3'] }} outside. | It is {{ temperature['Celsius']['-3'] }} outside. | |||
Also array notation allows for dynamic variable composition, see dynamic_variabl es_. | Also array notation allows for dynamic variable composition, see dynamic_variabl es_. | |||
Another problem with 'dot notation' is that some keys can cause problems because they collide with attributes and methods of python dictionaries. | Another problem with 'dot notation' is that some keys can cause problems because they collide with attributes and methods of python dictionaries. | |||
* Example of incorrect syntax when ``item`` is a dictionary: | ||||
.. code-block:: jinja | ||||
item.update | ||||
This variant causes a syntax error because ``update()`` is a Python method for d | ||||
ictionaries. | ||||
* Example of correct syntax: | ||||
.. code-block:: jinja | .. code-block:: jinja | |||
item.update # this breaks if item is a dictionary, as 'update()' is a python | item['update'] | |||
method for dictionaries | ||||
item['update'] # this works | ||||
.. _argsplat_unsafe: | .. _argsplat_unsafe: | |||
When is it unsafe to bulk-set task arguments from a variable? | When is it unsafe to bulk-set task arguments from a variable? | |||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |||
You can set all of a task's arguments from a dictionary-typed variable. This | You can set all of a task's arguments from a dictionary-typed variable. This | |||
technique can be useful in some dynamic execution scenarios. However, it | technique can be useful in some dynamic execution scenarios. However, it | |||
introduces a security risk. We do not recommend it, so Ansible issues a | introduces a security risk. We do not recommend it, so Ansible issues a | |||
warning when you do something like this: | warning when you do something like this: | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 13 lines changed or added |