meta – Execute Ansible ‘actions’
meta – Execute Ansible ‘actions’
Synopsis
- Meta tasks are a special kind of task which can influence Ansible internal execution or state. Prior to Ansible 2.0, the only meta option available was
flush_handlers
. As of 2.2, there are five meta tasks which can be used. Meta tasks can be used anywhere within your playbook. - This module is also supported for Windows targets.
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
free_form - / required |
|
This module takes a free form command, as a string. There's not an actual option named "free form". See the examples!
|
Notes
Note
meta
is not really a module nor action_plugin as such it cannot be overwritten.- This module is also supported for Windows targets.
Examples
- template:
src: new.j2
dest: /etc/config.txt
notify: myhandler
- name: force all notified handlers to run at this point, not waiting for normal sync points
meta: flush_handlers
- name: reload inventory, useful with dynamic inventories when play makes changes to the existing hosts
cloud_guest: # this is fake module
name: newhost
state: present
- name: Refresh inventory to ensure new instaces exist in inventory
meta: refresh_inventory
- name: Clear gathered facts from all currently targeted hosts
meta: clear_facts
- name: bring host back to play after failure
copy:
src: file
dest: /etc/file
remote_user: imightnothavepermission
- meta: clear_host_errors
- user: name={{ansible_user}} groups=input
- name: reset ssh connection to allow user changes to affect 'current login user'
meta: reset_connection
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Core Team. [core]
Red Hat Support
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors
- Ansible Core Team
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/meta_module.html