DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition)

Migrated all examples: in DOCUMENTATION=''' string to standalone EXAMPLES=''' string
  Added deprecation warning to moduledev.rst and remove deprecated example from it
  Fixed up a few typos and uppercased some acronyms.
  add consistency to how EXAMPLES are formatted
This commit is contained in:
Jan-Piet Mens
2013-06-14 11:53:43 +02:00
parent 39aa5e5eac
commit 5c69918d53
88 changed files with 914 additions and 628 deletions

View File

@@ -43,13 +43,16 @@ options:
required: false
default: "no"
choices: [ "yes", "no" ]
examples:
- code: |
- action: debug msg="System $inventory_hostname has uuid $ansible_product_uuid"
- action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
only_if: "is_unset('${ansible_default_ipv4.gateway}')"
- action: debug msg="System $inventory_hostname has gateway ${ansible_default_ipv4.gateway}"
only_if: "is_set('${ansible_default_ipv4.gateway}')"
description: "Example that prints the loopback address and gateway for each host"
author: Dag Wieers
'''
EXAMPLES = '''
# Example that prints the loopback address and gateway for each host
- action: debug msg="System $inventory_hostname has uuid $ansible_product_uuid"
- action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
only_if: "is_unset('${ansible_default_ipv4.gateway}')"
- action: debug msg="System $inventory_hostname has gateway ${ansible_default_ipv4.gateway}"
only_if: "is_set('${ansible_default_ipv4.gateway}')"
'''

View File

@@ -33,12 +33,12 @@ options:
fail will simple bail out with a generic message.
required: false
default: "'Failed as requested from task'"
examples:
- code: |
fail: msg="The system may not be provisioned according to the CMDB status."
only_if: "'$cmdb_status' != 'to-be-staged'"
description: "Example playbook using fail and only_if together"
author: Dag Wieers
'''
EXAMPLES = '''
# Example playbook using fail and only_if together
- fail: msg="The system may not be provisioned according to the CMDB status."
only_if: "'$cmdb_status' != 'to-be-staged'"
'''

View File

@@ -26,11 +26,15 @@ options:
required: false
default: null
author: Tim Bielawa
examples:
- description: Pause for 5 minutes to build app cache.
code: "pause: minutes=5"
- description: Pause until you can verify updates to an application were successful.
code: "pause:"
- description: A helpful reminder of what to look out for post-update.
code: 'pause: prompt="Make sure org.foo.FooOverload exception is not present"'
'''
EXAMPLES = '''
# Pause for 5 minutes to build app cache.
- pause: minutes=5
# Pause until you can verify updates to an application were successful.
- pause:
# A helpful reminder of what to look out for post-update.
- pause: prompt="Make sure org.foo.FooOverload exception is not present"
'''

View File

@@ -42,10 +42,10 @@ notes:
EXAMPLES = '''
# Example setting host facts using key=value pairs
set_fact: one_fact="something" other_fact="{{ local_var * 2 }}"
- set_fact: one_fact="something" other_fact="{{ local_var * 2 }}"
# Example setting host facts using complex arguments
set_fact:
one_fact: something
other_fact: "{{ local_var * 2 }}"
- set_fact:
one_fact: something
other_fact: "{{ local_var * 2 }}"
'''

View File

@@ -67,7 +67,7 @@ author: Jeroen Hoekx
EXAMPLES = '''
# wait 300 seconds for port 8000 to become open on the host, don't start checking for 10 seconds
wait_for: port=8000 delay=10"
- wait_for: port=8000 delay=10"
'''
def main():