mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
modules: fix examples to use FQCN for builtin modules (#648)
* modules: fix examples to use FQCN for builtin modules * fix * fix * fix * fix * fix * fix * fix
This commit is contained in:
parent
c034e8c04f
commit
c055340ecb
126 changed files with 290 additions and 286 deletions
|
@ -629,7 +629,7 @@ playbook.yml: >
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
- name: Default plugin output
|
- name: Default plugin output
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: default plugin output
|
msg: default plugin output
|
||||||
|
|
||||||
- name: Override from play vars
|
- name: Override from play vars
|
||||||
|
@ -687,11 +687,11 @@ playbook.yml: >
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Custom banner with default plugin result output
|
- name: Custom banner with default plugin result output
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "default plugin output: result example"
|
msg: "default plugin output: result example"
|
||||||
|
|
||||||
- name: Override from task vars
|
- name: Override from task vars
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "example {{ two }}"
|
msg: "example {{ two }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
vars:
|
vars:
|
||||||
|
@ -703,14 +703,14 @@ playbook.yml: >
|
||||||
ansible_callback_diy_runner_on_ok_msg_color: "{{ 'yellow' if ansible_callback_diy.result.is_changed else 'bright green' }}"
|
ansible_callback_diy_runner_on_ok_msg_color: "{{ 'yellow' if ansible_callback_diy.result.is_changed else 'bright green' }}"
|
||||||
|
|
||||||
- name: Suppress output
|
- name: Suppress output
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: i should not be displayed
|
msg: i should not be displayed
|
||||||
vars:
|
vars:
|
||||||
ansible_callback_diy_playbook_on_task_start_msg: ""
|
ansible_callback_diy_playbook_on_task_start_msg: ""
|
||||||
ansible_callback_diy_runner_on_ok_msg: ""
|
ansible_callback_diy_runner_on_ok_msg: ""
|
||||||
|
|
||||||
- name: Using alias vars (see ansible.cfg)
|
- name: Using alias vars (see ansible.cfg)
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg:
|
msg:
|
||||||
when: False
|
when: False
|
||||||
vars:
|
vars:
|
||||||
|
@ -719,13 +719,13 @@ playbook.yml: >
|
||||||
on_skipped_msg_color: white
|
on_skipped_msg_color: white
|
||||||
|
|
||||||
- name: Just stdout
|
- name: Just stdout
|
||||||
command: echo some stdout
|
ansible.builtin.command: echo some stdout
|
||||||
vars:
|
vars:
|
||||||
ansible_callback_diy_playbook_on_task_start_msg: "\n"
|
ansible_callback_diy_playbook_on_task_start_msg: "\n"
|
||||||
ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.stdout }}\n"
|
ansible_callback_diy_runner_on_ok_msg: "{{ ansible_callback_diy.result.output.stdout }}\n"
|
||||||
|
|
||||||
- name: Multiline output
|
- name: Multiline output
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ multiline }}"
|
msg: "{{ multiline }}"
|
||||||
vars:
|
vars:
|
||||||
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
||||||
|
@ -738,7 +738,7 @@ playbook.yml: >
|
||||||
ansible_callback_diy_playbook_on_task_start_msg_color: bright blue
|
ansible_callback_diy_playbook_on_task_start_msg_color: bright blue
|
||||||
|
|
||||||
- name: Indentation
|
- name: Indentation
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ item.msg }}"
|
msg: "{{ item.msg }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { indent: 1, msg: one., color: red }
|
- { indent: 1, msg: one., color: red }
|
||||||
|
@ -751,14 +751,14 @@ playbook.yml: >
|
||||||
ansible_callback_diy_runner_on_ok_msg_color: bright green
|
ansible_callback_diy_runner_on_ok_msg_color: bright green
|
||||||
|
|
||||||
- name: Using lookup and template as file
|
- name: Using lookup and template as file
|
||||||
shell: "echo {% raw %}'output from {{ file_name }}'{% endraw %} > {{ file_name }}"
|
ansible.builtin.shell: "echo {% raw %}'output from {{ file_name }}'{% endraw %} > {{ file_name }}"
|
||||||
vars:
|
vars:
|
||||||
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
||||||
file_name: diy_file_template_example
|
file_name: diy_file_template_example
|
||||||
ansible_callback_diy_runner_on_ok_msg: "{{ lookup('template', file_name) }}"
|
ansible_callback_diy_runner_on_ok_msg: "{{ lookup('template', file_name) }}"
|
||||||
|
|
||||||
- name: 'Look at top level vars available to the "runner_on_ok" callback'
|
- name: 'Look at top level vars available to the "runner_on_ok" callback'
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: ''
|
msg: ''
|
||||||
vars:
|
vars:
|
||||||
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
||||||
|
@ -771,7 +771,7 @@ playbook.yml: >
|
||||||
ansible_callback_diy_runner_on_ok_msg_color: white
|
ansible_callback_diy_runner_on_ok_msg_color: white
|
||||||
|
|
||||||
- name: 'Look at event data available to the "runner_on_ok" callback'
|
- name: 'Look at event data available to the "runner_on_ok" callback'
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: ''
|
msg: ''
|
||||||
vars:
|
vars:
|
||||||
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
ansible_callback_diy_playbook_on_task_start_msg: "\nDIY output(via task vars): task example: {{ ansible_callback_diy.task.name }}"
|
||||||
|
|
|
@ -30,8 +30,8 @@ DOCUMENTATION = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- debug: msg="This will not be printed"
|
- ansible.builtin.debug: msg="This will not be printed"
|
||||||
- debug: msg="But this will"
|
- ansible.builtin.debug: msg="But this will"
|
||||||
tags: [print_action]
|
tags: [print_action]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -54,5 +54,5 @@ requirements:
|
||||||
notes:
|
notes:
|
||||||
- "In order to use this module you have to install oVirt Python SDK.
|
- "In order to use this module you have to install oVirt Python SDK.
|
||||||
To ensure it's installed with correct version you can create the following task:
|
To ensure it's installed with correct version you can create the following task:
|
||||||
pip: name=ovirt-engine-sdk-python version=4.3.0"
|
ansible.builtin.pip: name=ovirt-engine-sdk-python version=4.3.0"
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -29,7 +29,7 @@ except ImportError:
|
||||||
|
|
||||||
def json_query(data, expr):
|
def json_query(data, expr):
|
||||||
'''Query data using jmespath query language ( http://jmespath.org ). Example:
|
'''Query data using jmespath query language ( http://jmespath.org ). Example:
|
||||||
- debug: msg="{{ instance | json_query(tagged_instances[*].block_device_mapping.*.volume_id') }}"
|
- ansible.builtin.debug: msg="{{ instance | json_query(tagged_instances[*].block_device_mapping.*.volume_id') }}"
|
||||||
'''
|
'''
|
||||||
if not HAS_LIB:
|
if not HAS_LIB:
|
||||||
raise AnsibleError('You need to install "jmespath" prior to running '
|
raise AnsibleError('You need to install "jmespath" prior to running '
|
||||||
|
|
|
@ -20,10 +20,10 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Example of the change in the description
|
- name: Example of the change in the description
|
||||||
debug: msg="{{ lookup('cartesian', [1,2,3], [a, b])}}"
|
ansible.builtin.debug: msg="{{ lookup('cartesian', [1,2,3], [a, b])}}"
|
||||||
|
|
||||||
- name: loops over the cartesian product of the supplied lists
|
- name: loops over the cartesian product of the supplied lists
|
||||||
debug: msg="{{item}}"
|
ansible.builtin.debug: msg="{{item}}"
|
||||||
with_cartesian:
|
with_cartesian:
|
||||||
- "{{list1}}"
|
- "{{list1}}"
|
||||||
- "{{list2}}"
|
- "{{list2}}"
|
||||||
|
|
|
@ -27,7 +27,7 @@ DOCUMENTATION = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ lookup('chef_databag', 'name=data_bag_name item=data_bag_item') }}"
|
msg: "{{ lookup('chef_databag', 'name=data_bag_name item=data_bag_item') }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -78,19 +78,19 @@ DOCUMENTATION = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: 'key contains {{item}}'
|
msg: 'key contains {{item}}'
|
||||||
with_consul_kv:
|
with_consul_kv:
|
||||||
- 'key/to/retrieve'
|
- 'key/to/retrieve'
|
||||||
|
|
||||||
- name: Parameters can be provided after the key be more specific about what to retrieve
|
- name: Parameters can be provided after the key be more specific about what to retrieve
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: 'key contains {{item}}'
|
msg: 'key contains {{item}}'
|
||||||
with_consul_kv:
|
with_consul_kv:
|
||||||
- 'key/to recurse=true token=E6C060A9-26FB-407A-B83E-12DDAFCB4D98'
|
- 'key/to recurse=true token=E6C060A9-26FB-407A-B83E-12DDAFCB4D98'
|
||||||
|
|
||||||
- name: retrieving a KV from a remote cluster on non default port
|
- name: retrieving a KV from a remote cluster on non default port
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('consul_kv', 'my/key', host='10.10.10.10', port='2000') }}"
|
msg: "{{ lookup('consul_kv', 'my/key', host='10.10.10.10', port='2000') }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -44,16 +44,16 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: first use credstash to store your secrets
|
- name: first use credstash to store your secrets
|
||||||
shell: credstash put my-github-password secure123
|
ansible.builtin.shell: credstash put my-github-password secure123
|
||||||
|
|
||||||
- name: "Test credstash lookup plugin -- get my github password"
|
- name: "Test credstash lookup plugin -- get my github password"
|
||||||
debug: msg="Credstash lookup! {{ lookup('credstash', 'my-github-password') }}"
|
ansible.builtin.debug: msg="Credstash lookup! {{ lookup('credstash', 'my-github-password') }}"
|
||||||
|
|
||||||
- name: "Test credstash lookup plugin -- get my other password from us-west-1"
|
- name: "Test credstash lookup plugin -- get my other password from us-west-1"
|
||||||
debug: msg="Credstash lookup! {{ lookup('credstash', 'my-other-password', region='us-west-1') }}"
|
ansible.builtin.debug: msg="Credstash lookup! {{ lookup('credstash', 'my-other-password', region='us-west-1') }}"
|
||||||
|
|
||||||
- name: "Test credstash lookup plugin -- get the company's github password"
|
- name: "Test credstash lookup plugin -- get the company's github password"
|
||||||
debug: msg="Credstash lookup! {{ lookup('credstash', 'company-github-password', table='company-passwords') }}"
|
ansible.builtin.debug: msg="Credstash lookup! {{ lookup('credstash', 'company-github-password', table='company-passwords') }}"
|
||||||
|
|
||||||
- name: Example play using the 'context' feature
|
- name: Example play using the 'context' feature
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
|
@ -64,10 +64,10 @@ EXAMPLES = """
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: "Test credstash lookup plugin -- get the password with a context passed as a variable"
|
- name: "Test credstash lookup plugin -- get the password with a context passed as a variable"
|
||||||
debug: msg="{{ lookup('credstash', 'some-password', context=context) }}"
|
ansible.builtin.debug: msg="{{ lookup('credstash', 'some-password', context=context) }}"
|
||||||
|
|
||||||
- name: "Test credstash lookup plugin -- get the password with a context defined here"
|
- name: "Test credstash lookup plugin -- get the password with a context defined here"
|
||||||
debug: msg="{{ lookup('credstash', 'some-password', context=dict(app='my_app', environment='production')) }}"
|
ansible.builtin.debug: msg="{{ lookup('credstash', 'some-password', context=dict(app='my_app', environment='production')) }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
|
@ -36,7 +36,7 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: passing options to the lookup
|
- name: passing options to the lookup
|
||||||
debug: msg={{ lookup("cyberarkpassword", cyquery)}}
|
ansible.builtin.debug: msg={{ lookup("cyberarkpassword", cyquery)}}
|
||||||
vars:
|
vars:
|
||||||
cyquery:
|
cyquery:
|
||||||
appid: "app_ansible"
|
appid: "app_ansible"
|
||||||
|
@ -45,7 +45,7 @@ EXAMPLES = """
|
||||||
|
|
||||||
|
|
||||||
- name: used in a loop
|
- name: used in a loop
|
||||||
debug: msg={{item}}
|
ansible.builtin.debug: msg={{item}}
|
||||||
with_cyberarkpassword:
|
with_cyberarkpassword:
|
||||||
appid: 'app_ansible'
|
appid: 'app_ansible'
|
||||||
query: 'safe=CyberArk_Passwords;folder=root;object=AdminPass'
|
query: 'safe=CyberArk_Passwords;folder=root;object=AdminPass'
|
||||||
|
|
|
@ -44,24 +44,24 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Simple A record (IPV4 address) lookup for example.com
|
- name: Simple A record (IPV4 address) lookup for example.com
|
||||||
debug: msg="{{ lookup('dig', 'example.com.')}}"
|
ansible.builtin.debug: msg="{{ lookup('dig', 'example.com.')}}"
|
||||||
|
|
||||||
- name: "The TXT record for example.org."
|
- name: "The TXT record for example.org."
|
||||||
debug: msg="{{ lookup('dig', 'example.org.', 'qtype=TXT') }}"
|
ansible.builtin.debug: msg="{{ lookup('dig', 'example.org.', 'qtype=TXT') }}"
|
||||||
|
|
||||||
- name: "The TXT record for example.org, alternative syntax."
|
- name: "The TXT record for example.org, alternative syntax."
|
||||||
debug: msg="{{ lookup('dig', 'example.org./TXT') }}"
|
ansible.builtin.debug: msg="{{ lookup('dig', 'example.org./TXT') }}"
|
||||||
|
|
||||||
- name: use in a loop
|
- name: use in a loop
|
||||||
debug: msg="MX record for gmail.com {{ item }}"
|
ansible.builtin.debug: msg="MX record for gmail.com {{ item }}"
|
||||||
with_items: "{{ lookup('dig', 'gmail.com./MX', wantlist=True) }}"
|
with_items: "{{ lookup('dig', 'gmail.com./MX', wantlist=True) }}"
|
||||||
|
|
||||||
- debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '192.0.2.5/PTR') }}"
|
- ansible.builtin.debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '192.0.2.5/PTR') }}"
|
||||||
- debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '5.2.0.192.in-addr.arpa./PTR') }}"
|
- ansible.builtin.debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '5.2.0.192.in-addr.arpa./PTR') }}"
|
||||||
- debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '5.2.0.192.in-addr.arpa.', 'qtype=PTR') }}"
|
- ansible.builtin.debug: msg="Reverse DNS for 192.0.2.5 is {{ lookup('dig', '5.2.0.192.in-addr.arpa.', 'qtype=PTR') }}"
|
||||||
- debug: msg="Querying 198.51.100.23 for IPv4 address for example.com. produces {{ lookup('dig', 'example.com', '@198.51.100.23') }}"
|
- ansible.builtin.debug: msg="Querying 198.51.100.23 for IPv4 address for example.com. produces {{ lookup('dig', 'example.com', '@198.51.100.23') }}"
|
||||||
|
|
||||||
- debug: msg="XMPP service for gmail.com. is available at {{ item.target }} on port {{ item.port }}"
|
- ansible.builtin.debug: msg="XMPP service for gmail.com. is available at {{ item.target }} on port {{ item.port }}"
|
||||||
with_items: "{{ lookup('dig', '_xmpp-server._tcp.gmail.com./SRV', 'flat=0', wantlist=True) }}"
|
with_items: "{{ lookup('dig', '_xmpp-server._tcp.gmail.com./SRV', 'flat=0', wantlist=True) }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -21,17 +21,17 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: show txt entry
|
- name: show txt entry
|
||||||
debug: msg="{{lookup('dnstxt', ['test.example.com'])}}"
|
ansible.builtin.debug: msg="{{lookup('dnstxt', ['test.example.com'])}}"
|
||||||
|
|
||||||
- name: iterate over txt entries
|
- name: iterate over txt entries
|
||||||
debug: msg="{{item}}"
|
ansible.builtin.debug: msg="{{item}}"
|
||||||
with_dnstxt:
|
with_dnstxt:
|
||||||
- 'test.example.com'
|
- 'test.example.com'
|
||||||
- 'other.example.com'
|
- 'other.example.com'
|
||||||
- 'last.example.com'
|
- 'last.example.com'
|
||||||
|
|
||||||
- name: iterate of a comma delimited DNS TXT entry
|
- name: iterate of a comma delimited DNS TXT entry
|
||||||
debug: msg="{{item}}"
|
ansible.builtin.debug: msg="{{item}}"
|
||||||
with_dnstxt: "{{lookup('dnstxt', ['test.example.com']).split(',')}}"
|
with_dnstxt: "{{lookup('dnstxt', ['test.example.com']).split(',')}}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ EXAMPLES = r"""
|
||||||
vars:
|
vars:
|
||||||
secret: "{{ lookup('community.general.dsv', '/test/secret') }}"
|
secret: "{{ lookup('community.general.dsv', '/test/secret') }}"
|
||||||
tasks:
|
tasks:
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: 'the password is {{ secret["data"]["password"] }}'
|
msg: 'the password is {{ secret["data"]["password"] }}'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -54,13 +54,13 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: "a value from a locally running etcd"
|
- name: "a value from a locally running etcd"
|
||||||
debug: msg={{ lookup('etcd', 'foo/bar') }}
|
ansible.builtin.debug: msg={{ lookup('etcd', 'foo/bar') }}
|
||||||
|
|
||||||
- name: "values from multiple folders on a locally running etcd"
|
- name: "values from multiple folders on a locally running etcd"
|
||||||
debug: msg={{ lookup('etcd', 'foo', 'bar', 'baz') }}
|
ansible.builtin.debug: msg={{ lookup('etcd', 'foo', 'bar', 'baz') }}
|
||||||
|
|
||||||
- name: "since Ansible 2.5 you can set server options inline"
|
- name: "since Ansible 2.5 you can set server options inline"
|
||||||
debug: msg="{{ lookup('etcd', 'foo', version='v2', url='http://192.168.0.27:4001') }}"
|
ansible.builtin.debug: msg="{{ lookup('etcd', 'foo', version='v2', url='http://192.168.0.27:4001') }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -82,7 +82,7 @@ from ansible.module_utils.urls import open_url
|
||||||
# If etcd v2 running on host 192.168.1.21 on port 2379
|
# If etcd v2 running on host 192.168.1.21 on port 2379
|
||||||
# we can use the following in a playbook to retrieve /tfm/network/config key
|
# we can use the following in a playbook to retrieve /tfm/network/config key
|
||||||
#
|
#
|
||||||
# - debug: msg={{lookup('etcd','/tfm/network/config', url='http://192.168.1.21:2379' , version='v2')}}
|
# - ansible.builtin.debug: msg={{lookup('etcd','/tfm/network/config', url='http://192.168.1.21:2379' , version='v2')}}
|
||||||
#
|
#
|
||||||
# Example Output:
|
# Example Output:
|
||||||
#
|
#
|
||||||
|
|
|
@ -101,19 +101,19 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: "a value from a locally running etcd"
|
- name: "a value from a locally running etcd"
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.etcd3', 'foo/bar') }}"
|
msg: "{{ lookup('community.general.etcd3', 'foo/bar') }}"
|
||||||
|
|
||||||
- name: "values from multiple folders on a locally running etcd"
|
- name: "values from multiple folders on a locally running etcd"
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.etcd3', 'foo', 'bar', 'baz') }}"
|
msg: "{{ lookup('community.general.etcd3', 'foo', 'bar', 'baz') }}"
|
||||||
|
|
||||||
- name: "look for a key prefix"
|
- name: "look for a key prefix"
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.etcd3', '/foo/bar', prefix=True) }}"
|
msg: "{{ lookup('community.general.etcd3', '/foo/bar', prefix=True) }}"
|
||||||
|
|
||||||
- name: "connect to etcd3 with a client certificate"
|
- name: "connect to etcd3 with a client certificate"
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.etcd3', 'foo/bar', cert_cert='/etc/ssl/etcd/client.pem', cert_key='/etc/ssl/etcd/client.key') }}"
|
msg: "{{ lookup('community.general.etcd3', 'foo/bar', cert_cert='/etc/ssl/etcd/client.pem', cert_key='/etc/ssl/etcd/client.key') }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ options:
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Create directories
|
- name: Create directories
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /web/{{ item.path }}
|
path: /web/{{ item.path }}
|
||||||
state: directory
|
state: directory
|
||||||
mode: '{{ item.mode }}'
|
mode: '{{ item.mode }}'
|
||||||
|
@ -29,7 +29,7 @@ EXAMPLES = """
|
||||||
when: item.state == 'directory'
|
when: item.state == 'directory'
|
||||||
|
|
||||||
- name: Template files (explicitly skip directories in order to use the 'src' attribute)
|
- name: Template files (explicitly skip directories in order to use the 'src' attribute)
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: '{{ item.src }}'
|
src: '{{ item.src }}'
|
||||||
dest: /web/{{ item.path }}
|
dest: /web/{{ item.path }}
|
||||||
mode: '{{ item.mode }}'
|
mode: '{{ item.mode }}'
|
||||||
|
@ -37,7 +37,7 @@ EXAMPLES = """
|
||||||
when: item.state == 'file'
|
when: item.state == 'file'
|
||||||
|
|
||||||
- name: Recreate symlinks
|
- name: Recreate symlinks
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: '{{ item.src }}'
|
src: '{{ item.src }}'
|
||||||
dest: /web/{{ item.path }}
|
dest: /web/{{ item.path }}
|
||||||
state: link
|
state: link
|
||||||
|
|
|
@ -21,7 +21,7 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: "'unnest' all elements into single list"
|
- name: "'unnest' all elements into single list"
|
||||||
debug: msg="all in one list {{lookup('flattened', [1,2,3,[5,6]], [a,b,c], [[5,6,1,3], [34,a,b,c]])}}"
|
ansible.builtin.debug: msg="all in one list {{lookup('flattened', [1,2,3,[5,6]], [a,b,c], [[5,6,1,3], [34,a,b,c]])}}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
|
@ -29,7 +29,7 @@ extends_documentation_fragment:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- debug: msg="the value of foo.txt is {{ lookup('gcp_storage_file',
|
- ansible.builtin.debug: msg="the value of foo.txt is {{ lookup('gcp_storage_file',
|
||||||
bucket='gcp-bucket', src='mydir/foo.txt', project='project-name',
|
bucket='gcp-bucket', src='mydir/foo.txt', project='project-name',
|
||||||
auth_kind='serviceaccount', service_account_file='/tmp/myserviceaccountfile.json') }}"
|
auth_kind='serviceaccount', service_account_file='/tmp/myserviceaccountfile.json') }}"
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -161,79 +161,79 @@ DOCUMENTATION = """
|
||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello:value token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200') }}"
|
||||||
|
|
||||||
- name: Return all secrets from a path
|
- name: Return all secrets from a path
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 url=http://myvault:8200') }}"
|
||||||
|
|
||||||
- name: Vault that requires authentication via LDAP
|
- name: Vault that requires authentication via LDAP
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret/hello:value auth_method=ldap mount_point=ldap username=myuser password=mypas') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret/hello:value auth_method=ldap mount_point=ldap username=myuser password=mypas') }}"
|
||||||
|
|
||||||
- name: Vault that requires authentication via username and password
|
- name: Vault that requires authentication via username and password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello:value auth_method=userpass username=myuser password=psw url=http://myvault:8200') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello:value auth_method=userpass username=myuser password=psw url=http://myvault:8200') }}"
|
||||||
|
|
||||||
- name: Using an ssl vault
|
- name: Using an ssl vault
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hola:value token=c975b780-d1be-8016-866b-01d0f9b688a5 validate_certs=False') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hola:value token=c975b780-d1be-8016-866b-01d0f9b688a5 validate_certs=False') }}"
|
||||||
|
|
||||||
- name: using certificate auth
|
- name: using certificate auth
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret/hi:value token=xxxx url=https://myvault:8200 validate_certs=True cacert=/cacert/path/ca.pem') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret/hi:value token=xxxx url=https://myvault:8200 validate_certs=True cacert=/cacert/path/ca.pem') }}"
|
||||||
|
|
||||||
- name: authenticate with a Vault app role
|
- name: authenticate with a Vault app role
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello:value auth_method=approle role_id=myroleid secret_id=mysecretid') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello:value auth_method=approle role_id=myroleid secret_id=mysecretid') }}"
|
||||||
|
|
||||||
- name: Return all secrets from a path in a namespace
|
- name: Return all secrets from a path in a namespace
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 namespace=teama/admins') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/hello token=c975b780-d1be-8016-866b-01d0f9b688a5 namespace=teama/admins') }}"
|
||||||
|
|
||||||
# When using KV v2 the PATH should include "data" between the secret engine mount and path (e.g. "secret/data/:path")
|
# When using KV v2 the PATH should include "data" between the secret engine mount and path (e.g. "secret/data/:path")
|
||||||
# see: https://www.vaultproject.io/api/secret/kv/kv-v2.html#read-secret-version
|
# see: https://www.vaultproject.io/api/secret/kv/kv-v2.html#read-secret-version
|
||||||
- name: Return latest KV v2 secret from path
|
- name: Return latest KV v2 secret from path
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/data/hello token=my_vault_token url=http://myvault_url:8200') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret=secret/data/hello token=my_vault_token url=http://myvault_url:8200') }}"
|
||||||
|
|
||||||
# The following examples work in collection releases after community.general 0.2.0
|
# The following examples work in collection releases after community.general 0.2.0
|
||||||
|
|
||||||
- name: secret= is not required if secret is first
|
- name: secret= is not required if secret is first
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret/data/hello token=<token> url=http://myvault_url:8200') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret/data/hello token=<token> url=http://myvault_url:8200') }}"
|
||||||
|
|
||||||
- name: options can be specified as parameters rather than put in term string
|
- name: options can be specified as parameters rather than put in term string
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret/data/hello', token=my_token_var, url='http://myvault_url:8200') }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret/data/hello', token=my_token_var, url='http://myvault_url:8200') }}"
|
||||||
|
|
||||||
# return_format (or its alias 'as') can control how secrets are returned to you
|
# return_format (or its alias 'as') can control how secrets are returned to you
|
||||||
- name: return secrets as a dict (default)
|
- name: return secrets as a dict (default)
|
||||||
set_fact:
|
set_fact:
|
||||||
my_secrets: "{{ lookup('community.general.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://myvault_url:8200') }}"
|
my_secrets: "{{ lookup('community.general.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://myvault_url:8200') }}"
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ my_secrets['secret_key'] }}"
|
msg: "{{ my_secrets['secret_key'] }}"
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "Secret '{{ item.key }}' has value '{{ item.value }}'"
|
msg: "Secret '{{ item.key }}' has value '{{ item.value }}'"
|
||||||
loop: "{{ my_secrets | dict2items }}"
|
loop: "{{ my_secrets | dict2items }}"
|
||||||
|
|
||||||
- name: return secrets as values only
|
- name: return secrets as values only
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "A secret value: {{ item }}"
|
msg: "A secret value: {{ item }}"
|
||||||
loop: "{{ query('community.general.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://myvault_url:8200', return_format='values') }}"
|
loop: "{{ query('community.general.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://myvault_url:8200', return_format='values') }}"
|
||||||
|
|
||||||
- name: return raw secret from API, including metadata
|
- name: return raw secret from API, including metadata
|
||||||
set_fact:
|
set_fact:
|
||||||
my_secret: "{{ lookup('community.general.hashi_vault', 'secret/data/hello:value', token=my_token_var, url='http://myvault_url:8200', as='raw') }}"
|
my_secret: "{{ lookup('community.general.hashi_vault', 'secret/data/hello:value', token=my_token_var, url='http://myvault_url:8200', as='raw') }}"
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "This is version {{ my_secret['metadata']['version'] }} of hello:value. The secret data is {{ my_secret['data']['data']['value'] }}"
|
msg: "This is version {{ my_secret['metadata']['version'] }} of hello:value. The secret data is {{ my_secret['data']['data']['value'] }}"
|
||||||
|
|
||||||
# AWS IAM authentication method
|
# AWS IAM authentication method
|
||||||
# uses Ansible standard AWS options
|
# uses Ansible standard AWS options
|
||||||
|
|
||||||
- name: authenticate with aws_iam_login
|
- name: authenticate with aws_iam_login
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.hashi_vault', 'secret/hello:value', auth_method='aws_iam_login' role_id='myroleid', profile=my_boto_profile) }}"
|
msg: "{{ lookup('community.general.hashi_vault', 'secret/hello:value', auth_method='aws_iam_login' role_id='myroleid', profile=my_boto_profile) }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -39,13 +39,13 @@ EXAMPLES = """
|
||||||
# All this examples depends on hiera.yml that describes the hierarchy
|
# All this examples depends on hiera.yml that describes the hierarchy
|
||||||
|
|
||||||
- name: "a value from Hiera 'DB'"
|
- name: "a value from Hiera 'DB'"
|
||||||
debug: msg={{ lookup('hiera', 'foo') }}
|
ansible.builtin.debug: msg={{ lookup('hiera', 'foo') }}
|
||||||
|
|
||||||
- name: "a value from a Hiera 'DB' on other environment"
|
- name: "a value from a Hiera 'DB' on other environment"
|
||||||
debug: msg={{ lookup('hiera', 'foo environment=production') }}
|
ansible.builtin.debug: msg={{ lookup('hiera', 'foo environment=production') }}
|
||||||
|
|
||||||
- name: "a value from a Hiera 'DB' for a concrete node"
|
- name: "a value from a Hiera 'DB' for a concrete node"
|
||||||
debug: msg={{ lookup('hiera', 'foo fqdn=puppet01.localdomain') }}
|
ansible.builtin.debug: msg={{ lookup('hiera', 'foo fqdn=puppet01.localdomain') }}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
|
@ -18,7 +18,7 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name : output secrets to screen (BAD IDEA)
|
- name : output secrets to screen (BAD IDEA)
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "Password: {{item}}"
|
msg: "Password: {{item}}"
|
||||||
with_keyring:
|
with_keyring:
|
||||||
- 'servicename username'
|
- 'servicename username'
|
||||||
|
|
|
@ -25,7 +25,7 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: get 'custom_field' from lastpass entry 'entry-name'
|
- name: get 'custom_field' from lastpass entry 'entry-name'
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('lastpass', 'entry-name', field='custom_field') }}"
|
msg: "{{ lookup('lastpass', 'entry-name', field='custom_field') }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,11 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: query LMDB for a list of country codes
|
- name: query LMDB for a list of country codes
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ query('lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') }}"
|
msg: "{{ query('lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') }}"
|
||||||
|
|
||||||
- name: use list of values in a loop by key wildcard
|
- name: use list of values in a loop by key wildcard
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "Hello from {{ item.0 }} a.k.a. {{ item.1 }}"
|
msg: "Hello from {{ item.0 }} a.k.a. {{ item.1 }}"
|
||||||
vars:
|
vars:
|
||||||
- lmdb_kv_db: jp.mdb
|
- lmdb_kv_db: jp.mdb
|
||||||
|
|
|
@ -40,11 +40,11 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- name: all available resources
|
- name: all available resources
|
||||||
debug: msg="{{ lookup('manifold', api_token='SecretToken') }}"
|
ansible.builtin.debug: msg="{{ lookup('manifold', api_token='SecretToken') }}"
|
||||||
- name: all available resources for a specific project in specific team
|
- name: all available resources for a specific project in specific team
|
||||||
debug: msg="{{ lookup('manifold', api_token='SecretToken', project='poject-1', team='team-2') }}"
|
ansible.builtin.debug: msg="{{ lookup('manifold', api_token='SecretToken', project='poject-1', team='team-2') }}"
|
||||||
- name: two specific resources
|
- name: two specific resources
|
||||||
debug: msg="{{ lookup('manifold', 'resource-1', 'resource-2') }}"
|
ansible.builtin.debug: msg="{{ lookup('manifold', 'resource-1', 'resource-2') }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -55,26 +55,26 @@ DOCUMENTATION = '''
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
# These examples only work when already signed in to 1Password
|
# These examples only work when already signed in to 1Password
|
||||||
- name: Retrieve password for KITT when already signed in to 1Password
|
- name: Retrieve password for KITT when already signed in to 1Password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword', 'KITT')
|
var: lookup('onepassword', 'KITT')
|
||||||
|
|
||||||
- name: Retrieve password for Wintermute when already signed in to 1Password
|
- name: Retrieve password for Wintermute when already signed in to 1Password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword', 'Tessier-Ashpool', section='Wintermute')
|
var: lookup('onepassword', 'Tessier-Ashpool', section='Wintermute')
|
||||||
|
|
||||||
- name: Retrieve username for HAL when already signed in to 1Password
|
- name: Retrieve username for HAL when already signed in to 1Password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword', 'HAL 9000', field='username', vault='Discovery')
|
var: lookup('onepassword', 'HAL 9000', field='username', vault='Discovery')
|
||||||
|
|
||||||
- name: Retrieve password for HAL when not signed in to 1Password
|
- name: Retrieve password for HAL when not signed in to 1Password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword'
|
var: lookup('onepassword'
|
||||||
'HAL 9000'
|
'HAL 9000'
|
||||||
subdomain='Discovery'
|
subdomain='Discovery'
|
||||||
master_password=vault_master_password)
|
master_password=vault_master_password)
|
||||||
|
|
||||||
- name: Retrieve password for HAL when never signed in to 1Password
|
- name: Retrieve password for HAL when never signed in to 1Password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword'
|
var: lookup('onepassword'
|
||||||
'HAL 9000'
|
'HAL 9000'
|
||||||
subdomain='Discovery'
|
subdomain='Discovery'
|
||||||
|
|
|
@ -51,11 +51,11 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: Retrieve all data about Wintermute
|
- name: Retrieve all data about Wintermute
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword_raw', 'Wintermute')
|
var: lookup('onepassword_raw', 'Wintermute')
|
||||||
|
|
||||||
- name: Retrieve all data about Wintermute when not signed in to 1Password
|
- name: Retrieve all data about Wintermute when not signed in to 1Password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lookup('onepassword_raw', 'Wintermute', subdomain='Turing', vault_password='DmbslfLvasjdl')
|
var: lookup('onepassword_raw', 'Wintermute', subdomain='Turing', vault_password='DmbslfLvasjdl')
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -57,28 +57,28 @@ DOCUMENTATION = '''
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
# Debug is used for examples, BAD IDEA to show passwords on screen
|
# Debug is used for examples, BAD IDEA to show passwords on screen
|
||||||
- name: Basic lookup. Fails if example/test doesn't exist
|
- name: Basic lookup. Fails if example/test doesn't exist
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('passwordstore', 'example/test')}}"
|
msg: "{{ lookup('passwordstore', 'example/test')}}"
|
||||||
|
|
||||||
- name: Create pass with random 16 character password. If password exists just give the password
|
- name: Create pass with random 16 character password. If password exists just give the password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: mypassword
|
var: mypassword
|
||||||
vars:
|
vars:
|
||||||
mypassword: "{{ lookup('passwordstore', 'example/test create=true')}}"
|
mypassword: "{{ lookup('passwordstore', 'example/test create=true')}}"
|
||||||
|
|
||||||
- name: Different size password
|
- name: Different size password
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('passwordstore', 'example/test create=true length=42')}}"
|
msg: "{{ lookup('passwordstore', 'example/test create=true length=42')}}"
|
||||||
|
|
||||||
- name: Create password and overwrite the password if it exists. As a bonus, this module includes the old password inside the pass file
|
- name: Create password and overwrite the password if it exists. As a bonus, this module includes the old password inside the pass file
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('passwordstore', 'example/test create=true overwrite=true')}}"
|
msg: "{{ lookup('passwordstore', 'example/test create=true overwrite=true')}}"
|
||||||
|
|
||||||
- name: Create an alphanumeric password
|
- name: Create an alphanumeric password
|
||||||
debug: msg="{{ lookup('passwordstore', 'example/test create=true nosymbols=true') }}"
|
ansible.builtin.debug: msg="{{ lookup('passwordstore', 'example/test create=true nosymbols=true') }}"
|
||||||
|
|
||||||
- name: Return the value for user in the KV pair user, username
|
- name: Return the value for user in the KV pair user, username
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('passwordstore', 'example/test subkey=user')}}"
|
msg: "{{ lookup('passwordstore', 'example/test subkey=user')}}"
|
||||||
|
|
||||||
- name: Return the entire password file content
|
- name: Return the entire password file content
|
||||||
|
|
|
@ -46,17 +46,17 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: query redis for somekey (default or configured settings used)
|
- name: query redis for somekey (default or configured settings used)
|
||||||
debug: msg="{{ lookup('redis', 'somekey') }}"
|
ansible.builtin.debug: msg="{{ lookup('redis', 'somekey') }}"
|
||||||
|
|
||||||
- name: query redis for list of keys and non-default host and port
|
- name: query redis for list of keys and non-default host and port
|
||||||
debug: msg="{{ lookup('redis', item, host='myredis.internal.com', port=2121) }}"
|
ansible.builtin.debug: msg="{{ lookup('redis', item, host='myredis.internal.com', port=2121) }}"
|
||||||
loop: '{{list_of_redis_keys}}'
|
loop: '{{list_of_redis_keys}}'
|
||||||
|
|
||||||
- name: use list directly
|
- name: use list directly
|
||||||
debug: msg="{{ lookup('redis', 'key1', 'key2', 'key3') }}"
|
ansible.builtin.debug: msg="{{ lookup('redis', 'key1', 'key2', 'key3') }}"
|
||||||
|
|
||||||
- name: use list directly with a socket
|
- name: use list directly with a socket
|
||||||
debug: msg="{{ lookup('redis', 'key1', 'key2', socket='/var/tmp/redis.sock') }}"
|
ansible.builtin.debug: msg="{{ lookup('redis', 'key1', 'key2', socket='/var/tmp/redis.sock') }}"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ DOCUMENTATION = '''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
- name: retrieve a string value corresponding to a key inside a Python shelve file
|
- name: retrieve a string value corresponding to a key inside a Python shelve file
|
||||||
debug: msg="{{ lookup('shelvefile', 'file=path_to_some_shelve_file.db key=key_to_retrieve') }}
|
ansible.builtin.debug: msg="{{ lookup('shelvefile', 'file=path_to_some_shelve_file.db key=key_to_retrieve') }}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = """
|
RETURN = """
|
||||||
|
|
|
@ -73,7 +73,7 @@ EXAMPLES = r"""
|
||||||
vars:
|
vars:
|
||||||
secret: "{{ lookup('community.general.tss', 1) }}"
|
secret: "{{ lookup('community.general.tss', 1) }}"
|
||||||
tasks:
|
tasks:
|
||||||
- debug: msg="the password is {{ (secret['items'] | items2dict(key_name='slug', value_name='itemValue'))['password'] }}"
|
- ansible.builtin.debug: msg="the password is {{ (secret['items'] | items2dict(key_name='slug', value_name='itemValue'))['password'] }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ansible.errors import AnsibleError, AnsibleOptionsError
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
||||||
|
|
|
@ -64,8 +64,8 @@ EXAMPLES = '''
|
||||||
state: present
|
state: present
|
||||||
register: policy
|
register: policy
|
||||||
|
|
||||||
- name: debug
|
- name: Debug
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: policy
|
var: policy
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -82,7 +82,7 @@ EXAMPLES = '''
|
||||||
register: policy
|
register: policy
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: policy
|
var: policy
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ EXAMPLES = '''
|
||||||
register: policy
|
register: policy
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug: var=policy
|
ansible.builtin.debug: var=policy
|
||||||
|
|
||||||
---
|
---
|
||||||
- name: Delete Alert Policy Example
|
- name: Delete Alert Policy Example
|
||||||
|
@ -103,7 +103,7 @@ EXAMPLES = '''
|
||||||
register: policy
|
register: policy
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug: var=policy
|
ansible.builtin.debug: var=policy
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -77,7 +77,7 @@ EXAMPLES = '''
|
||||||
register: clc
|
register: clc
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: clc
|
var: clc
|
||||||
|
|
||||||
# Delete a Server Group
|
# Delete a Server Group
|
||||||
|
@ -96,7 +96,7 @@ EXAMPLES = '''
|
||||||
register: clc
|
register: clc
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: clc
|
var: clc
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ EXAMPLES = '''
|
||||||
register: clc
|
register: clc
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: clc
|
var: clc
|
||||||
|
|
||||||
- name: Delete Public IP from Server
|
- name: Delete Public IP from Server
|
||||||
|
@ -90,7 +90,7 @@ EXAMPLES = '''
|
||||||
register: clc
|
register: clc
|
||||||
|
|
||||||
- name: Debug
|
- name: Debug
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: clc
|
var: clc
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ EXAMPLES = '''
|
||||||
project_src: flask
|
project_src: flask
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- name: Run `docker-compose up` again
|
- name: Run `docker-compose up` again
|
||||||
|
@ -186,7 +186,7 @@ EXAMPLES = '''
|
||||||
build: no
|
build: no
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -199,7 +199,7 @@ EXAMPLES = '''
|
||||||
stopped: yes
|
stopped: yes
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -214,7 +214,7 @@ EXAMPLES = '''
|
||||||
restarted: yes
|
restarted: yes
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -232,7 +232,7 @@ EXAMPLES = '''
|
||||||
web: 2
|
web: 2
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- name: Run with inline v2 compose
|
- name: Run with inline v2 compose
|
||||||
|
@ -261,7 +261,7 @@ EXAMPLES = '''
|
||||||
- db
|
- db
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -293,7 +293,7 @@ EXAMPLES = '''
|
||||||
- db
|
- db
|
||||||
register: output
|
register: output
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: output
|
var: output
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -46,11 +46,11 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Does container exist?
|
- name: Does container exist?
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "The container {{ 'exists' if result.exists else 'does not exist' }}"
|
msg: "The container {{ 'exists' if result.exists else 'does not exist' }}"
|
||||||
|
|
||||||
- name: Print information about container
|
- name: Print information about container
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: result.container
|
var: result.container
|
||||||
when: result.exists
|
when: result.exists
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -126,7 +126,7 @@ EXAMPLES = '''
|
||||||
disk_usage: yes
|
disk_usage: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: result.host_info
|
var: result.host_info
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -46,11 +46,11 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Does network exist?
|
- name: Does network exist?
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "The network {{ 'exists' if result.exists else 'does not exist' }}"
|
msg: "The network {{ 'exists' if result.exists else 'does not exist' }}"
|
||||||
|
|
||||||
- name: Print information about network
|
- name: Print information about network
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: result.network
|
var: result.network
|
||||||
when: result.exists
|
when: result.exists
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -94,7 +94,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Inform about basic flags
|
- name: Inform about basic flags
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: |
|
msg: |
|
||||||
Was able to talk to docker daemon: {{ result.can_talk_to_docker }}
|
Was able to talk to docker daemon: {{ result.can_talk_to_docker }}
|
||||||
Docker in Swarm mode: {{ result.docker_swarm_active }}
|
Docker in Swarm mode: {{ result.docker_swarm_active }}
|
||||||
|
@ -120,7 +120,7 @@ EXAMPLES = '''
|
||||||
name: mynode
|
name: mynode
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: result.swarm_facts
|
var: result.swarm_facts
|
||||||
|
|
||||||
- name: Get the swarm unlock key
|
- name: Get the swarm unlock key
|
||||||
|
@ -128,7 +128,7 @@ EXAMPLES = '''
|
||||||
unlock_key: yes
|
unlock_key: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: result.swarm_unlock_key
|
var: result.swarm_unlock_key
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -42,11 +42,11 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Does volume exist?
|
- name: Does volume exist?
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "The volume {{ 'exists' if result.exists else 'does not exist' }}"
|
msg: "The volume {{ 'exists' if result.exists else 'does not exist' }}"
|
||||||
|
|
||||||
- name: Print information about volume
|
- name: Print information about volume
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: result.volume
|
var: result.volume
|
||||||
when: result.exists
|
when: result.exists
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -236,7 +236,7 @@ EXAMPLES = '''
|
||||||
register: gce
|
register: gce
|
||||||
|
|
||||||
- name: Save host data
|
- name: Save host data
|
||||||
add_host:
|
ansible.builtin.add_host:
|
||||||
hostname: "{{ item.public_ip }}"
|
hostname: "{{ item.public_ip }}"
|
||||||
groupname: gce_instances_ips
|
groupname: gce_instances_ips
|
||||||
with_items: "{{ gce.instance_data }}"
|
with_items: "{{ gce.instance_data }}"
|
||||||
|
|
|
@ -93,7 +93,7 @@ EXAMPLES = '''
|
||||||
port: 82
|
port: 82
|
||||||
|
|
||||||
- name: Pause for 30 seconds
|
- name: Pause for 30 seconds
|
||||||
pause:
|
ansible.builtin.pause:
|
||||||
seconds: 30
|
seconds: 30
|
||||||
|
|
||||||
- name: Recreate MIG Instances with Instance Template change.
|
- name: Recreate MIG Instances with Instance Template change.
|
||||||
|
@ -105,7 +105,7 @@ EXAMPLES = '''
|
||||||
recreate_instances: yes
|
recreate_instances: yes
|
||||||
|
|
||||||
- name: Pause for 30 seconds
|
- name: Pause for 30 seconds
|
||||||
pause:
|
ansible.builtin.pause:
|
||||||
seconds: 30
|
seconds: 30
|
||||||
|
|
||||||
- name: Resize MIG
|
- name: Resize MIG
|
||||||
|
@ -136,7 +136,7 @@ EXAMPLES = '''
|
||||||
target: 0.4
|
target: 0.4
|
||||||
|
|
||||||
- name: Pause for 30 seconds
|
- name: Pause for 30 seconds
|
||||||
pause:
|
ansible.builtin.pause:
|
||||||
seconds: 30
|
seconds: 30
|
||||||
|
|
||||||
- name: Delete MIG
|
- name: Delete MIG
|
||||||
|
|
|
@ -238,7 +238,7 @@ EXAMPLES = """
|
||||||
register: lvm_container_info
|
register: lvm_container_info
|
||||||
|
|
||||||
- name: Debug info on container "test-container-lvm"
|
- name: Debug info on container "test-container-lvm"
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: lvm_container_info
|
var: lvm_container_info
|
||||||
|
|
||||||
- name: Run a command in a container and ensure its in a "stopped" state.
|
- name: Run a command in a container and ensure its in a "stopped" state.
|
||||||
|
@ -305,7 +305,7 @@ EXAMPLES = """
|
||||||
register: clone_container_info
|
register: clone_container_info
|
||||||
|
|
||||||
- name: Debug info on container "test-container"
|
- name: Debug info on container "test-container"
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: clone_container_info
|
var: clone_container_info
|
||||||
|
|
||||||
- name: Clone a container using snapshot
|
- name: Clone a container using snapshot
|
||||||
|
|
|
@ -164,14 +164,14 @@ EXAMPLES = '''
|
||||||
|
|
||||||
- name: Check python is installed in container
|
- name: Check python is installed in container
|
||||||
delegate_to: mycontainer
|
delegate_to: mycontainer
|
||||||
raw: dpkg -s python
|
ansible.builtin.raw: dpkg -s python
|
||||||
register: python_install_check
|
register: python_install_check
|
||||||
failed_when: python_install_check.rc not in [0, 1]
|
failed_when: python_install_check.rc not in [0, 1]
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Install python in container
|
- name: Install python in container
|
||||||
delegate_to: mycontainer
|
delegate_to: mycontainer
|
||||||
raw: apt-get install -y python
|
ansible.builtin.raw: apt-get install -y python
|
||||||
when: python_install_check.rc == 1
|
when: python_install_check.rc == 1
|
||||||
|
|
||||||
# An example for creating an Ubuntu 14.04 container using an image fingerprint.
|
# An example for creating an Ubuntu 14.04 container using an image fingerprint.
|
||||||
|
@ -239,7 +239,7 @@ EXAMPLES = '''
|
||||||
- mycontainer
|
- mycontainer
|
||||||
tasks:
|
tasks:
|
||||||
- name: Copy /etc/hosts in the created container to localhost with name "mycontainer-hosts"
|
- name: Copy /etc/hosts in the created container to localhost with name "mycontainer-hosts"
|
||||||
fetch:
|
ansible.builtin.fetch:
|
||||||
src: /etc/hosts
|
src: /etc/hosts
|
||||||
dest: /tmp/mycontainer-hosts
|
dest: /tmp/mycontainer-hosts
|
||||||
flat: true
|
flat: true
|
||||||
|
|
|
@ -29,7 +29,7 @@ EXAMPLES = '''
|
||||||
community.general.cloud_init_data_facts:
|
community.general.cloud_init_data_facts:
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: result
|
var: result
|
||||||
|
|
||||||
- name: Wait for cloud init to finish
|
- name: Wait for cloud init to finish
|
||||||
|
|
|
@ -25,7 +25,7 @@ EXAMPLES = '''
|
||||||
community.general.xenserver_facts:
|
community.general.xenserver_facts:
|
||||||
|
|
||||||
- name: Print running VMs
|
- name: Print running VMs
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ item }}"
|
msg: "{{ item }}"
|
||||||
with_items: "{{ xs_vms.keys() }}"
|
with_items: "{{ xs_vms.keys() }}"
|
||||||
when: xs_vms[item]['power_state'] == "Running"
|
when: xs_vms[item]['power_state'] == "Running"
|
||||||
|
|
|
@ -27,7 +27,7 @@ EXAMPLES = r'''
|
||||||
api_token: '0d1627e8-bbf0-44c5-a46f-5c4d3aef033f'
|
api_token: '0d1627e8-bbf0-44c5-a46f-5c4d3aef033f'
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.online_server_info }}"
|
msg: "{{ result.online_server_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ EXAMPLES = r'''
|
||||||
community.general.online_user_info:
|
community.general.online_user_info:
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.online_user_info }}"
|
msg: "{{ result.online_user_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print the IMAGE properties
|
- name: Print the IMAGE properties
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
- name: Rename existing IMAGE
|
- name: Rename existing IMAGE
|
||||||
|
|
|
@ -70,7 +70,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print all images facts
|
- name: Print all images facts
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
- name: Gather facts about an image using ID
|
- name: Gather facts about an image using ID
|
||||||
|
|
|
@ -110,7 +110,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print service properties
|
- name: Print service properties
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
- name: Instantiate a new service with specified service_name, service group and mode
|
- name: Instantiate a new service with specified service_name, service group and mode
|
||||||
|
|
|
@ -194,7 +194,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print VM properties
|
- name: Print VM properties
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
- name: Deploy a new VM on hold
|
- name: Deploy a new VM on hold
|
||||||
|
|
|
@ -62,7 +62,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
|
|
||||||
- name: >
|
- name: >
|
||||||
|
@ -73,7 +73,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
|
|
||||||
- name: >
|
- name: >
|
||||||
|
@ -84,7 +84,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
|
|
||||||
- name: >
|
- name: >
|
||||||
|
@ -96,7 +96,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_api }}"
|
msg: "{{ result.ovirt_api }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_clusters }}"
|
msg: "{{ result.ovirt_clusters }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_datacenters }}"
|
msg: "{{ result.ovirt_datacenters }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_disks }}"
|
msg: "{{ result.ovirt_disks }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ EXAMPLES = '''
|
||||||
ovirt_event_info:
|
ovirt_event_info:
|
||||||
search: "severity=alert"
|
search: "severity=alert"
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_events }}"
|
msg: "{{ result.ovirt_events }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_external_providers }}"
|
msg: "{{ result.ovirt_external_providers }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_groups }}"
|
msg: "{{ result.ovirt_groups }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_hosts }}"
|
msg: "{{ result.ovirt_hosts }}"
|
||||||
|
|
||||||
- name: Gather information about all hosts with cluster version 4.2
|
- name: Gather information about all hosts with cluster version 4.2
|
||||||
|
@ -64,7 +64,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_hosts }}"
|
msg: "{{ result.ovirt_hosts }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_host_storages }}"
|
msg: "{{ result.ovirt_host_storages }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_networks }}"
|
msg: "{{ result.ovirt_networks }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_nics }}"
|
msg: "{{ result.ovirt_nics }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_permissions }}"
|
msg: "{{ result.ovirt_permissions }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_quotas }}"
|
msg: "{{ result.ovirt_quotas }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_scheduling_policies }}"
|
msg: "{{ result.ovirt_scheduling_policies }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_snapshots }}"
|
msg: "{{ result.ovirt_snapshots }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_storage_domains }}"
|
msg: "{{ result.ovirt_storage_domains }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_storage_templates }}"
|
msg: "{{ result.ovirt_storage_templates }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_storage_vms }}"
|
msg: "{{ result.ovirt_storage_vms }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_tags }}"
|
msg: "{{ result.ovirt_tags }}"
|
||||||
|
|
||||||
- name: Gather information about all tags, which are assigned to VM postgres
|
- name: Gather information about all tags, which are assigned to VM postgres
|
||||||
|
@ -71,7 +71,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_tags }}"
|
msg: "{{ result.ovirt_tags }}"
|
||||||
|
|
||||||
- name: Gather information about all tags, which are assigned to host west
|
- name: Gather information about all tags, which are assigned to host west
|
||||||
|
@ -80,7 +80,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_tags }}"
|
msg: "{{ result.ovirt_tags }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_templates }}"
|
msg: "{{ result.ovirt_templates }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_users }}"
|
msg: "{{ result.ovirt_users }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_vms }}"
|
msg: "{{ result.ovirt_vms }}"
|
||||||
|
|
||||||
- name: Gather info about next run configuration of virtual machine named myvm
|
- name: Gather info about next run configuration of virtual machine named myvm
|
||||||
|
@ -87,7 +87,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_vms[0] }}"
|
msg: "{{ result.ovirt_vms[0] }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print gathered information
|
- name: Print gathered information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.ovirt_vm_pools }}"
|
msg: "{{ result.ovirt_vm_pools }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ EXAMPLES = r'''
|
||||||
region: par1
|
region: par1
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_image_info }}"
|
msg: "{{ result.scaleway_image_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
||||||
region: par1
|
region: par1
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_ip_info }}"
|
msg: "{{ result.scaleway_ip_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ EXAMPLES = r'''
|
||||||
community.general.scaleway_organization_info:
|
community.general.scaleway_organization_info:
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_organization_info }}"
|
msg: "{{ result.scaleway_organization_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
||||||
region: par1
|
region: par1
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_security_group_info }}"
|
msg: "{{ result.scaleway_security_group_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
||||||
region: par1
|
region: par1
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_server_info }}"
|
msg: "{{ result.scaleway_server_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
||||||
region: par1
|
region: par1
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_snapshot_info }}"
|
msg: "{{ result.scaleway_snapshot_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
||||||
region: par1
|
region: par1
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.scaleway_volume_info }}"
|
msg: "{{ result.scaleway_volume_info }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print information
|
- name: Print information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.smartos_images[item]['name'] }}-{{ result.smartos_images[item]['version'] }}
|
msg: "{{ result.smartos_images[item]['name'] }}-{{ result.smartos_images[item]['version'] }}
|
||||||
has {{ result.smartos_images[item]['clones'] }} VM(s)"
|
has {{ result.smartos_images[item]['clones'] }} VM(s)"
|
||||||
with_items: "{{ result.smartos_images.keys() | list }}"
|
with_items: "{{ result.smartos_images.keys() | list }}"
|
||||||
|
@ -50,7 +50,7 @@ EXAMPLES = '''
|
||||||
# in ansible_facts['smartos_images'] and can be used as follows.
|
# in ansible_facts['smartos_images'] and can be used as follows.
|
||||||
# Note that this is deprecated and will stop working in community.general 3.0.0.
|
# Note that this is deprecated and will stop working in community.general 3.0.0.
|
||||||
- name: Print information
|
- name: Print information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ smartos_images[item]['name'] }}-{{ smartos_images[item]['version'] }}
|
msg: "{{ smartos_images[item]['name'] }}-{{ smartos_images[item]['version'] }}
|
||||||
has {{ smartos_images[item]['clones'] }} VM(s)"
|
has {{ smartos_images[item]['clones'] }} VM(s)"
|
||||||
with_items: "{{ smartos_images.keys() | list }}"
|
with_items: "{{ smartos_images.keys() | list }}"
|
||||||
|
|
|
@ -494,7 +494,7 @@ EXAMPLES = '''
|
||||||
- image_id
|
- image_id
|
||||||
- target
|
- target
|
||||||
register: result
|
register: result
|
||||||
- debug: var=result
|
- ansible.builtin.debug: var=result
|
||||||
|
|
||||||
# In this example, we create an elastigroup and wait 600 seconds to retrieve the instances, and use their private ips
|
# In this example, we create an elastigroup and wait 600 seconds to retrieve the instances, and use their private ips
|
||||||
|
|
||||||
|
@ -538,9 +538,9 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Store private ips to file
|
- name: Store private ips to file
|
||||||
shell: echo {{ item.private_ip }}\\n >> list-of-private-ips
|
ansible.builtin.shell: echo {{ item.private_ip }}\\n >> list-of-private-ips
|
||||||
with_items: "{{ result.instances }}"
|
with_items: "{{ result.instances }}"
|
||||||
- debug: var=result
|
- ansible.builtin.debug: var=result
|
||||||
|
|
||||||
# In this example, we create an elastigroup with multiple block device mappings, tags, and also an account id
|
# In this example, we create an elastigroup with multiple block device mappings, tags, and also an account id
|
||||||
# In organizations with more than one account, it is required to specify an account_id
|
# In organizations with more than one account, it is required to specify an account_id
|
||||||
|
@ -589,9 +589,9 @@ EXAMPLES = '''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Store private ips to file
|
- name: Store private ips to file
|
||||||
shell: echo {{ item.private_ip }}\\n >> list-of-private-ips
|
ansible.builtin.shell: echo {{ item.private_ip }}\\n >> list-of-private-ips
|
||||||
with_items: "{{ result.instances }}"
|
with_items: "{{ result.instances }}"
|
||||||
- debug: var=result
|
- ansible.builtin.debug: var=result
|
||||||
|
|
||||||
# In this example we have set up block device mapping with ephemeral devices
|
# In this example we have set up block device mapping with ephemeral devices
|
||||||
|
|
||||||
|
@ -630,7 +630,7 @@ EXAMPLES = '''
|
||||||
- image_id
|
- image_id
|
||||||
- target
|
- target
|
||||||
register: result
|
register: result
|
||||||
- debug: var=result
|
- ansible.builtin.debug: var=result
|
||||||
|
|
||||||
# In this example we create a basic group configuration with a network interface defined.
|
# In this example we create a basic group configuration with a network interface defined.
|
||||||
# Each network interface must have a device index
|
# Each network interface must have a device index
|
||||||
|
@ -668,7 +668,7 @@ EXAMPLES = '''
|
||||||
- image_id
|
- image_id
|
||||||
- target
|
- target
|
||||||
register: result
|
register: result
|
||||||
- debug: var=result
|
- ansible.builtin.debug: var=result
|
||||||
|
|
||||||
|
|
||||||
# In this example we create a basic group configuration with a target tracking scaling policy defined
|
# In this example we create a basic group configuration with a target tracking scaling policy defined
|
||||||
|
@ -713,7 +713,7 @@ EXAMPLES = '''
|
||||||
do_not_update:
|
do_not_update:
|
||||||
- image_id
|
- image_id
|
||||||
register: result
|
register: result
|
||||||
- debug: var=result
|
- ansible.builtin.debug: var=result
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -122,14 +122,14 @@ EXAMPLES = '''
|
||||||
serial: 1
|
serial: 1
|
||||||
tasks:
|
tasks:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- python
|
- python
|
||||||
- python-pip
|
- python-pip
|
||||||
- python-setuptools
|
- python-setuptools
|
||||||
state: latest
|
state: latest
|
||||||
- name: Setup aerospike
|
- name: Setup aerospike
|
||||||
pip:
|
ansible.builtin.pip:
|
||||||
name: aerospike
|
name: aerospike
|
||||||
# check for migrations every (sleep_between_checks)
|
# check for migrations every (sleep_between_checks)
|
||||||
# If at least (consecutive_good_checks) checks come back OK in a row, then return OK.
|
# If at least (consecutive_good_checks) checks come back OK in a row, then return OK.
|
||||||
|
@ -152,10 +152,10 @@ EXAMPLES = '''
|
||||||
delay: 60
|
delay: 60
|
||||||
retries: 120
|
retries: 120
|
||||||
- name: Another thing
|
- name: Another thing
|
||||||
shell: |
|
ansible.builtin.shell: |
|
||||||
echo foo
|
echo foo
|
||||||
- name: Reboot
|
- name: Reboot
|
||||||
reboot:
|
ansible.builtin.reboot:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -49,7 +49,7 @@ EXAMPLES = r'''
|
||||||
register: connection
|
register: connection
|
||||||
|
|
||||||
- name: Print results from the query
|
- name: Print results from the query
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: connection.query_results
|
var: connection.query_results
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ EXAMPLES = r'''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print server information
|
- name: Print server information
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: result.info
|
var: result.info
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ EXAMPLES = '''
|
||||||
|
|
||||||
# Copy database dump file to remote host and restore it to database 'my_db'
|
# Copy database dump file to remote host and restore it to database 'my_db'
|
||||||
- name: Copy database dump file to remote host
|
- name: Copy database dump file to remote host
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: dump.sql
|
src: dump.sql
|
||||||
dest: /tmp
|
dest: /tmp
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ EXAMPLES = r'''
|
||||||
value: 32mb
|
value: 32mb
|
||||||
register: set
|
register: set
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ set.name }} {{ set.prev_val_pretty }} >> {{ set.value_pretty }} restart_req: {{ set.restart_required }}"
|
msg: "{{ set.name }} {{ set.prev_val_pretty }} >> {{ set.value_pretty }} restart_req: {{ set.restart_required }}"
|
||||||
when: set.changed
|
when: set.changed
|
||||||
# Ensure that the restart of PostgreSQL server must be required for some parameters.
|
# Ensure that the restart of PostgreSQL server must be required for some parameters.
|
||||||
|
|
|
@ -54,7 +54,7 @@ EXAMPLES = """
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print schemas
|
- name: Print schemas
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ result.vertica_schemas }}"
|
msg: "{{ result.vertica_schemas }}"
|
||||||
"""
|
"""
|
||||||
import traceback
|
import traceback
|
||||||
|
|
|
@ -82,7 +82,7 @@ EXAMPLES = r'''
|
||||||
register: users
|
register: users
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: 'User {{ users.dict.dag.name }} has UID {{ users.dict.dag.uid }} and GID {{ users.dict.dag.gid }}'
|
msg: 'User {{ users.dict.dag.name }} has UID {{ users.dict.dag.uid }} and GID {{ users.dict.dag.gid }}'
|
||||||
|
|
||||||
# Read a CSV file and access the first item
|
# Read a CSV file and access the first item
|
||||||
|
@ -92,7 +92,7 @@ EXAMPLES = r'''
|
||||||
register: users
|
register: users
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: 'User {{ users.list.1.name }} has UID {{ users.list.1.uid }} and GID {{ users.list.1.gid }}'
|
msg: 'User {{ users.list.1.name }} has UID {{ users.list.1.uid }} and GID {{ users.list.1.gid }}'
|
||||||
|
|
||||||
# Example CSV file without header and semi-colon delimiter
|
# Example CSV file without header and semi-colon delimiter
|
||||||
|
|
|
@ -195,7 +195,7 @@ EXAMPLES = r'''
|
||||||
count: yes
|
count: yes
|
||||||
register: hits
|
register: hits
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
var: hits.count
|
var: hits.count
|
||||||
|
|
||||||
# Example where parent XML nodes are created automatically
|
# Example where parent XML nodes are created automatically
|
||||||
|
@ -251,7 +251,7 @@ EXAMPLES = r'''
|
||||||
register: xmlresp
|
register: xmlresp
|
||||||
|
|
||||||
- name: Show an attribute value
|
- name: Show an attribute value
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: xmlresp.matches[0].validxhtml.validatedon
|
var: xmlresp.matches[0].validxhtml.validatedon
|
||||||
|
|
||||||
- name: Remove all children from the 'website' element (option 1)
|
- name: Remove all children from the 'website' element (option 1)
|
||||||
|
|
|
@ -135,7 +135,7 @@ EXAMPLES = '''
|
||||||
no_log: true # Don't want to log the secrets to the console!
|
no_log: true # Don't want to log the secrets to the console!
|
||||||
|
|
||||||
- name: Debug a password (for example)
|
- name: Debug a password (for example)
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ my_1password_item['onepassword']['My 1Password item'] }}"
|
msg: "{{ my_1password_item['onepassword']['My 1Password item'] }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ EXAMPLES = '''
|
||||||
- Restart sensu-client
|
- Restart sensu-client
|
||||||
|
|
||||||
- name: Secure Sensu client configuration file
|
- name: Secure Sensu client configuration file
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ client['file'] }}"
|
path: "{{ client['file'] }}"
|
||||||
owner: "sensu"
|
owner: "sensu"
|
||||||
group: "sensu"
|
group: "sensu"
|
||||||
|
|
|
@ -119,7 +119,7 @@ EXAMPLES = '''
|
||||||
- Restart sensu-server
|
- Restart sensu-server
|
||||||
|
|
||||||
- name: Secure Sensu handler configuration file
|
- name: Secure Sensu handler configuration file
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ handler['file'] }}"
|
path: "{{ handler['file'] }}"
|
||||||
owner: "sensu"
|
owner: "sensu"
|
||||||
group: "sensu"
|
group: "sensu"
|
||||||
|
|
|
@ -42,7 +42,7 @@ EXAMPLES = r'''
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Print value of failover IP 1.2.3.4 in case it is routed
|
- name: Print value of failover IP 1.2.3.4 in case it is routed
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "1.2.3.4 routes to {{ result.value }}"
|
msg: "1.2.3.4 routes to {{ result.value }}"
|
||||||
when: result.state == 'routed'
|
when: result.state == 'routed'
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -164,7 +164,7 @@ EXAMPLES = r'''
|
||||||
action: discard
|
action: discard
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result }}"
|
msg: "{{ result }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ EXAMPLES = r'''
|
||||||
server_ip: 1.2.3.4
|
server_ip: 1.2.3.4
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- ansible.builtin.debug:
|
||||||
msg: "{{ result.firewall }}"
|
msg: "{{ result.firewall }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ EXAMPLES = '''
|
||||||
community.general.lldp:
|
community.general.lldp:
|
||||||
|
|
||||||
- name: Print each switch/port
|
- name: Print each switch/port
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifname'] }}"
|
msg: "{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifname'] }}"
|
||||||
with_items: "{{ lldp.keys() }}"
|
with_items: "{{ lldp.keys() }}"
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ EXAMPLES = r'''
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: Install needed network manager libs
|
- name: Install needed network manager libs
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- NetworkManager-libnm
|
- NetworkManager-libnm
|
||||||
- nm-connection-editor
|
- nm-connection-editor
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue