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:
Andrew Klychkov 2020-07-14 18:28:08 +03:00 committed by GitHub
commit c055340ecb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
126 changed files with 290 additions and 286 deletions

View file

@ -64,8 +64,8 @@ EXAMPLES = '''
state: present
register: policy
- name: debug
debug:
- name: Debug
ansible.builtin.debug:
var: policy
---
@ -82,7 +82,7 @@ EXAMPLES = '''
register: policy
- name: Debug
debug:
ansible.builtin.debug:
var: policy
'''

View file

@ -87,7 +87,7 @@ EXAMPLES = '''
register: policy
- name: Debug
debug: var=policy
ansible.builtin.debug: var=policy
---
- name: Delete Alert Policy Example
@ -103,7 +103,7 @@ EXAMPLES = '''
register: policy
- name: Debug
debug: var=policy
ansible.builtin.debug: var=policy
'''
RETURN = '''

View file

@ -77,7 +77,7 @@ EXAMPLES = '''
register: clc
- name: Debug
debug:
ansible.builtin.debug:
var: clc
# Delete a Server Group
@ -96,7 +96,7 @@ EXAMPLES = '''
register: clc
- name: Debug
debug:
ansible.builtin.debug:
var: clc
'''

View file

@ -73,7 +73,7 @@ EXAMPLES = '''
register: clc
- name: Debug
debug:
ansible.builtin.debug:
var: clc
- name: Delete Public IP from Server
@ -90,7 +90,7 @@ EXAMPLES = '''
register: clc
- name: Debug
debug:
ansible.builtin.debug:
var: clc
'''

View file

@ -177,7 +177,7 @@ EXAMPLES = '''
project_src: flask
register: output
- debug:
- ansible.builtin.debug:
var: output
- name: Run `docker-compose up` again
@ -186,7 +186,7 @@ EXAMPLES = '''
build: no
register: output
- debug:
- ansible.builtin.debug:
var: output
- assert:
@ -199,7 +199,7 @@ EXAMPLES = '''
stopped: yes
register: output
- debug:
- ansible.builtin.debug:
var: output
- assert:
@ -214,7 +214,7 @@ EXAMPLES = '''
restarted: yes
register: output
- debug:
- ansible.builtin.debug:
var: output
- assert:
@ -232,7 +232,7 @@ EXAMPLES = '''
web: 2
register: output
- debug:
- ansible.builtin.debug:
var: output
- name: Run with inline v2 compose
@ -261,7 +261,7 @@ EXAMPLES = '''
- db
register: output
- debug:
- ansible.builtin.debug:
var: output
- assert:
@ -293,7 +293,7 @@ EXAMPLES = '''
- db
register: output
- debug:
- ansible.builtin.debug:
var: output
- assert:

View file

@ -46,11 +46,11 @@ EXAMPLES = '''
register: result
- name: Does container exist?
debug:
ansible.builtin.debug:
msg: "The container {{ 'exists' if result.exists else 'does not exist' }}"
- name: Print information about container
debug:
ansible.builtin.debug:
var: result.container
when: result.exists
'''

View file

@ -126,7 +126,7 @@ EXAMPLES = '''
disk_usage: yes
register: result
- debug:
- ansible.builtin.debug:
var: result.host_info
'''

View file

@ -46,11 +46,11 @@ EXAMPLES = '''
register: result
- name: Does network exist?
debug:
ansible.builtin.debug:
msg: "The network {{ 'exists' if result.exists else 'does not exist' }}"
- name: Print information about network
debug:
ansible.builtin.debug:
var: result.network
when: result.exists
'''

View file

@ -94,7 +94,7 @@ EXAMPLES = '''
register: result
- name: Inform about basic flags
debug:
ansible.builtin.debug:
msg: |
Was able to talk to docker daemon: {{ result.can_talk_to_docker }}
Docker in Swarm mode: {{ result.docker_swarm_active }}
@ -120,7 +120,7 @@ EXAMPLES = '''
name: mynode
register: result
- debug:
- ansible.builtin.debug:
var: result.swarm_facts
- name: Get the swarm unlock key
@ -128,7 +128,7 @@ EXAMPLES = '''
unlock_key: yes
register: result
- debug:
- ansible.builtin.debug:
var: result.swarm_unlock_key
'''

View file

@ -42,11 +42,11 @@ EXAMPLES = '''
register: result
- name: Does volume exist?
debug:
ansible.builtin.debug:
msg: "The volume {{ 'exists' if result.exists else 'does not exist' }}"
- name: Print information about volume
debug:
ansible.builtin.debug:
var: result.volume
when: result.exists
'''

