modules: fix examples to use FQCN for builtin plugins (#661)

This commit is contained in:
Andrew Klychkov 2020-07-16 14:42:12 +03:00 committed by GitHub
commit 4c4a6ab27c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 36 additions and 36 deletions

View file

@ -210,7 +210,7 @@ EXAMPLES = """
# return_format (or its alias 'as') can control how secrets are returned to you
- name: return secrets as a dict (default)
set_fact:
ansible.builtin.set_fact:
my_secrets: "{{ lookup('community.general.hashi_vault', 'secret/data/manysecrets', token=my_token_var, url='http://myvault_url:8200') }}"
- ansible.builtin.debug:
msg: "{{ my_secrets['secret_key'] }}"
@ -224,7 +224,7 @@ EXAMPLES = """
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
set_fact:
ansible.builtin.set_fact:
my_secret: "{{ lookup('community.general.hashi_vault', 'secret/data/hello:value', token=my_token_var, url='http://myvault_url:8200', as='raw') }}"
- ansible.builtin.debug:
msg: "This is version {{ my_secret['metadata']['version'] }} of hello:value. The secret data is {{ my_secret['data']['data']['value'] }}"

View file

@ -36,7 +36,7 @@ EXAMPLES = """
- "n*"
- name: get an item by key
assert:
ansible.builtin.assert:
that:
- item == 'Belgium'
vars:

View file

@ -47,11 +47,11 @@ options:
EXAMPLES = """
- name: fetch all networkview objects
set_fact:
ansible.builtin.set_fact:
networkviews: "{{ lookup('nios', 'networkview', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: fetch the default dns view
set_fact:
ansible.builtin.set_fact:
dns_views: "{{ lookup('nios', 'view', filter={'name': 'default'}, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
# all of the examples below use credentials that are set using env variables
@ -60,20 +60,20 @@ EXAMPLES = """
# export INFOBLOX_PASSWORD=admin
- name: fetch all host records and include extended attributes
set_fact:
ansible.builtin.set_fact:
host_records: "{{ lookup('nios', 'record:host', return_fields=['extattrs', 'name', 'view', 'comment']}) }}"
- name: use env variables to pass credentials
set_fact:
ansible.builtin.set_fact:
networkviews: "{{ lookup('nios', 'networkview') }}"
- name: get a host record
set_fact:
ansible.builtin.set_fact:
host: "{{ lookup('nios', 'record:host', filter={'name': 'hostname.ansible.com'}) }}"
- name: get the authoritative zone from a non default dns view
set_fact:
ansible.builtin.set_fact:
host: "{{ lookup('nios', 'zone_auth', filter={'fqdn': 'ansible.com', 'view': 'ansible-dns'}) }}"
"""

View file

@ -47,15 +47,15 @@ options:
EXAMPLES = """
- name: return next available IP address for network 192.168.10.0/24
set_fact:
ansible.builtin.set_fact:
ipaddr: "{{ lookup('nios_next_ip', '192.168.10.0/24', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 3 available IP addresses for network 192.168.10.0/24
set_fact:
ansible.builtin.set_fact:
ipaddr: "{{ lookup('nios_next_ip', '192.168.10.0/24', num=3, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 3 available IP addresses for network 192.168.10.0/24 excluding ip addresses - ['192.168.10.1', '192.168.10.2']
set_fact:
ansible.builtin.set_fact:
ipaddr: "{{ lookup('nios_next_ip', '192.168.10.0/24', num=3, exclude=['192.168.10.1', '192.168.10.2'],
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
"""

View file

@ -55,16 +55,16 @@ options:
EXAMPLES = """
- name: return next available network for network-container 192.168.10.0/24
set_fact:
ansible.builtin.set_fact:
networkaddr: "{{ lookup('nios_next_network', '192.168.10.0/24', cidr=25, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the next 2 available network addresses for network-container 192.168.10.0/24
set_fact:
ansible.builtin.set_fact:
networkaddr: "{{ lookup('nios_next_network', '192.168.10.0/24', cidr=25, num=2,
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
- name: return the available network addresses for network-container 192.168.10.0/24 excluding network range '192.168.10.0/25'
set_fact:
ansible.builtin.set_fact:
networkaddr: "{{ lookup('nios_next_network', '192.168.10.0/24', cidr=25, exclude=['192.168.10.0/25'],
provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"
"""

View file

@ -82,7 +82,7 @@ EXAMPLES = """
msg: "{{ lookup('passwordstore', 'example/test subkey=user')}}"
- name: Return the entire password file content
set_fact:
ansible.builtin.set_fact:
passfilecontent: "{{ lookup('passwordstore', 'example/test returnall=true')}}"
"""