Fix Ansible documentation in part of example formatting (#334)

This commit is contained in:
Andrew Klychkov 2020-05-15 13:12:41 +03:00 committed by GitHub
commit 983d937b7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 376 additions and 353 deletions

View file

@ -126,7 +126,7 @@ EXAMPLES = '''
project_id: 53000fb2-ee46-4673-93a8-de2c2bdba33b
tasks:
- name: test create volume
- name: Create volume
packet_volume:
description: "{{ volname }}"
project_id: "{{ project_id }}"
@ -139,7 +139,7 @@ EXAMPLES = '''
snapshot_frequency: 1day
register: result_create
- name: test delete volume
- name: Delete volume
packet_volume:
id: "{{ result_create.id }}"
project_id: "{{ project_id }}"

View file

@ -77,7 +77,7 @@ EXAMPLES = '''
project_id: 52000fb2-ee46-4673-93a8-de2c2bdba33b
tasks:
- name: test create volume
- name: Create volume
packet_volume:
description: "{{ volname }}"
project_id: "{{ project_id }}"
@ -89,7 +89,8 @@ EXAMPLES = '''
snapshot_count: 10
snapshot_frequency: 1day
- packet_device:
- name: Create a device
packet_device:
project_id: "{{ project_id }}"
hostnames: "{{ devname }}"
operating_system: ubuntu_16_04
@ -109,7 +110,6 @@ EXAMPLES = '''
volume: "{{ volname }}"
device: "{{ devname }}"
state: absent
'''
RETURN = '''

View file

@ -115,9 +115,9 @@ EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Provisioning example. This will create three servers and enumerate their names.
- profitbricks:
# Provisioning example
- name: Create three servers and enumerate their names
profitbricks:
datacenter: Tardis One
name: web%02d.stackpointcloud.com
cores: 4
@ -129,9 +129,8 @@ EXAMPLES = '''
count: 3
assign_public_ip: true
# Removing Virtual machines
- profitbricks:
- name: Remove virtual machines
profitbricks:
datacenter: Tardis One
instance_ids:
- 'web001.stackpointcloud.com'
@ -140,9 +139,8 @@ EXAMPLES = '''
wait_timeout: 500
state: absent
# Starting Virtual Machines.
- profitbricks:
- name: Start virtual machines
profitbricks:
datacenter: Tardis One
instance_ids:
- 'web001.stackpointcloud.com'
@ -151,9 +149,8 @@ EXAMPLES = '''
wait_timeout: 500
state: running
# Stopping Virtual Machines
- profitbricks:
- name: Stop virtual machines
profitbricks:
datacenter: Tardis One
instance_ids:
- 'web001.stackpointcloud.com'
@ -161,7 +158,6 @@ EXAMPLES = '''
- 'web003.stackpointcloud.com'
wait_timeout: 500
state: stopped
'''
import re

View file

@ -58,18 +58,16 @@ author: Matt Baldwin (@baldwinSPC) <baldwin@stackpointcloud.com>
'''
EXAMPLES = '''
# Create a Datacenter
- profitbricks_datacenter:
- name: Create a datacenter
profitbricks_datacenter:
datacenter: Tardis One
wait_timeout: 500
# Destroy a Datacenter. This will remove all servers, volumes, and other objects in the datacenter.
- profitbricks_datacenter:
- name: Destroy a datacenter (remove all servers, volumes, and other objects in the datacenter)
profitbricks_datacenter:
datacenter: Tardis One
wait_timeout: 500
state: absent
'''
import re

View file

@ -59,23 +59,21 @@ author: Matt Baldwin (@baldwinSPC) <baldwin@stackpointcloud.com>
'''
EXAMPLES = '''
# Create a NIC
- profitbricks_nic:
- name: Create a NIC
profitbricks_nic:
datacenter: Tardis One
server: node002
lan: 2
wait_timeout: 500
state: present
# Remove a NIC
- profitbricks_nic:
- name: Remove a NIC
profitbricks_nic:
datacenter: Tardis One
server: node002
name: 7341c2454f
wait_timeout: 500
state: absent
'''
import re

View file

@ -100,10 +100,8 @@ author: Matt Baldwin (@baldwinSPC) <baldwin@stackpointcloud.com>
'''
EXAMPLES = '''
# Create Multiple Volumes
- profitbricks_volume:
- name: Create multiple volumes
profitbricks_volume:
datacenter: Tardis One
name: vol%02d
count: 5
@ -111,16 +109,14 @@ EXAMPLES = '''
wait_timeout: 500
state: present
# Remove Volumes
- profitbricks_volume:
- name: Remove Volumes
profitbricks_volume:
datacenter: Tardis One
instance_ids:
- 'vol01'
- 'vol02'
wait_timeout: 500
state: absent
'''
import re

View file

@ -55,25 +55,21 @@ author: Matt Baldwin (@baldwinSPC) <baldwin@stackpointcloud.com>
'''
EXAMPLES = '''
# Attach a Volume
- profitbricks_volume_attachments:
- name: Attach a volume
profitbricks_volume_attachments:
datacenter: Tardis One
server: node002
volume: vol01
wait_timeout: 500
state: present
# Detach a Volume
- profitbricks_volume_attachments:
- name: Detach a volume
profitbricks_volume_attachments:
datacenter: Tardis One
server: node002
volume: vol01
wait_timeout: 500
state: absent
'''
import re

View file

@ -76,8 +76,8 @@ extends_documentation_fragment:
'''
EXAMPLES = '''
# Add a new node to the load balancer
- local_action:
- name: Add a new node to the load balancer
local_action:
module: rax_clb_nodes
load_balancer_id: 71
address: 10.2.2.3
@ -87,8 +87,8 @@ EXAMPLES = '''
wait: yes
credentials: /path/to/credentials
# Drain connections from a node
- local_action:
- name: Drain connections from a node
local_action:
module: rax_clb_nodes
load_balancer_id: 71
node_id: 410
@ -96,8 +96,8 @@ EXAMPLES = '''
wait: yes
credentials: /path/to/credentials
# Remove a node from the load balancer
- local_action:
- name: Remove a node from the load balancer
local_action:
module: rax_clb_nodes
load_balancer_id: 71
node_id: 410

View file

@ -59,19 +59,18 @@ options:
'''
EXAMPLES = '''
- name: Create an IP
scaleway_ip:
organization: '{{ scw_org }}'
state: present
region: par1
register: ip_creation_task
- name: Make sure IP deleted
scaleway_ip:
id: '{{ ip_creation_task.scaleway_ip.id }}'
state: absent
region: par1
- name: Create an IP
scaleway_ip:
organization: '{{ scw_org }}'
state: present
region: par1
register: ip_creation_task
- name: Make sure IP deleted
scaleway_ip:
id: '{{ ip_creation_task.scaleway_ip.id }}'
state: absent
region: par1
'''
RETURN = '''

View file

@ -83,18 +83,18 @@ options:
'''
EXAMPLES = '''
- name: Create a Security Group
scaleway_security_group:
state: present
region: par1
name: security_group
description: "my security group description"
organization: "43a3b6c8-916f-477b-b7ec-ff1898f5fdd9"
stateful: false
inbound_default_policy: accept
outbound_default_policy: accept
organization_default: false
register: security_group_creation_task
- name: Create a Security Group
scaleway_security_group:
state: present
region: par1
name: security_group
description: "my security group description"
organization: "43a3b6c8-916f-477b-b7ec-ff1898f5fdd9"
stateful: false
inbound_default_policy: accept
outbound_default_policy: accept
organization_default: false
register: security_group_creation_task
'''
RETURN = '''

View file

@ -55,22 +55,21 @@ options:
'''
EXAMPLES = '''
- name: Create 10GB volume
scaleway_volume:
name: my-volume
state: present
region: par1
organization: "{{ scw_org }}"
"size": 10000000000
volume_type: l_ssd
register: server_creation_check_task
- name: Make sure volume deleted
scaleway_volume:
name: my-volume
state: absent
region: par1
- name: Create 10GB volume
scaleway_volume:
name: my-volume
state: present
region: par1
organization: "{{ scw_org }}"
"size": 10000000000
volume_type: l_ssd
register: server_creation_check_task
- name: Make sure volume deleted
scaleway_volume:
name: my-volume
state: absent
region: par1
'''
RETURN = '''

View file

@ -27,27 +27,32 @@ options:
'''
EXAMPLES = '''
# Return information about all installed images.
- smartos_image_info:
- name: Return information about all installed images
smartos_image_info:
register: result
# Return all private active Linux images.
- smartos_image_info: filters="os=linux state=active public=false"
- name: Return all private active Linux images
smartos_image_info:
filters: "os=linux state=active public=false"
register: result
# Show, how many clones does every image have.
- smartos_image_info:
- name: Show, how many clones does every image have
smartos_image_info:
register: result
- debug: msg="{{ result.smartos_images[item]['name'] }}-{{ result.smartos_images[item]['version'] }}
has {{ result.smartos_images[item]['clones'] }} VM(s)"
- name: Print information
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 }}"
# When the module is called as smartos_image_facts, return values are published
# in ansible_facts['smartos_images'] and can be used as follows.
# Note that this is deprecated and will stop working in Ansible 2.13.
- debug: msg="{{ smartos_images[item]['name'] }}-{{ smartos_images[item]['version'] }}
has {{ smartos_images[item]['clones'] }} VM(s)"
- name: Print information
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

@ -466,7 +466,7 @@ EXAMPLES = '''
- hosts: localhost
tasks:
- name: create elastigroup
- name: Create elastigroup
spotinst_aws_elastigroup:
state: present
risk: 100
@ -500,7 +500,7 @@ EXAMPLES = '''
- hosts: localhost
tasks:
- name: create elastigroup
- name: Create elastigroup
spotinst_aws_elastigroup:
state: present
account_id: act-1a9dd2b
@ -547,7 +547,7 @@ EXAMPLES = '''
- hosts: localhost
tasks:
- name: create elastigroup
- name: Create elastigroup
spotinst_aws_elastigroup:
state: present
account_id: act-1a9dd2b
@ -597,7 +597,7 @@ EXAMPLES = '''
- hosts: localhost
tasks:
- name: create elastigroup
- name: Create elastigroup
spotinst_aws_elastigroup:
state: present
risk: 100
@ -637,7 +637,7 @@ EXAMPLES = '''
- hosts: localhost
tasks:
- name: create elastigroup
- name: Create elastigroup
spotinst_aws_elastigroup:
state: present
risk: 100
@ -675,7 +675,7 @@ EXAMPLES = '''
- hosts: localhost
tasks:
- name: create elastigroup
- name: Create elastigroup
spotinst_aws_elastigroup:
account_id: act-92d45673
state: present
@ -714,8 +714,8 @@ EXAMPLES = '''
- image_id
register: result
- debug: var=result
'''
RETURN = '''
---
instances:

View file

@ -54,8 +54,8 @@ options:
EXAMPLES = '''
# Create a DNS record on a UCS
- udm_dns_record:
- name: Create a DNS record on a UCS
udm_dns_record:
name: www
zone: example.com
type: host_record
@ -66,7 +66,7 @@ EXAMPLES = '''
'''
RETURN = '''# '''
RETURN = '''#'''
HAVE_UNIVENTION = False
try:

View file

@ -81,8 +81,8 @@ options:
EXAMPLES = '''
# Create a DNS zone on a UCS
- udm_dns_zone:
- name: Create a DNS zone on a UCS
udm_dns_zone:
zone: example.com
type: forward_zone
nameserver:

View file

@ -52,18 +52,21 @@ options:
EXAMPLES = '''
# Create a POSIX group
- udm_group:
- name: Create a POSIX group
udm_group:
name: g123m-1A
# Create a POSIX group with the exact DN
# C(cn=g123m-1A,cn=classes,cn=students,cn=groups,ou=school,dc=school,dc=example,dc=com)
- udm_group:
- name: Create a POSIX group with a DN
udm_group:
name: g123m-1A
subpath: 'cn=classes,cn=students,cn=groups'
ou: school
# or
- udm_group:
- name: Create a POSIX group with a DN
udm_group:
name: g123m-1A
position: 'cn=classes,cn=students,cn=groups,ou=school,dc=school,dc=example,dc=com'
'''

View file

@ -292,8 +292,8 @@ options:
EXAMPLES = '''
# Create a share named home on the server ucs.example.com with the path /home.
- udm_share:
- name: Create a share named home on the server ucs.example.com with the path /home
udm_share:
name: home
path: /home
host: ucs.example.com

View file

@ -227,24 +227,25 @@ options:
EXAMPLES = '''
# Create a user on a UCS
- udm_user:
- name: Create a user on a UCS
udm_user:
name: FooBar
password: secure_password
firstname: Foo
lastname: Bar
# Create a user with the DN
# C(uid=foo,cn=teachers,cn=users,ou=school,dc=school,dc=example,dc=com)
- udm_user:
- name: Create a user with the DN C(uid=foo,cn=teachers,cn=users,ou=school,dc=school,dc=example,dc=com)
udm_user:
name: foo
password: secure_password
firstname: Foo
lastname: Bar
ou: school
subpath: 'cn=teachers,cn=users'
# or define the position
- udm_user:
- name: Create a user with the DN C(uid=foo,cn=teachers,cn=users,ou=school,dc=school,dc=example,dc=com)
udm_user:
name: foo
password: secure_password
firstname: Foo

View file

@ -73,7 +73,7 @@ options:
'''
EXAMPLES = '''
- name: create website
- name: Create website
webfaction_site:
name: testsite1
state: present