View file

@ -236,7 +236,7 @@ EXAMPLES = '''
register: gce
- name: Save host data
add_host:
ansible.builtin.add_host:
hostname: "{{ item.public_ip }}"
groupname: gce_instances_ips
with_items: "{{ gce.instance_data }}"

View file

@ -93,7 +93,7 @@ EXAMPLES = '''
port: 82
- name: Pause for 30 seconds
pause:
ansible.builtin.pause:
seconds: 30
- name: Recreate MIG Instances with Instance Template change.
@ -105,7 +105,7 @@ EXAMPLES = '''
recreate_instances: yes
- name: Pause for 30 seconds
pause:
ansible.builtin.pause:
seconds: 30
- name: Resize MIG
@ -136,7 +136,7 @@ EXAMPLES = '''
target: 0.4
- name: Pause for 30 seconds
pause:
ansible.builtin.pause:
seconds: 30
- name: Delete MIG

View file

@ -238,7 +238,7 @@ EXAMPLES = """
register: lvm_container_info
- name: Debug info on container "test-container-lvm"
debug:
ansible.builtin.debug:
var: lvm_container_info
- name: Run a command in a container and ensure its in a "stopped" state.
@ -305,7 +305,7 @@ EXAMPLES = """
register: clone_container_info
- name: Debug info on container "test-container"
debug:
ansible.builtin.debug:
var: clone_container_info
- name: Clone a container using snapshot

View file

@ -164,14 +164,14 @@ EXAMPLES = '''
- name: Check python is installed in container
delegate_to: mycontainer
raw: dpkg -s python
ansible.builtin.raw: dpkg -s python
register: python_install_check
failed_when: python_install_check.rc not in [0, 1]
changed_when: false
- name: Install python in container
delegate_to: mycontainer
raw: apt-get install -y python
ansible.builtin.raw: apt-get install -y python
when: python_install_check.rc == 1
# An example for creating an Ubuntu 14.04 container using an image fingerprint.
@ -239,7 +239,7 @@ EXAMPLES = '''
- mycontainer
tasks:
- name: Copy /etc/hosts in the created container to localhost with name "mycontainer-hosts"
fetch:
ansible.builtin.fetch:
src: /etc/hosts
dest: /tmp/mycontainer-hosts
flat: true

View file

@ -29,7 +29,7 @@ EXAMPLES = '''
community.general.cloud_init_data_facts:
register: result
- debug:
- ansible.builtin.debug:
var: result
- name: Wait for cloud init to finish

View file

@ -25,7 +25,7 @@ EXAMPLES = '''
community.general.xenserver_facts:
- name: Print running VMs
debug:
ansible.builtin.debug:
msg: "{{ item }}"
with_items: "{{ xs_vms.keys() }}"
when: xs_vms[item]['power_state'] == "Running"

View file

@ -27,7 +27,7 @@ EXAMPLES = r'''
api_token: '0d1627e8-bbf0-44c5-a46f-5c4d3aef033f'
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.online_server_info }}"
'''

View file

@ -24,7 +24,7 @@ EXAMPLES = r'''
community.general.online_user_info:
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.online_user_info }}"
'''

View file

@ -80,7 +80,7 @@ EXAMPLES = '''
register: result
- name: Print the IMAGE properties
debug:
ansible.builtin.debug:
msg: result
- name: Rename existing IMAGE

View file

@ -70,7 +70,7 @@ EXAMPLES = '''
register: result
- name: Print all images facts
debug:
ansible.builtin.debug:
msg: result
- name: Gather facts about an image using ID

View file

@ -110,7 +110,7 @@ EXAMPLES = '''
register: result
- name: Print service properties
debug:
ansible.builtin.debug:
msg: result
- name: Instantiate a new service with specified service_name, service group and mode

View file

@ -194,7 +194,7 @@ EXAMPLES = '''
register: result
- name: Print VM properties
debug:
ansible.builtin.debug:
msg: result
- name: Deploy a new VM on hold

View file

@ -62,7 +62,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_affinity_labels }}"
- name: >
@ -73,7 +73,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_affinity_labels }}"
- name: >
@ -84,7 +84,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_affinity_labels }}"
- name: >
@ -96,7 +96,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_affinity_labels }}"
'''

View file

@ -36,7 +36,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_api }}"
'''

View file

@ -59,7 +59,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_clusters }}"
'''

View file

@ -42,7 +42,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_datacenters }}"
'''

View file

