Documentation updates to use complete YAML : syntax instead of key=val syntax.

Adjusted example to use "" where appropriate to pass YAML Syntax checker per Contribution guidelines.

See Issue [# 2879](https://github.com/ansible/ansible-modules-core/issues/2879)
This commit is contained in:
Mike Caspar 2016-02-10 09:56:17 -05:00
parent 3d4b5d165c
commit 7cc00bddc0
3 changed files with 59 additions and 53 deletions

View file

@ -115,26 +115,28 @@ EXAMPLES = '''
# If a key matches this name, will return the ssh key id and changed = False # If a key matches this name, will return the ssh key id and changed = False
# If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False # If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False
- digital_ocean: > - digital_ocean:
state=present state: present
command=ssh command: ssh
name=my_ssh_key name: my_ssh_key
ssh_pub_key='ssh-rsa AAAA...' ssh_pub_key: 'ssh-rsa AAAA...'
api_token=XXX api_token: XXX
# Create a new Droplet # Create a new Droplet
# Will return the droplet details including the droplet id (used for idempotence) # Will return the droplet details including the droplet id (used for idempotence)
- digital_ocean: > - digital_ocean:
state=present state: present
command=droplet command: droplet
name=mydroplet name: mydroplet
api_token=XXX api_token: XXX
size_id=2gb size_id: 2gb
region_id=ams2 region_id: ams2
image_id=fedora-19-x64 image_id: fedora-19-x64
wait_timeout=500 wait_timeout: 500
register: my_droplet register: my_droplet
- debug: msg="ID is {{ my_droplet.droplet.id }}" - debug: msg="ID is {{ my_droplet.droplet.id }}"
- debug: msg="IP is {{ my_droplet.droplet.ip_address }}" - debug: msg="IP is {{ my_droplet.droplet.ip_address }}"
@ -142,30 +144,31 @@ EXAMPLES = '''
# If droplet id already exist, will return the droplet details and changed = False # If droplet id already exist, will return the droplet details and changed = False
# If no droplet matches the id, a new droplet will be created and the droplet details (including the new id) are returned, changed = True. # If no droplet matches the id, a new droplet will be created and the droplet details (including the new id) are returned, changed = True.
- digital_ocean: > - digital_ocean:
state=present state: present
command=droplet command: droplet
id=123 id: 123
name=mydroplet name: mydroplet
api_token=XXX api_token: XXX
size_id=2gb size_id: 2gb
region_id=ams2 region_id: ams2
image_id=fedora-19-x64 image_id: fedora-19-x64
wait_timeout=500 wait_timeout: 500
# Create a droplet with ssh key # Create a droplet with ssh key
# The ssh key id can be passed as argument at the creation of a droplet (see ssh_key_ids). # The ssh key id can be passed as argument at the creation of a droplet (see ssh_key_ids).
# Several keys can be added to ssh_key_ids as id1,id2,id3 # Several keys can be added to ssh_key_ids as id1,id2,id3
# The keys are used to connect as root to the droplet. # The keys are used to connect as root to the droplet.
- digital_ocean: > - digital_ocean:
state=present state: present
ssh_key_ids=123,456 ssh_key_ids: 123,456
name=mydroplet name: mydroplet
api_token=XXX api_token: XXX
size_id=2gb size_id: 2gb
region_id=ams2 region_id: ams2
image_id=fedora-19-x64 image_id: fedora-19-x64
''' '''
import os import os

View file

@ -57,25 +57,28 @@ requirements:
EXAMPLES = ''' EXAMPLES = '''
# Create a domain record # Create a domain record
- digital_ocean_domain: > - digital_ocean_domain:
state=present state: present
name=my.digitalocean.domain name: my.digitalocean.domain
ip=127.0.0.1 ip: 127.0.0.1
# Create a droplet and a corresponding domain record # Create a droplet and a corresponding domain record
- digital_ocean: > - digital_ocean:
state=present state: present
name=test_droplet name: test_droplet
size_id=1gb size_id: 1gb
region_id=sgp1 region_id: sgp1
image_id=ubuntu-14-04-x64 image_id: ubuntu-14-04-x64
register: test_droplet register: test_droplet
- digital_ocean_domain: > - digital_ocean_domain:
state=present state: present
name={{ test_droplet.droplet.name }}.my.domain name: "{{ test_droplet.droplet.name }}.my.domain"
ip={{ test_droplet.droplet.ip_address }} ip: "{{ test_droplet.droplet.ip_address }}"
''' '''
import os import os

View file

@ -59,12 +59,12 @@ EXAMPLES = '''
# If a key matches this name, will return the ssh key id and changed = False # If a key matches this name, will return the ssh key id and changed = False
# If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False # If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False
- digital_ocean_sshkey: > - digital_ocean_sshkey:
state=present state: present
name=my_ssh_key name: my_ssh_key
ssh_pub_key='ssh-rsa AAAA...' ssh_pub_key: 'ssh-rsa AAAA...'
client_id=XXX client_id: XXX
api_key=XXX api_key: XXX
''' '''