You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/docs/docsite/rst/user_guide/intro_adhoc.rst

207 lines
7.9 KiB
ReStructuredText

.. _intro_adhoc:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
*******************************
Introduction to ad-hoc commands
*******************************
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
An Ansible ad-hoc command uses the `/usr/bin/ansible` command-line tool to automate a single task on one or more managed nodes. Ad-hoc commands are quick and easy, but they are not re-usable. So why learn about ad-hoc commands first? Ad-hoc commands demonstrate the simplicity and power of Ansible. The concepts you learn here will port over directly to the playbook language. Before reading and executing these examples, please read :ref:`intro_inventory`.
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. contents::
:local:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Why use ad-hoc commands?
========================
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Ad-hoc commands are great for tasks you repeat rarely. For example, if you want to power off all the machines in your lab for Christmas vacation, you could execute a quick one-liner in Ansible without writing a playbook. An ad-hoc command looks like this:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible [pattern] -m [module] -a "[module options]"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
You can learn more about :ref:`patterns<intro_patterns>` and :ref:`modules<working_with_modules>` on other pages.
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Use cases for ad-hoc tasks
==========================
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Ad-hoc tasks can be used to reboot servers, copy files, manage packages and users, and much more. You can use any Ansible module in an ad-hoc task. Ad-hoc tasks, like playbooks, use a declarative model,
calculating and executing the actions required to reach a specified final state. They
achieve a form of idempotence by checking the current state before they begin and doing nothing unless the current state is different from the specified final state.
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Rebooting servers
-----------------
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
The default module for the ``ansible`` command-line utility is the :ref:`command module<command_module>`. You can use an ad-hoc task to call the command module and reboot all web servers in Atlanta, 10 at a time. Before Ansible can do this, you must have all servers in Atlanta listed in a a group called [atlanta] in your inventory, and you must have working SSH credentials for each machine in that group. To reboot all the servers in the [atlanta] group:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible atlanta -a "/sbin/reboot"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
By default Ansible uses only 5 simultaneous processes. If you have more hosts than the value set for the fork count, Ansible will talk to them, but it will take a little longer. To reboot the [atlanta] servers with 10 parallel forks:
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
$ ansible atlanta -a "/sbin/reboot" -f 10
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
/usr/bin/ansible will default to running from your user account. To connect as a different user:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible atlanta -a "/sbin/reboot" -f 10 -u username
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Rebooting probably requires privilege escalation. You can connect to the server as ``username`` and run the command as the ``root`` user by using the :ref:`become <become>` keyword:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible atlanta -a "/sbin/reboot" -f 10 -u username --become [--ask-become-pass]
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
If you add ``--ask-become-pass`` or ``-K``, Ansible prompts you for the password to use for privilege escalation (sudo/su/pfexec/doas/etc).
.. note::
The :ref:`command module <command_module>` does not support extended shell syntax like piping and
redirects (although shell variables will always work). If your command requires shell-specific
syntax, use the `shell` module instead. Read more about the differences on the
:ref:`working_with_modules` page.
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
So far all our examples have used the default 'command' module. To use a different module, pass ``-m`` for module name. For example, to use the :ref:`shell module <shell_module>`:
.. code-block:: bash
$ ansible raleigh -m shell -a 'echo $TERM'
When running any command with the Ansible *ad hoc* CLI (as opposed to
:ref:`Playbooks <working_with_playbooks>`), pay particular attention to shell quoting rules, so
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
the local shell retains the variable and passes it to Ansible.
For example, using double rather than single quotes in the above example would
evaluate the variable on the box you were on.
.. _file_transfer:
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Managing files
--------------
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
An ad-hoc task can harness the power of Ansible and SCP to transfer many files to multiple machines in parallel. To transfer a file directly to all servers in the [atlanta] group:
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
13 years ago
$ ansible atlanta -m copy -a "src=/etc/hosts dest=/tmp/hosts"
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
If you plan to repeat a task like this, use the :ref:`template<template_module>` module in a playbook.
The :ref:`file<file_module>` module allows changing ownership and permissions on files. These
same options can be passed directly to the ``copy`` module as well:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
$ ansible webservers -m file -a "dest=/srv/foo/a.txt mode=600"
$ ansible webservers -m file -a "dest=/srv/foo/b.txt mode=600 owner=mdehaan group=mdehaan"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
The ``file`` module can also create directories, similar to ``mkdir -p``:
.. code-block:: bash
$ ansible webservers -m file -a "dest=/path/to/c mode=755 owner=mdehaan group=mdehaan state=directory"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
As well as delete directories (recursively) and delete files:
.. code-block:: bash
$ ansible webservers -m file -a "dest=/path/to/c state=absent"
.. _managing_packages:
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Managing packages
-----------------
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
You might also use an ad-hoc task to install, update, or remove packages on managed nodes using a package management module like yum. To ensure a package is installed without updating it:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
$ ansible webservers -m yum -a "name=acme state=present"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
To ensure a specific version of a package is installed:
.. code-block:: bash
$ ansible webservers -m yum -a "name=acme-1.5 state=present"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
To ensure a package is at the latest version:
.. code-block:: bash
$ ansible webservers -m yum -a "name=acme state=latest"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
To ensure a package is not installed:
.. code-block:: bash
$ ansible webservers -m yum -a "name=acme state=absent"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Ansible has modules for managing packages under many platforms. If there is no module for your package manager, you can install packages using the command module or create a module for your package manager.
.. _users_and_groups:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Managing users and groups
-------------------------
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
You can create, manage, and remove user accounts on your managed nodes with ad-hoc tasks:
.. code-block:: bash
$ ansible all -m user -a "name=foo password=<crypted password here>"
$ ansible all -m user -a "name=foo state=absent"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
See the :ref:`user <user_module>` module documentation for details on all of the available options, including
how to manipulate groups and group membership.
.. _managing_services:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Managing services
-----------------
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Ensure a service is started on all webservers:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible webservers -m service -a "name=httpd state=started"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Alternatively, restart a service on all webservers:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible webservers -m service -a "name=httpd state=restarted"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Ensure a service is stopped:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
$ ansible webservers -m service -a "name=httpd state=stopped"
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. _gathering_facts:
13 years ago
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Gathering facts
---------------
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Facts represent discovered variables about a system. You can use facts to implement conditional execution of tasks but also just to get ad-hoc information about your systems. To see all facts:
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
.. code-block:: bash
12 years ago
$ ansible all -m setup
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
You can also filter this output to display only certain facts, see the :ref:`setup <setup_module>` module documentation for details.
Backport/2.9/docs3 (#63251) * Fixing typo mistake in testbed with section. Deploy template from content library is supported from 67U3 (cherry picked from commit c6c13b56260565dd0ae6cfdbfad3c4191e2a0a5d) * Typo fix in mssql_db (#63184) Changed from 'then' to 'than' (cherry picked from commit b5cc0872e713826c85bdde04e5443be6dca94ebf) * VMware: Update maintenance notes on vmware_cfg_backup (#62853) Maintenance mode seems only to be required for load or restet, not for save_configuration. (cherry picked from commit e977e0af741f55520e3671addcdc433a7792be67) * Misc typo in nxos_config documentation (#62629) * Changed 'exit' to 'exist' * Removed unnecessary word 'first' (cherry picked from commit 0554b50eedae4e8a70fcc2e69d0297c4f5439b7f) * postgresql: add elements for list params to the module's documentation (#63186) (cherry picked from commit 8a37a2440ecbf8407b28b19db2d3c987a367051b) * mysql: add elements for list params to the modules' documentation (#63187) (cherry picked from commit 30c2d21f17832266bb2ba140c6ea530167845098) * Add spaces around {{ indicators. (#63125) The example looked a little less readable by not having spaces after `{{` and before `}}`. This commit should make the examples match [ansible-lint rule 206](https://github.com/ansible/ansible-lint/blob/master/lib/ansiblelint/rules/VariableHasSpacesRule.py) (cherry picked from commit b7a9d99cefe15b248ebc11162529d16babd28d7f) * fix typo in collection/plugins/readme (#63162) (cherry picked from commit da1a9450885bc51b0268b7ec7c0830e35e71583e) * Docs: User guide overhaul, part 1 (#63056) (cherry picked from commit 941a9b68fc262182172e081533e43ccbf60c453f)
5 years ago
Now that you understand the basic elements of Ansible execution, you are ready to learn to automate repetitive tasks using :ref:`Ansible Playbooks <playbooks_intro>`.
.. seealso::
:ref:`intro_configuration`
All about the Ansible config file
:ref:`all_modules`
A list of available modules
:ref:`working_with_playbooks`
Using Ansible for configuration management & deployment
`Mailing List <https://groups.google.com/group/ansible-project>`_
Questions? Help? Ideas? Stop by the list on Google Groups
`irc.freenode.net <http://irc.freenode.net>`_
#ansible IRC chat channel