@ -58,7 +58,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_disks }}"
'''

View file

@ -88,7 +88,7 @@ EXAMPLES = '''
ovirt_event_info:
search: "severity=alert"
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.ovirt_events }}"
'''

View file

@ -62,7 +62,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_external_providers }}"
'''

View file

@ -57,7 +57,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_groups }}"
'''

View file

@ -54,7 +54,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_hosts }}"
- name: Gather information about all hosts with cluster version 4.2
@ -64,7 +64,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_hosts }}"
'''

View file

@ -73,7 +73,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_host_storages }}"
'''

View file

@ -58,7 +58,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_networks }}"
'''

View file

@ -61,7 +61,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_nics }}"
'''

View file

@ -69,7 +69,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_permissions }}"
'''

View file

@ -61,7 +61,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_quotas }}"
'''

View file

@ -60,7 +60,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_scheduling_policies }}"
'''

View file

@ -49,7 +49,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_snapshots }}"
'''

View file

@ -60,7 +60,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_storage_domains }}"
'''

View file

@ -65,7 +65,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_storage_templates }}"
'''

View file

@ -65,7 +65,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_storage_vms }}"
'''

View file

@ -62,7 +62,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_tags }}"
- name: Gather information about all tags, which are assigned to VM postgres
@ -71,7 +71,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_tags }}"
- name: Gather information about all tags, which are assigned to host west
@ -80,7 +80,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_tags }}"
'''

View file

@ -58,7 +58,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_templates }}"
'''

View file

@ -57,7 +57,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_users }}"
'''

View file

@ -77,7 +77,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_vms }}"
- name: Gather info about next run configuration of virtual machine named myvm
@ -87,7 +87,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_vms[0] }}"
'''

View file

@ -57,7 +57,7 @@ EXAMPLES = '''
register: result
- name: Print gathered information
debug:
ansible.builtin.debug:
msg: "{{ result.ovirt_vm_pools }}"
'''

View file

@ -39,7 +39,7 @@ EXAMPLES = r'''
region: par1
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_image_info }}"
'''

View file

@ -37,7 +37,7 @@ EXAMPLES = r'''
region: par1
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_ip_info }}"
'''

View file

@ -32,7 +32,7 @@ EXAMPLES = r'''
community.general.scaleway_organization_info:
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_organization_info }}"
'''

View file

@ -37,7 +37,7 @@ EXAMPLES = r'''
region: par1
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_security_group_info }}"
'''

View file

@ -37,7 +37,7 @@ EXAMPLES = r'''
region: par1
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_server_info }}"
'''

View file

@ -37,7 +37,7 @@ EXAMPLES = r'''
region: par1
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_snapshot_info }}"
'''

View file

@ -37,7 +37,7 @@ EXAMPLES = r'''
region: par1
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result.scaleway_volume_info }}"
'''

View file

@ -41,7 +41,7 @@ EXAMPLES = '''
register: result
- name: Print information
debug:
ansible.builtin.debug:
msg: "{{ result.smartos_images[item]['name'] }}-{{ result.smartos_images[item]['version'] }}
has {{ result.smartos_images[item]['clones'] }} VM(s)"
with_items: "{{ result.smartos_images.keys() | list }}"
@ -50,7 +50,7 @@ EXAMPLES = '''
# 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.
- name: Print information
debug:
ansible.builtin.debug:
msg: "{{ smartos_images[item]['name'] }}-{{ smartos_images[item]['version'] }}
has {{ smartos_images[item]['clones'] }} VM(s)"
with_items: "{{ smartos_images.keys() | list }}"

View file

@ -494,7 +494,7 @@ EXAMPLES = '''
- image_id
- target
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
@ -538,9 +538,9 @@ EXAMPLES = '''
register: result
- 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 }}"
- 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 organizations with more than one account, it is required to specify an account_id
@ -589,9 +589,9 @@ EXAMPLES = '''
register: result
- 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 }}"
- debug: var=result
- ansible.builtin.debug: var=result
# In this example we have set up block device mapping with ephemeral devices
@ -630,7 +630,7 @@ EXAMPLES = '''
- image_id
- target
register: result
- debug: var=result
- ansible.builtin.debug: var=result
# In this example we create a basic group configuration with a network interface defined.
# Each network interface must have a device index
@ -668,7 +668,7 @@ EXAMPLES = '''
- image_id
- target
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
@ -713,7 +713,7 @@ EXAMPLES = '''
do_not_update:
- image_id
register: result
- debug: var=result
- ansible.builtin.debug: var=result
'''
RETURN = '''