mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-11 23:50:50 -07: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
|
@ -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
|
||||
'''
|
||||
|
||||
|
|
|
@ -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 = '''
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -126,7 +126,7 @@ EXAMPLES = '''
|
|||
disk_usage: yes
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
var: result.host_info
|
||||
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -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 }}"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -27,7 +27,7 @@ EXAMPLES = r'''
|
|||
api_token: '0d1627e8-bbf0-44c5-a46f-5c4d3aef033f'
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.online_server_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ EXAMPLES = r'''
|
|||
community.general.online_user_info:
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.online_user_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print the IMAGE properties
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: result
|
||||
|
||||
- name: Rename existing IMAGE
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -194,7 +194,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print VM properties
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: result
|
||||
|
||||
- name: Deploy a new VM on hold
|
||||
|
|
|
@ -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 }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_api }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_clusters }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_datacenters }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_disks }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ EXAMPLES = '''
|
|||
ovirt_event_info:
|
||||
search: "severity=alert"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_events }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_external_providers }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_groups }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -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 }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_host_storages }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_networks }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_nics }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_permissions }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_quotas }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_scheduling_policies }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_snapshots }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_storage_domains }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_storage_templates }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_storage_vms }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -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 }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_templates }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_users }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -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] }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.ovirt_vm_pools }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ EXAMPLES = r'''
|
|||
region: par1
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_image_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
|||
region: par1
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_ip_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ EXAMPLES = r'''
|
|||
community.general.scaleway_organization_info:
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_organization_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
|||
region: par1
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_security_group_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
|||
region: par1
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_server_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
|||
region: par1
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_snapshot_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = r'''
|
|||
region: par1
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.scaleway_volume_info }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -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 }}"
|
||||
|
|
|
@ -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 = '''
|
||||
|
|
|
@ -122,14 +122,14 @@ EXAMPLES = '''
|
|||
serial: 1
|
||||
tasks:
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- python
|
||||
- python-pip
|
||||
- python-setuptools
|
||||
state: latest
|
||||
- name: Setup aerospike
|
||||
pip:
|
||||
ansible.builtin.pip:
|
||||
name: aerospike
|
||||
# check for migrations every (sleep_between_checks)
|
||||
# If at least (consecutive_good_checks) checks come back OK in a row, then return OK.
|
||||
|
@ -152,10 +152,10 @@ EXAMPLES = '''
|
|||
delay: 60
|
||||
retries: 120
|
||||
- name: Another thing
|
||||
shell: |
|
||||
ansible.builtin.shell: |
|
||||
echo foo
|
||||
- name: Reboot
|
||||
reboot:
|
||||
ansible.builtin.reboot:
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -49,7 +49,7 @@ EXAMPLES = r'''
|
|||
register: connection
|
||||
|
||||
- name: Print results from the query
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: connection.query_results
|
||||
'''
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ EXAMPLES = r'''
|
|||
register: result
|
||||
|
||||
- name: Print server information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: result.info
|
||||
'''
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ EXAMPLES = '''
|
|||
|
||||
# Copy database dump file to remote host and restore it to database 'my_db'
|
||||
- name: Copy database dump file to remote host
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
src: dump.sql
|
||||
dest: /tmp
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ EXAMPLES = r'''
|
|||
value: 32mb
|
||||
register: set
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ set.name }} {{ set.prev_val_pretty }} >> {{ set.value_pretty }} restart_req: {{ set.restart_required }}"
|
||||
when: set.changed
|
||||
# Ensure that the restart of PostgreSQL server must be required for some parameters.
|
||||
|
|
|
@ -54,7 +54,7 @@ EXAMPLES = """
|
|||
register: result
|
||||
|
||||
- name: Print schemas
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ result.vertica_schemas }}"
|
||||
"""
|
||||
import traceback
|
||||
|
|
|
@ -82,7 +82,7 @@ EXAMPLES = r'''
|
|||
register: users
|
||||
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 }}'
|
||||
|
||||
# Read a CSV file and access the first item
|
||||
|
@ -92,7 +92,7 @@ EXAMPLES = r'''
|
|||
register: users
|
||||
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 }}'
|
||||
|
||||
# Example CSV file without header and semi-colon delimiter
|
||||
|
|
|
@ -195,7 +195,7 @@ EXAMPLES = r'''
|
|||
count: yes
|
||||
register: hits
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
var: hits.count
|
||||
|
||||
# Example where parent XML nodes are created automatically
|
||||
|
@ -251,7 +251,7 @@ EXAMPLES = r'''
|
|||
register: xmlresp
|
||||
|
||||
- name: Show an attribute value
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: xmlresp.matches[0].validxhtml.validatedon
|
||||
|
||||
- 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!
|
||||
|
||||
- name: Debug a password (for example)
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ my_1password_item['onepassword']['My 1Password item'] }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ EXAMPLES = '''
|
|||
- Restart sensu-client
|
||||
|
||||
- name: Secure Sensu client configuration file
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ client['file'] }}"
|
||||
owner: "sensu"
|
||||
group: "sensu"
|
||||
|
|
|
@ -119,7 +119,7 @@ EXAMPLES = '''
|
|||
- Restart sensu-server
|
||||
|
||||
- name: Secure Sensu handler configuration file
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ handler['file'] }}"
|
||||
owner: "sensu"
|
||||
group: "sensu"
|
||||
|
|
|
@ -42,7 +42,7 @@ EXAMPLES = r'''
|
|||
register: result
|
||||
|
||||
- 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 }}"
|
||||
when: result.state == 'routed'
|
||||
'''
|
||||
|
|
|
@ -164,7 +164,7 @@ EXAMPLES = r'''
|
|||
action: discard
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ EXAMPLES = r'''
|
|||
server_ip: 1.2.3.4
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.firewall }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ EXAMPLES = '''
|
|||
community.general.lldp:
|
||||
|
||||
- name: Print each switch/port
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifname'] }}"
|
||||
with_items: "{{ lldp.keys() }}"
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ EXAMPLES = r'''
|
|||
tasks:
|
||||
|
||||
- name: Install needed network manager libs
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- NetworkManager-libnm
|
||||
- nm-connection-editor
|
||||
|
|
|
@ -55,7 +55,7 @@ EXAMPLES = r'''
|
|||
delegate_to: localhost
|
||||
register: results
|
||||
|
||||
- fail:
|
||||
- ansible.builtin.fail:
|
||||
msg: 'CMDB serial ({{ cmdb_serialno }}) does not match hardware serial ({{ results.hw_system_serial }}) !'
|
||||
when: cmdb_serialno != results.hw_system_serial
|
||||
'''
|
||||
|
|
|
@ -42,7 +42,7 @@ notes:
|
|||
|
||||
EXAMPLES = r'''
|
||||
- name: Example hponcfg configuration XML
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
<ribcl VERSION="2.0">
|
||||
<login USER_LOGIN="user" PASSWORD="password">
|
||||
|
|
|
@ -43,7 +43,7 @@ EXAMPLES = '''
|
|||
api_version: 500
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Data Centers
|
||||
|
@ -58,7 +58,7 @@ EXAMPLES = '''
|
|||
sort: 'name:descending'
|
||||
filter: 'state=Unmanaged'
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
|
||||
- name: Gather information about a Data Center by name
|
||||
|
@ -70,7 +70,7 @@ EXAMPLES = '''
|
|||
name: "My Data Center"
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
|
||||
- name: Gather information about the Data Center Visual Content
|
||||
|
@ -84,9 +84,9 @@ EXAMPLES = '''
|
|||
- visualContent
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.datacenters }}"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.datacenter_visual_content }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ EXAMPLES = '''
|
|||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Enclosures
|
||||
|
@ -63,7 +63,7 @@ EXAMPLES = '''
|
|||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
|
||||
- name: Gather information about an Enclosure by name
|
||||
|
@ -76,7 +76,7 @@ EXAMPLES = '''
|
|||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
|
||||
- name: Gather information about an Enclosure by name with options
|
||||
|
@ -93,13 +93,13 @@ EXAMPLES = '''
|
|||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_script }}"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_environmental_configuration }}"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_utilization }}"
|
||||
|
||||
- name: "Gather information about an Enclosure with temperature data at a resolution of one sample per day, between two
|
||||
|
@ -121,9 +121,9 @@ EXAMPLES = '''
|
|||
no_log: true
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosures }}"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enclosure_utilization }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.ethernet_networks }}"
|
||||
|
||||
- name: Gather paginated and filtered information about Ethernet Networks
|
||||
|
@ -54,7 +54,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.ethernet_networks }}"
|
||||
|
||||
- name: Gather information about an Ethernet Network by name
|
||||
|
@ -64,7 +64,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.ethernet_networks }}"
|
||||
|
||||
- name: Gather information about an Ethernet Network by name with options
|
||||
|
@ -77,9 +77,9 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enet_associated_profiles }}"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.enet_associated_uplink_groups }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.fc_networks }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Fibre Channel Networks
|
||||
|
@ -50,7 +50,7 @@ EXAMPLES = '''
|
|||
filter: 'fabricType=FabricAttach'
|
||||
delegate_to: localhost
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.fc_networks }}"
|
||||
|
||||
- name: Gather information about a Fibre Channel Network by name
|
||||
|
@ -60,7 +60,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.fc_networks }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.fcoe_networks }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about FCoE Networks
|
||||
|
@ -50,7 +50,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.fcoe_networks }}"
|
||||
|
||||
- name: Gather information about a FCoE Network by name
|
||||
|
@ -60,7 +60,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.fcoe_networks }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.logical_interconnect_groups }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about Logical Interconnect Groups
|
||||
|
@ -59,7 +59,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.logical_interconnect_groups }}"
|
||||
|
||||
- name: Gather information about a Logical Interconnect Group by name
|
||||
|
@ -73,7 +73,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.logical_interconnect_groups }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather paginated, filtered, and sorted information about Network Sets
|
||||
|
@ -65,7 +65,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather information about all Network Sets, excluding Ethernet networks
|
||||
|
@ -80,7 +80,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather information about a Network Set by name
|
||||
|
@ -94,7 +94,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
|
||||
- name: Gather information about a Network Set by name, excluding Ethernet networks
|
||||
|
@ -110,7 +110,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.network_sets }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.san_managers }}"
|
||||
|
||||
- name: Gather paginated, filtered and sorted information about SAN Managers
|
||||
|
@ -57,7 +57,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.san_managers }}"
|
||||
|
||||
- name: Gather information about a SAN Manager by provider display name
|
||||
|
@ -67,7 +67,7 @@ EXAMPLES = '''
|
|||
delegate_to: localhost
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.san_managers }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -71,11 +71,11 @@ EXAMPLES = '''
|
|||
idrac_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'iDRACAttributes') | list | first }}"
|
||||
|
||||
- name: Display all iDRAC attributes
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: idrac_attributes
|
||||
|
||||
- name: Display the value of 'Syslog.1.SysLogEnable' iDRAC attribute
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: idrac_attributes['Syslog.1.SysLogEnable']
|
||||
|
||||
# Examples to display the value of all or a single LifecycleController attribute
|
||||
|
@ -84,11 +84,11 @@ EXAMPLES = '''
|
|||
lc_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'LCAttributes') | list | first }}"
|
||||
|
||||
- name: Display LifecycleController attributes
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: lc_attributes
|
||||
|
||||
- name: Display the value of 'CollectSystemInventoryOnRestart' attribute
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: lc_attributes['LCAttributes.1.CollectSystemInventoryOnRestart']
|
||||
|
||||
# Examples to display the value of all or a single System attribute
|
||||
|
@ -97,11 +97,11 @@ EXAMPLES = '''
|
|||
system_attributes: "{{ result.redfish_facts.entries | selectattr('Id', 'defined') | selectattr('Id', 'equalto', 'SystemAttributes') | list | first }}"
|
||||
|
||||
- name: Display System attributes
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: system_attributes
|
||||
|
||||
- name: Display the value of 'PSRedPolicy'
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: system_attributes['ServerPwr.1.PSRedPolicy']
|
||||
|
||||
'''
|
||||
|
|
|
@ -62,7 +62,7 @@ EXAMPLES = '''
|
|||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.cpu.entries | to_nice_json }}"
|
||||
|
||||
- name: Get CPU model
|
||||
|
@ -73,7 +73,7 @@ EXAMPLES = '''
|
|||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.cpu.entries.0.Model }}"
|
||||
|
||||
- name: Get memory inventory
|
||||
|
@ -103,7 +103,7 @@ EXAMPLES = '''
|
|||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.virtual_media.entries | to_nice_json }}"
|
||||
|
||||
- name: Get Volume Inventory
|
||||
|
@ -114,7 +114,7 @@ EXAMPLES = '''
|
|||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.volume.entries | to_nice_json }}"
|
||||
|
||||
- name: Get Session information
|
||||
|
@ -125,7 +125,7 @@ EXAMPLES = '''
|
|||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts.session.entries | to_nice_json }}"
|
||||
|
||||
- name: Get default inventory information
|
||||
|
@ -134,7 +134,7 @@ EXAMPLES = '''
|
|||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
register: result
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: "{{ result.redfish_facts | to_nice_json }}"
|
||||
|
||||
- name: Get several inventories
|
||||
|
|
|
@ -54,7 +54,7 @@ EXAMPLES = '''
|
|||
register: r
|
||||
|
||||
- name: Take action depending upon issue status
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: Do something when issue 23642 is open
|
||||
when: r.issue_status == 'open'
|
||||
'''
|
||||
|
|
|
@ -60,7 +60,7 @@ key:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: Read SSH public key to authorize
|
||||
shell: cat /home/foo/.ssh/id_rsa.pub
|
||||
ansible.builtin.shell: cat /home/foo/.ssh/id_rsa.pub
|
||||
register: ssh_pub_key
|
||||
|
||||
- name: Authorize key with GitHub
|
||||
|
|
|
@ -39,7 +39,7 @@ EXAMPLES = '''
|
|||
name: test_volume
|
||||
status_filter: self-heal
|
||||
register: self_heal_status
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
var: self_heal_status
|
||||
|
||||
- name: Gather rebalance facts about all gluster hosts in the cluster
|
||||
|
@ -47,7 +47,7 @@ EXAMPLES = '''
|
|||
name: test_volume
|
||||
status_filter: rebalance
|
||||
register: rebalance_status
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
var: rebalance_status
|
||||
'''
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ EXAMPLES = '''
|
|||
hostname: "na-vsim"
|
||||
username: "admin"
|
||||
password: "admins_password"
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
var: ontap_facts
|
||||
- name: Limit Fact Gathering to Aggregate Information
|
||||
community.general.na_ontap_gather_facts:
|
||||
|
|
|
@ -61,7 +61,7 @@ EXAMPLES = '''
|
|||
recurse: yes
|
||||
type: filesystem
|
||||
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
msg: 'ZFS dataset {{ item.name }} consumes {{ item.used }} of disk space.'
|
||||
with_items: '{{ ansible_zfs_datasets }}'
|
||||
'''
|
||||
|
|
|
@ -45,7 +45,7 @@ EXAMPLES = '''
|
|||
community.general.zpool_facts: properties='free,size'
|
||||
|
||||
- name: Print gathered information
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: 'ZFS pool {{ item.name }} has {{ item.free }} free space out of {{ item.size }}.'
|
||||
with_items: '{{ ansible_zfs_pools }}'
|
||||
'''
|
||||
|
|
|
@ -25,7 +25,7 @@ EXAMPLES = r'''
|
|||
community.general.listen_ports_facts:
|
||||
|
||||
- name: TCP whitelist violation
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: TCP port {{ item.port }} by pid {{ item.pid }} violates the whitelist
|
||||
vars:
|
||||
tcp_listen_violations: "{{ ansible_facts.tcp_listen | selectattr('port', 'in', tcp_whitelist) | list }}"
|
||||
|
@ -35,15 +35,15 @@ EXAMPLES = r'''
|
|||
loop: "{{ tcp_listen_violations }}"
|
||||
|
||||
- name: List TCP ports
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ ansible_facts.tcp_listen | map(attribute='port') | sort | list }}"
|
||||
|
||||
- name: List UDP ports
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ ansible_facts.udp_listen | map(attribute='port') | sort | list }}"
|
||||
|
||||
- name: List all ports
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ (ansible_facts.tcp_listen + ansible_facts.udp_listen) | map(attribute='port') | unique | sort | list }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -92,11 +92,11 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Fail if service not loaded
|
||||
fail: msg="The {{ result.name }} service is not loaded"
|
||||
ansible.builtin.fail: msg="The {{ result.name }} service is not loaded"
|
||||
when: not result.status
|
||||
|
||||
- name: Fail if service is running
|
||||
fail: msg="The {{ result.name }} service is running"
|
||||
ansible.builtin.fail: msg="The {{ result.name }} service is running"
|
||||
when: result.status and result.status['DaemontoolsEncoreState'] == "running"
|
||||
'''
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ EXAMPLES = '''
|
|||
register: pids_of_python
|
||||
|
||||
- name: Printing the process IDs obtained
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "PIDS of python:{{pids_of_python.pids|join(',')}}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ EXAMPLES = r'''
|
|||
state: present
|
||||
|
||||
- name: Apply new SELinux file context to filesystem
|
||||
command: restorecon -irv /srv/git_repos
|
||||
ansible.builtin.command: restorecon -irv /srv/git_repos
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
|
|
|
@ -53,7 +53,7 @@ EXAMPLES = '''
|
|||
register: syspatch
|
||||
|
||||
- name: Reboot if patch requires it
|
||||
reboot:
|
||||
ansible.builtin.reboot:
|
||||
when: syspatch.reboot_needed
|
||||
'''
|
||||
|
||||
|
|
|
@ -148,12 +148,12 @@ EXAMPLES = '''
|
|||
community.general.deploy_helper:
|
||||
path: /path/to/root
|
||||
- name: Clone the project to the new release folder
|
||||
git:
|
||||
repo: git://foosball.example.org/path/to/repo.git
|
||||
ansible.builtin.git:
|
||||
repo: ansible.builtin.git://foosball.example.org/path/to/repo.git
|
||||
dest: '{{ deploy_helper.new_release_path }}'
|
||||
version: v1.1.1
|
||||
- name: Add an unfinished file, to allow cleanup on successful finalize
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: '{{ deploy_helper.new_release_path }}/{{ deploy_helper.unfinished_filename }}'
|
||||
state: touch
|
||||
- name: Perform some build steps, like running your dependency manager for example
|
||||
|
@ -161,14 +161,14 @@ EXAMPLES = '''
|
|||
command: install
|
||||
working_dir: '{{ deploy_helper.new_release_path }}'
|
||||
- name: Create some folders in the shared folder
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: '{{ deploy_helper.shared_path }}/{{ item }}'
|
||||
state: directory
|
||||
with_items:
|
||||
- sessions
|
||||
- uploads
|
||||
- name: Add symlinks from the new release to the shared folder
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: '{{ deploy_helper.new_release_path }}/{{ item.path }}'
|
||||
src: '{{ deploy_helper.shared_path }}/{{ item.src }}'
|
||||
state: link
|
||||
|
@ -256,7 +256,7 @@ EXAMPLES = '''
|
|||
# Debugging the facts returned by the module
|
||||
- community.general.deploy_helper:
|
||||
path: /path/to/root
|
||||
- debug:
|
||||
- ansible.builtin.debug:
|
||||
var: deploy_helper
|
||||
'''
|
||||
import os
|
||||
|
|
|
@ -204,13 +204,13 @@ EXAMPLES = '''
|
|||
with_items: "{{ my_jenkins_plugin_unversioned.results }}"
|
||||
|
||||
- name: Restart Jenkins if required
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: jenkins
|
||||
state: restarted
|
||||
when: jenkins_restart_required
|
||||
|
||||
- name: Wait for Jenkins to start up
|
||||
uri:
|
||||
ansible.builtin.uri:
|
||||
url: http://localhost:8080
|
||||
status_code: 200
|
||||
timeout: 5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue