1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Remove Deprecated configs 2.8 (#46825)

* Removed deprecated ANSIBLE_HOSTS

* Bump sudo/su configs to match deprecation version for cli and playbook args

* Bump include configs to match deprecation version for 'include'
This commit is contained in:
Matt Martz 2018-11-05 11:08:13 -06:00 committed by Brian Coca
parent 2728a22f73
commit 45ff6df1af
6 changed files with 13 additions and 122 deletions

View file

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id474207"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook &lt;filename.yml&gt; … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment
system. Ansible-playbook is the tool used to run them. See the
project home page (link below) for more information.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>filename.yml</strong></span>
</span></dt><dd>
The names of one or more YAML format files to run as ansible playbooks.
</dd></dl></div></div><div class="refsect1" title="OPTIONS"><a id="_options"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>-i</strong></span> <span class="emphasis"><em>PATH</em></span>, <span class="strong"><strong>--inventory=</strong></span><span class="emphasis"><em>PATH</em></span>
</span></dt><dd>
The <span class="emphasis"><em>PATH</em></span> to the inventory hosts file, which defaults to <span class="emphasis"><em>/etc/ansible/hosts</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-M</strong></span> <span class="emphasis"><em>DIRECTORY</em></span>, <span class="strong"><strong>--module-path=</strong></span><span class="emphasis"><em>DIRECTORY</em></span>
</span></dt><dd>
The <span class="emphasis"><em>DIRECTORY</em></span> to load modules from. The default is <span class="emphasis"><em>/usr/share/ansible</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-f</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--forks=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Level of parallelism. <span class="emphasis"><em>NUM</em></span> is specified as an integer, the default is 5.
</dd><dt><span class="term">
<span class="strong"><strong>-k</strong></span>, <span class="strong"><strong>--ask-pass</strong></span>
</span></dt><dd>
Prompt for the SSH password instead of assuming key-based authentication with ssh-agent.
</dd><dt><span class="term">
<span class="strong"><strong>-T</strong></span> <span class="emphasis"><em>SECONDS</em></span>, <span class="strong"><strong>--timeout=</strong></span><span class="emphasis"><em>SECONDS</em></span>
</span></dt><dd>
Connection timeout to use when trying to talk to hosts, in <span class="emphasis"><em>SECONDS</em></span>.
</dd></dl></div></div><div class="refsect1" title="ENVIRONMENT"><a id="_environment"></a><h2>ENVIRONMENT</h2><p>The following environment variables may specified.</p><p>ANSIBLE_HOSTS Override the default ansible hosts file</p><p>ANSIBLE_LIBRARYOverride the default ansible module library path</p></div><div class="refsect1" title="AUTHOR"><a id="_author"></a><h2>AUTHOR</h2><p>Ansible was originally written by Michael DeHaan. See the AUTHORS file
for a complete list of contributors.</p></div><div class="refsect1" title="COPYRIGHT"><a id="_copyright"></a><h2>COPYRIGHT</h2><p>Copyright © 2012, Michael DeHaan</p><p>Ansible is released under the terms of the GPLv3 License.</p></div><div class="refsect1" title="SEE ALSO"><a id="_see_also"></a><h2>SEE ALSO</h2><p><span class="strong"><strong>ansible</strong></span>(1)</p><p>Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <a class="ulink" href="https://ansible.github.com/" target="_top">https://ansible.github.com/</a></p></div></div></body></html>

View file

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id392901"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible &lt;host-pattern&gt; [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
SSH.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>host-pattern</strong></span>
</span></dt><dd>
A name of a group in the inventory file, a shell-like glob selecting
hosts in inventory file, or any combination of the two separated by
semicolons.
</dd></dl></div></div><div class="refsect1" title="OPTIONS"><a id="_options"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>-i</strong></span> <span class="emphasis"><em>PATH</em></span>, <span class="strong"><strong>--inventory=</strong></span><span class="emphasis"><em>PATH</em></span>
</span></dt><dd>
The <span class="emphasis"><em>PATH</em></span> to the inventory hosts file, which defaults to <span class="emphasis"><em>/etc/ansible/hosts</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-f</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--forks=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Level of parallelism. <span class="emphasis"><em>NUM</em></span> is specified as an integer, the default is 5.
</dd><dt><span class="term">
<span class="strong"><strong>-m</strong></span> <span class="emphasis"><em>NAME</em></span>, <span class="strong"><strong>--module-name=</strong></span><span class="emphasis"><em>NAME</em></span>
</span></dt><dd>
Execute the module called <span class="emphasis"><em>NAME</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-M</strong></span> <span class="emphasis"><em>DIRECTORY</em></span>, <span class="strong"><strong>--module-path=</strong></span><span class="emphasis"><em>DIRECTORY</em></span>
</span></dt><dd>
The <span class="emphasis"><em>DIRECTORY</em></span> to load modules from. The default is <span class="emphasis"><em>/usr/share/ansible</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-a</strong></span> '<span class="emphasis"><em>ARGUMENTS</em></span>', <span class="strong"><strong>--args=</strong></span>'<span class="emphasis"><em>ARGUMENTS</em></span>'
</span></dt><dd>
The <span class="emphasis"><em>ARGUMENTS</em></span> to pass to the module.
</dd><dt><span class="term">
<span class="strong"><strong>-k</strong></span>, <span class="strong"><strong>--ask-pass</strong></span>
</span></dt><dd>
Prompt for the SSH password instead of assuming key-based authentication with ssh-agent.
</dd><dt><span class="term">
<span class="strong"><strong>-o</strong></span>, <span class="strong"><strong>--one-line</strong></span>
</span></dt><dd>
Try to output everything on one line.
</dd><dt><span class="term">
<span class="strong"><strong>-t</strong></span> <span class="emphasis"><em>DIRECTORY</em></span>, <span class="strong"><strong>--tree=</strong></span><span class="emphasis"><em>DIRECTORY</em></span>
</span></dt><dd>
Save contents in this output <span class="emphasis"><em>DIRECTORY</em></span>, with the results saved in a
file named after each host.
</dd><dt><span class="term">
<span class="strong"><strong>-T</strong></span> <span class="emphasis"><em>SECONDS</em></span>, <span class="strong"><strong>--timeout=</strong></span><span class="emphasis"><em>SECONDS</em></span>
</span></dt><dd>
Connection timeout to use when trying to talk to hosts, in <span class="emphasis"><em>SECONDS</em></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-B</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--background=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Run commands in the background, killing the task after <span class="emphasis"><em>NUM</em></span> seconds.
</dd><dt><span class="term">
<span class="strong"><strong>-P</strong></span> <span class="emphasis"><em>NUM</em></span>, <span class="strong"><strong>--poll=</strong></span><span class="emphasis"><em>NUM</em></span>
</span></dt><dd>
Poll a background job every <span class="emphasis"><em>NUM</em></span> seconds. Requires <span class="strong"><strong>-B</strong></span>.
</dd><dt><span class="term">
<span class="strong"><strong>-u</strong></span> <span class="emphasis"><em>USERNAME</em></span>, <span class="strong"><strong>--remote-user=</strong></span><span class="emphasis"><em>USERNAME</em></span>
</span></dt><dd>
Use this remote <span class="emphasis"><em>USERNAME</em></span> instead of root.
</dd></dl></div></div><div class="refsect1" title="INVENTORY"><a id="_inventory"></a><h2>INVENTORY</h2><p>Ansible stores the hosts it can potentially operate on in an inventory
file. The syntax is one host per line. Groups headers are allowed and
are included on their own line, enclosed in square brackets.</p></div><div class="refsect1" title="FILES"><a id="_files"></a><h2>FILES</h2><p>/etc/ansible/hostsDefault inventory file</p><p>/usr/share/ansible/Default module library</p></div><div class="refsect1" title="ENVIRONMENT"><a id="_environment"></a><h2>ENVIRONMENT</h2><p>The following environment variables may specified.</p><p>ANSIBLE_HOSTS Override the default ansible hosts file</p><p>ANSIBLE_LIBRARYOverride the default ansible module library path</p></div><div class="refsect1" title="AUTHOR"><a id="_author"></a><h2>AUTHOR</h2><p>Ansible was originally written by Michael DeHaan. See the AUTHORS file
for a complete list of contributors.</p></div><div class="refsect1" title="COPYRIGHT"><a id="_copyright"></a><h2>COPYRIGHT</h2><p>Copyright © 2012, Michael DeHaan</p><p>Ansible is released under the terms of the GPLv3 License.</p></div><div class="refsect1" title="SEE ALSO"><a id="_see_also"></a><h2>SEE ALSO</h2><p><span class="strong"><strong>ansible-playbook</strong></span>(1)</p><p>Extensive documentation as well as IRC and mailing list info
is available on the ansible home page: <a class="ulink" href="https://ansible.github.com/" target="_top">https://ansible.github.com/</a></p></div></div></body></html>

View file

@ -376,10 +376,6 @@ other than /etc/ansible/hosts:
$ echo "127.0.0.1" > ~/ansible_hosts
$ export ANSIBLE_INVENTORY=~/ansible_hosts
.. note::
ANSIBLE_INVENTORY is available starting at 1.9 and substitutes the deprecated ANSIBLE_HOSTS
You can read more about the inventory file in later parts of the manual.
Now let's test things with a ping command:

View file

@ -61,7 +61,7 @@ The ``auto`` inventory plugin is enabled by default and works by using the ``plu
| |--ec2-98-765-432-10.compute-1.amazonaws.com
|--@ungrouped:
You can set the default inventory path (via ``inventory`` in the `ansible.cfg` [defaults] section or the :envvar:`ANSIBLE_HOSTS` environment variable) to your inventory source(s). Now running ``ansible-inventory --graph`` should yield the same output as when you passed your YAML configuration source(s) directly. You can add custom inventory plugins to your plugin path to use in the same way.
You can set the default inventory path (via ``inventory`` in the `ansible.cfg` [defaults] section or the :envvar:`ANSIBLE_INVENTORY` environment variable) to your inventory source(s). Now running ``ansible-inventory --graph`` should yield the same output as when you passed your YAML configuration source(s) directly. You can add custom inventory plugins to your plugin path to use in the same way.
Your inventory source might be a directory of inventory configuration files. The constructed inventory plugin only operates on those hosts already in inventory, so you may want the constructed inventory configuration parsed at a particular point (such as last). Ansible parses the directory recursively, alphabetically. You cannot configure the parsing approach, so name your files to make it work predictably. Inventory plugins that extend constructed features directly can work around that restriction by adding constructed options in addition to the inventory plugin options. Otherwise, you can use ``-i`` with multiple sources to impose a specific order, e.g. ``-i demo.aws_ec2.yml -i clouds.yml -i constructed.yml``.

View file

@ -54,7 +54,7 @@ Specifying Inventory sources
-----------------------------
Use of ``--inventory-file`` on the command line is now deprecated. Use ``--inventory`` or ``-i``.
The associated ini configuration key, ``hostfile``, and environment variable, :envvar:`ANSIBLE_HOSTS`,
The associated ini configuration key, ``hostfile``, and environment variable, ``ANSIBLE_HOSTS``,
are also deprecated. Replace them with the configuration key ``inventory`` and environment variable :envvar:`ANSIBLE_INVENTORY`.
Use of multiple tags

View file

@ -392,7 +392,7 @@ DEFAULT_ASK_SUDO_PASS:
default: False
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_ask_pass.
version: "2.8"
version: "2.9"
alternatives: become
description:
- This controls whether an Ansible playbook should prompt for a sudo password.
@ -405,7 +405,7 @@ DEFAULT_ASK_SU_PASS:
default: False
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_ask_pass.
version: "2.8"
version: "2.9"
alternatives: become
description:
- This controls whether an Ansible playbook should prompt for a su password.
@ -632,7 +632,7 @@ DEFAULT_HANDLER_INCLUDES_STATIC:
type: boolean
deprecated:
why: include itself is deprecated and this setting will not matter in the future
version: "2.8"
version: "2.12"
alternatives: none as its already built into the decision between include_tasks and import_tasks
DEFAULT_HASH_BEHAVIOUR:
name: Hash merge behaviour
@ -656,20 +656,9 @@ DEFAULT_HOST_LIST:
default: /etc/ansible/hosts
description: Comma separated list of Ansible inventory sources
env:
- name: ANSIBLE_HOSTS
deprecated:
why: The variable is misleading as it can be a list of hosts and/or paths to inventory sources
version: "2.8"
alternatives: ANSIBLE_INVENTORY
- name: ANSIBLE_INVENTORY
expand_relative_paths: True
ini:
- key: hostfile
section: defaults
deprecated:
why: The key is misleading as it can also be a list of hosts, a directory or a list of paths
version: "2.8"
alternatives: "[defaults]\ninventory=/path/to/file|dir"
- key: inventory
section: defaults
type: pathlist
@ -1074,7 +1063,7 @@ DEFAULT_SUDO:
default: False
deprecated:
why: In favor of Ansible Become, which is a generic framework
version: "2.8"
version: "2.9"
alternatives: become
description: 'Toggle the use of "sudo" for tasks.'
env: [{name: ANSIBLE_SUDO}]
@ -1086,7 +1075,7 @@ DEFAULT_SUDO_EXE:
default: sudo
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_exe.
version: "2.8"
version: "2.9"
alternatives: become
description: 'specify an "sudo" executable, otherwise it relies on PATH.'
env: [{name: ANSIBLE_SUDO_EXE}]
@ -1097,7 +1086,7 @@ DEFAULT_SUDO_FLAGS:
default: '-H -S -n'
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_flags.
version: "2.8"
version: "2.9"
alternatives: become
description: 'Flags to pass to "sudo"'
env: [{name: ANSIBLE_SUDO_FLAGS}]
@ -1108,7 +1097,7 @@ DEFAULT_SUDO_USER:
default:
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_user.
version: "2.8"
version: "2.9"
alternatives: become
description: 'User you become when using "sudo", leaving it blank will use the default configured on the target (normally root)'
env: [{name: ANSIBLE_SUDO_USER}]
@ -1119,7 +1108,7 @@ DEFAULT_SU_EXE:
default: su
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_exe.
version: "2.8"
version: "2.9"
alternatives: become
description: 'specify an "su" executable, otherwise it relies on PATH.'
env: [{name: ANSIBLE_SU_EXE}]
@ -1130,7 +1119,7 @@ DEFAULT_SU_FLAGS:
default: ''
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_flags.
version: "2.8"
version: "2.9"
alternatives: become
description: 'Flags to pass to su'
env: [{name: ANSIBLE_SU_FLAGS}]
@ -1145,7 +1134,7 @@ DEFAULT_SU_USER:
- {key: su_user, section: defaults}
deprecated:
why: In favor of Ansible Become, which is a generic framework. See become_user.
version: "2.8"
version: "2.9"
alternatives: become
DEFAULT_SYSLOG_FACILITY:
name: syslog facility
@ -1166,7 +1155,7 @@ DEFAULT_TASK_INCLUDES_STATIC:
version_added: "2.1"
deprecated:
why: include itself is deprecated and this setting will not matter in the future
version: "2.8"
version: "2.12"
alternatives: None, as its already built into the decision between include_tasks and import_tasks
DEFAULT_TERMINAL_PLUGIN_PATH:
name: Terminal Plugins Path