1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
parent 58ed77e851
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

View file

@ -46,40 +46,40 @@ author: "Trey Perry (@treyperry)"
'''
EXAMPLES = """
# Creating or updating a znode with a given value
- znode:
- name: Creating or updating a znode with a given value
znode:
hosts: 'localhost:2181'
name: /mypath
value: myvalue
state: present
# Getting the value and stat structure for a znode
- znode:
- name: Getting the value and stat structure for a znode
znode:
hosts: 'localhost:2181'
name: /mypath
op: get
# Listing a particular znode's children
- znode:
- name: Listing a particular znode's children
znode:
hosts: 'localhost:2181'
name: /zookeeper
op: list
# Waiting 20 seconds for a znode to appear at path /mypath
- znode:
- name: Waiting 20 seconds for a znode to appear at path /mypath
znode:
hosts: 'localhost:2181'
name: /mypath
op: wait
timeout: 20
# Deleting a znode at path /mypath
- znode:
- name: Deleting a znode at path /mypath
znode:
hosts: 'localhost:2181'
name: /mypath
state: absent
# Creating or updating a znode with a given value on a remote Zookeeper
- znode:
- name: Creating or updating a znode with a given value on a remote Zookeeper
znode:
hosts: 'my-zookeeper-node:2181'
name: /mypath
value: myvalue

View file

@ -65,7 +65,7 @@ options:
'''
EXAMPLES = '''
- name: "Add or update OpenDJ backend properties"
- name: Add or update OpenDJ backend properties
action: opendj_backendprop
hostname=localhost
port=4444

View file

@ -53,7 +53,8 @@ requirements: []
'''
EXAMPLES = '''
- airbrake_deployment:
- name: Notify airbrake about an app deployment
airbrake_deployment:
token: AAAAAA
environment: staging
user: ansible

View file

@ -74,20 +74,23 @@ requirements: [ ]
'''
EXAMPLES = '''
- bigpanda:
- name: Notify BigPanda about a deployment
bigpanda:
component: myapp
version: '1.3'
token: '{{ bigpanda_token }}'
state: started
- bigpanda:
- name: Notify BigPanda about a deployment
bigpanda:
component: myapp
version: '1.3'
token: '{{ bigpanda_token }}'
state: finished
# If outside servers aren't reachable from your machine, use delegate_to and override hosts:
- bigpanda:
- name: Notify BigPanda about a deployment
bigpanda:
component: myapp
version: '1.3'
token: '{{ bigpanda_token }}'
@ -96,7 +99,8 @@ EXAMPLES = '''
delegate_to: localhost
register: deployment
- bigpanda:
- name: Notify BigPanda about a deployment
bigpanda:
component: '{{ deployment.component }}'
version: '{{ deployment.version }}'
token: '{{ deployment.token }}'

View file

@ -50,21 +50,23 @@ options:
default: 0
'''
EXAMPLES = '''
# Create a simple annotation event with a source, defaults to start and end time of now
- circonus_annotation:
- name: Create a simple annotation event with a source, defaults to start and end time of now
circonus_annotation:
api_key: XXXXXXXXXXXXXXXXX
title: App Config Change
description: This is a detailed description of the config change
category: This category groups like annotations
# Create an annotation with a duration of 5 minutes and a default start time of now
- circonus_annotation:
- name: Create an annotation with a duration of 5 minutes and a default start time of now
circonus_annotation:
api_key: XXXXXXXXXXXXXXXXX
title: App Config Change
description: This is a detailed description of the config change
category: This category groups like annotations
duration: 300
# Create an annotation with a start_time and end_time
- circonus_annotation:
- name: Create an annotation with a start_time and end_time
circonus_annotation:
api_key: XXXXXXXXXXXXXXXXX
title: App Config Change
description: This is a detailed description of the config change

View file

@ -64,15 +64,16 @@ options:
'''
EXAMPLES = '''
# Post an event with low priority
- datadog_event:
- name: Post an event with low priority
datadog_event:
title: Testing from ansible
text: Test
priority: low
api_key: 9775a026f1ca7d1c6c5af9d94d9595a4
app_key: j4JyCYfefWHhgFgiZUqRm63AXHNZQyPGBfJtAzmN
# Post an event with several tags
- datadog_event:
- name: Post an event with several tags
datadog_event:
title: Testing from ansible
text: Test
api_key: 9775a026f1ca7d1c6c5af9d94d9595a4

View file

@ -137,8 +137,8 @@ options:
'''
EXAMPLES = '''
# Create a metric monitor
- datadog_monitor:
- name: Create a metric monitor
datadog_monitor:
type: "metric alert"
name: "Test monitor"
state: "present"
@ -147,30 +147,30 @@ EXAMPLES = '''
api_key: "9775a026f1ca7d1c6c5af9d94d9595a4"
app_key: "87ce4a24b5553d2e482ea8a8500e71b8ad4554ff"
# Deletes a monitor
- datadog_monitor:
- name: Deletes a monitor
datadog_monitor:
name: "Test monitor"
state: "absent"
api_key: "9775a026f1ca7d1c6c5af9d94d9595a4"
app_key: "87ce4a24b5553d2e482ea8a8500e71b8ad4554ff"
# Mutes a monitor
- datadog_monitor:
- name: Mutes a monitor
datadog_monitor:
name: "Test monitor"
state: "mute"
silenced: '{"*":None}'
api_key: "9775a026f1ca7d1c6c5af9d94d9595a4"
app_key: "87ce4a24b5553d2e482ea8a8500e71b8ad4554ff"
# Unmutes a monitor
- datadog_monitor:
- name: Unmutes a monitor
datadog_monitor:
name: "Test monitor"
state: "unmute"
api_key: "9775a026f1ca7d1c6c5af9d94d9595a4"
app_key: "87ce4a24b5553d2e482ea8a8500e71b8ad4554ff"
# Use datadoghq.eu platform instead of datadoghq.com
- datadog_monitor:
- name: Use datadoghq.eu platform instead of datadoghq.com
datadog_monitor:
name: "Test monitor"
state: "absent"
api_host: https://api.datadoghq.eu

View file

@ -46,7 +46,8 @@ options:
'''
EXAMPLES = '''
- honeybadger_deployment:
- name: Notify Honeybadger.io about an app deployment
honeybadger_deployment:
token: AAAAAA
environment: staging
user: ansible

View file

@ -60,16 +60,16 @@ options:
'''
EXAMPLES = '''
# Create a simple annotation event with a source
- librato_annotation:
- name: Create a simple annotation event with a source
librato_annotation:
user: user@example.com
api_key: XXXXXXXXXXXXXXXXX
title: App Config Change
source: foo.bar
description: This is a detailed description of the config change
# Create an annotation that includes a link
- librato_annotation:
- name: Create an annotation that includes a link
librato_annotation:
user: user@example.com
api_key: XXXXXXXXXXXXXXXXXX
name: code.deploy
@ -79,8 +79,8 @@ EXAMPLES = '''
- rel: example
href: http://www.example.com/deploy
# Create an annotation with a start_time and end_time
- librato_annotation:
- name: Create an annotation with a start_time and end_time
librato_annotation:
user: user@example.com
api_key: XXXXXXXXXXXXXXXXXX
name: maintenance

View file

@ -39,14 +39,14 @@ notes:
- Requires the LogEntries agent which can be installed following the instructions at logentries.com
'''
EXAMPLES = '''
# Track nginx logs
- logentries:
- name: Track nginx logs
logentries:
path: /var/log/nginx/access.log
state: present
name: nginx-access-log
# Stop tracking nginx logs
- logentries:
- name: Stop tracking nginx logs
logentries:
path: /var/log/nginx/error.log
state: absent
'''

View file

@ -34,8 +34,8 @@ author: "Darryl Stoflet (@dstoflet)"
'''
EXAMPLES = '''
# Manage the state of program "httpd" to be in "started" state.
- monit:
- name: Manage the state of program httpd to be in started state
monit:
name: httpd
state: started
'''

View file

@ -85,114 +85,114 @@ author: "Tim Bielawa (@tbielawa)"
'''
EXAMPLES = '''
# set 30 minutes of apache downtime
- nagios:
- name: Set 30 minutes of apache downtime
nagios:
action: downtime
minutes: 30
service: httpd
host: '{{ inventory_hostname }}'
# schedule an hour of HOST downtime
- nagios:
- name: Schedule an hour of HOST downtime
nagios:
action: downtime
minutes: 60
service: host
host: '{{ inventory_hostname }}'
# schedule an hour of HOST downtime starting at 2019-04-23T02:00:00+00:00
- nagios:
- name: Schedule an hour of HOST downtime starting at 2019-04-23T02:00:00+00:00
nagios:
action: downtime
start: 1555984800
minutes: 60
service: host
host: '{{ inventory_hostname }}'
# schedule an hour of HOST downtime, with a comment describing the reason
- nagios:
- name: Schedule an hour of HOST downtime, with a comment describing the reason
nagios:
action: downtime
minutes: 60
service: host
host: '{{ inventory_hostname }}'
comment: Rebuilding machine
# schedule downtime for ALL services on HOST
- nagios:
- name: Schedule downtime for ALL services on HOST
nagios:
action: downtime
minutes: 45
service: all
host: '{{ inventory_hostname }}'
# schedule downtime for a few services
- nagios:
- name: Schedule downtime for a few services
nagios:
action: downtime
services: frob,foobar,qeuz
host: '{{ inventory_hostname }}'
# set 30 minutes downtime for all services in servicegroup foo
- nagios:
- name: Set 30 minutes downtime for all services in servicegroup foo
nagios:
action: servicegroup_service_downtime
minutes: 30
servicegroup: foo
host: '{{ inventory_hostname }}'
# set 30 minutes downtime for all host in servicegroup foo
- nagios:
- name: Set 30 minutes downtime for all host in servicegroup foo
nagios:
action: servicegroup_host_downtime
minutes: 30
servicegroup: foo
host: '{{ inventory_hostname }}'
# delete all downtime for a given host
- nagios:
- name: Delete all downtime for a given host
nagios:
action: delete_downtime
host: '{{ inventory_hostname }}'
service: all
# delete all downtime for HOST with a particular comment
- nagios:
- name: Delete all downtime for HOST with a particular comment
nagios:
action: delete_downtime
host: '{{ inventory_hostname }}'
service: host
comment: Planned maintenance
# enable SMART disk alerts
- nagios:
- name: Enable SMART disk alerts
nagios:
action: enable_alerts
service: smart
host: '{{ inventory_hostname }}'
# "two services at once: disable httpd and nfs alerts"
- nagios:
- name: Disable httpd and nfs alerts
nagios:
action: disable_alerts
service: httpd,nfs
host: '{{ inventory_hostname }}'
# disable HOST alerts
- nagios:
- name: Disable HOST alerts
nagios:
action: disable_alerts
service: host
host: '{{ inventory_hostname }}'
# silence ALL alerts
- nagios:
- name: Silence ALL alerts
nagios:
action: silence
host: '{{ inventory_hostname }}'
# unsilence all alerts
- nagios:
- name: Unsilence all alerts
nagios:
action: unsilence
host: '{{ inventory_hostname }}'
# SHUT UP NAGIOS
- nagios:
- name: Shut up nagios
nagios:
action: silence_nagios
# ANNOY ME NAGIOS
- nagios:
- name: Annoy me negios
nagios:
action: unsilence_nagios
# command something
- nagios:
- name: Command something
nagios:
action: command
command: DISABLE_FAILURE_PREDICTION
'''

View file

@ -64,7 +64,8 @@ requirements: []
'''
EXAMPLES = '''
- newrelic_deployment:
- name: Notify newrelic about an app deployment
newrelic_deployment:
token: AAAAAA
app_name: myapp
user: ansible deployment

View file

@ -68,22 +68,22 @@ options:
'''
EXAMPLES = '''
# List ongoing maintenance windows using a token
- pagerduty:
- name: List ongoing maintenance windows using a token
pagerduty:
name: companyabc
token: xxxxxxxxxxxxxx
state: ongoing
# Create a 1 hour maintenance window for service FOO123
- pagerduty:
- name: Create a 1 hour maintenance window for service FOO123
pagerduty:
name: companyabc
user: example@example.com
token: yourtoken
state: running
service: FOO123
# Create a 5 minute maintenance window for service FOO123
- pagerduty:
- name: Create a 5 minute maintenance window for service FOO123
pagerduty:
name: companyabc
token: xxxxxxxxxxxxxx
hours: 0
@ -92,8 +92,8 @@ EXAMPLES = '''
service: FOO123
# Create a 4 hour maintenance window for service FOO123 with the description "deployment".
- pagerduty:
- name: Create a 4 hour maintenance window for service FOO123 with the description "deployment"
pagerduty:
name: companyabc
user: example@example.com
state: running
@ -102,26 +102,28 @@ EXAMPLES = '''
desc: deployment
register: pd_window
# Delete the previous maintenance window
- pagerduty:
- name: Delete the previous maintenance window
pagerduty:
name: companyabc
user: example@example.com
state: absent
window_id: '{{ pd_window.result.maintenance_window.id }}'
# Delete a maintenance window from a separate playbook than its creation, and if it is the only existing maintenance window.
- pagerduty:
# Delete a maintenance window from a separate playbook than its creation,
# and if it is the only existing maintenance window
- name: Check
pagerduty:
requester_id: XXXXXXX
token: yourtoken
state: ongoing
register: pd_window
- pagerduty:
- name: Delete
pagerduty:
requester_id: XXXXXXX
token: yourtoken
state: absent
window_id: "{{ pd_window.result.maintenance_windows[0].id }}"
'''
import datetime

View file

@ -73,8 +73,8 @@ options:
'''
EXAMPLES = '''
# Trigger an incident with just the basic options
- pagerduty_alert:
- name: Trigger an incident with just the basic options
pagerduty_alert:
name: companyabc
integration_key: xxx
api_key: yourapikey
@ -82,8 +82,8 @@ EXAMPLES = '''
state: triggered
desc: problem that led to this trigger
# Trigger an incident with more options
- pagerduty_alert:
- name: Trigger an incident with more options
pagerduty_alert:
integration_key: xxx
api_key: yourapikey
service_id: PDservice
@ -93,8 +93,8 @@ EXAMPLES = '''
client: Sample Monitoring Service
client_url: http://service.example.com
# Acknowledge an incident based on incident_key
- pagerduty_alert:
- name: Acknowledge an incident based on incident_key
pagerduty_alert:
integration_key: xxx
api_key: yourapikey
service_id: PDservice
@ -102,8 +102,8 @@ EXAMPLES = '''
incident_key: somekey
desc: "some text for incident's log"
# Resolve an incident based on incident_key
- pagerduty_alert:
- name: Resolve an incident based on incident_key
pagerduty_alert:
integration_key: xxx
api_key: yourapikey
service_id: PDservice

View file

@ -45,16 +45,16 @@ notes:
'''
EXAMPLES = '''
# Pause the check with the ID of 12345.
- pingdom:
- name: Pause the check with the ID of 12345
pingdom:
uid: example@example.com
passwd: password123
key: apipassword123
checkid: 12345
state: paused
# Unpause the check with the ID of 12345.
- pingdom:
- name: Unpause the check with the ID of 12345
pingdom:
uid: example@example.com
passwd: password123
key: apipassword123

View file

@ -57,7 +57,8 @@ options:
'''
EXAMPLES = '''
- stackdriver:
- name: Send a code deploy event to stackdriver
stackdriver:
key: AAAAAA
event: deploy
deployed_to: production
@ -65,7 +66,8 @@ EXAMPLES = '''
repository: MyWebApp
revision_id: abcd123
- stackdriver:
- name: Send an annotation event to stackdriver
stackdriver:
key: AAAAAA
event: annotation
msg: Greetings from Ansible

View file

@ -35,14 +35,14 @@ notes:
'''
EXAMPLES = '''
# Pause the monitor with an ID of 12345.
- uptimerobot:
- name: Pause the monitor with an ID of 12345
uptimerobot:
monitorid: 12345
apikey: 12345-1234512345
state: paused
# Start the monitor with an ID of 12345.
- uptimerobot:
- name: Start the monitor with an ID of 12345
uptimerobot:
monitorid: 12345
apikey: 12345-1234512345
state: started

View file

@ -52,13 +52,15 @@ author: "Adam Garside (@fabulops)"
'''
EXAMPLES = '''
- campfire:
- name: Send a message to Campfire
campfire:
subscription: foo
token: 12345
room: 123
msg: Task completed.
- campfire:
- name: Send a message to Campfire
campfire:
subscription: foo
token: 12345
room: 123

View file

@ -77,7 +77,8 @@ requirements: [ ]
'''
EXAMPLES = '''
- flowdock:
- name: Send a message to a flowdock
flowdock:
type: inbox
token: AAAAAA
from_address: user@example.com
@ -85,7 +86,8 @@ EXAMPLES = '''
msg: test from ansible
subject: test subject
- flowdock:
- name: Send a message to a flowdock
flowdock:
type: chat
token: AAAAAA
external_user_name: testuser

View file

@ -47,10 +47,11 @@ author: "Jonas Pfenniger (@zimbatm)"
'''
EXAMPLES = '''
- grove: >
channel_token=6Ph62VBBJOccmtTPZbubiPzdrhipZXtg
service=my-app
message=deployed {{ target }}
- name: Sends a notification to a grove.io channel
grove:
channel_token: 6Ph62VBBJOccmtTPZbubiPzdrhipZXtg
service: my-app
message: 'deployed {{ target }}'
'''
from ansible.module_utils.basic import AnsibleModule

View file

@ -65,12 +65,13 @@ author:
'''
EXAMPLES = '''
- hipchat:
- name: Send a message to a Hipchat room
hipchat:
room: notif
msg: Ansible task finished
# Use Hipchat API version 2
- hipchat:
- name: Send a message to a Hipchat room using Hipchat API version 2
hipchat:
api: https://api.hipchat.com/v2/
token: OAUTH2_TOKEN
room: notify

View file

@ -83,12 +83,14 @@ author:
'''
EXAMPLES = '''
- irc:
- name: Send a message to an IRC channel from nick ansible
irc:
server: irc.example.net
channel: #t1
msg: Hello world
- local_action:
- name: Send a message to an IRC channel
local_action:
module: irc
port: 6669
server: irc.example.net
@ -97,7 +99,8 @@ EXAMPLES = '''
color: red
nick: ansibleIRC
- local_action:
- name: Send a message to an IRC channel
local_action:
module: irc
port: 6669
server: irc.example.net

View file

@ -49,22 +49,22 @@ author: "Brian Coca (@bcoca)"
'''
EXAMPLES = '''
# send a message to a user
- jabber:
- name: Send a message to a user
jabber:
user: mybot@example.net
password: secret
to: friend@example.net
msg: Ansible task finished
# send a message to a room
- jabber:
- name: Send a message to a room
jabber:
user: mybot@example.net
password: secret
to: mychaps@conference.example.net/ansiblebot
msg: Ansible task finished
# send a message, specifying the host and port
- jabber:
- name: Send a message, specifying the host and port
jabber:
user: mybot@example.net
host: talk.example.net
port: 5223

View file

@ -39,7 +39,8 @@ author: "Jimmy Tang (@jcftang) <jimmy_tang@rapid7.com>"
RETURN = '''# '''
EXAMPLES = '''
- logentries_msg:
- name: Send a message to logentries
logentries_msg:
token=00000000-0000-0000-0000-000000000000
msg="{{ ansible_hostname }}"
'''

View file

@ -95,7 +95,8 @@ author: "Jan-Piet Mens (@jpmens)"
'''
EXAMPLES = '''
- mqtt:
- name: Publish a message on an MQTT topic
mqtt:
topic: 'service/ansible/{{ ansible_hostname }}'
payload: 'Hello at {{ ansible_date_time.iso8601 }}'
qos: 0

View file

@ -50,28 +50,28 @@ notes:
'''
EXAMPLES = '''
# Sends a push notification to a device
- pushbullet:
- name: Sends a push notification to a device
pushbullet:
api_key: "ABC123abc123ABC123abc123ABC123ab"
device: "Chrome"
title: "You may see this on Google Chrome"
# Sends a link to a device
- pushbullet:
- name: Sends a link to a device
pushbullet:
api_key: ABC123abc123ABC123abc123ABC123ab
device: Chrome
push_type: link
title: Ansible Documentation
body: https://docs.ansible.com/
# Sends a push notification to a channel
- pushbullet:
- name: Sends a push notification to a channel
pushbullet:
api_key: ABC123abc123ABC123abc123ABC123ab
channel: my-awesome-channel
title: Broadcasting a message to the #my-awesome-channel folks
# Sends a push notification with title and body to a channel
- pushbullet:
- name: Sends a push notification with title and body to a channel
pushbullet:
api_key: ABC123abc123ABC123abc123ABC123ab
channel: my-awesome-channel
title: ALERT! Signup service is down

View file

@ -43,13 +43,15 @@ author: "Jim Richardson (@weaselkeeper)"
'''
EXAMPLES = '''
- pushover:
- name: Send notifications via pushover.net
pushover:
msg: '{{ inventory_hostname }} is acting strange ...'
app_token: wxfdksl
user_key: baa5fe97f2c5ab3ca8f0bb59
delegate_to: localhost
- pushover:
- name: Send notifications via pushover.net
pushover:
title: 'Alert!'
msg: '{{ inventory_hostname }} has exploded in flames, It is now time to panic'
pri: 1

View file

@ -34,7 +34,8 @@ author:
'''
EXAMPLES = '''
- say:
- name: Makes a computer to speak
say:
msg: '{{ inventory_hostname }} is all done'
voice: Zarvox
delegate_to: localhost

View file

@ -74,8 +74,8 @@ author: "Matt Makai (@makaimc)"
'''
EXAMPLES = '''
# send an email to a single recipient that the deployment was successful
- sendgrid:
- name: Send an email to a single recipient that the deployment was successful
sendgrid:
username: "{{ sendgrid_username }}"
password: "{{ sendgrid_password }}"
from_address: "ansible@mycompany.com"
@ -85,8 +85,8 @@ EXAMPLES = '''
body: "The most recent Ansible deployment was successful."
delegate_to: localhost
# send an email to more than one recipient that the build failed
- sendgrid:
- name: Send an email to more than one recipient that the build failed
sendgrid:
username: "{{ sendgrid_username }}"
password: "{{ sendgrid_password }}"
from_address: "build@mycompany.com"

View file

@ -55,7 +55,8 @@ EXAMPLES = '''
# send an SMS about the build status to (555) 303 5681
# note: replace account_sid and auth_token values with your credentials
# and you have to have the 'from_number' on your Twilio account
- twilio:
- name: Send a text message to a mobile phone through Twilio
twilio:
msg: All servers with webserver role are now configured.
account_sid: ACXXXXXXXXXXXXXXXXX
auth_token: ACXXXXXXXXXXXXXXXXX
@ -66,7 +67,8 @@ EXAMPLES = '''
# send an SMS to multiple phone numbers about the deployment
# note: replace account_sid and auth_token values with your credentials
# and you have to have the 'from_number' on your Twilio account
- twilio:
- name: Send a text message to a mobile phone through Twilio
twilio:
msg: This server configuration is now complete.
account_sid: ACXXXXXXXXXXXXXXXXX
auth_token: ACXXXXXXXXXXXXXXXXX
@ -81,7 +83,8 @@ EXAMPLES = '''
# and an image of the results
# note: replace account_sid and auth_token values with your credentials
# and you have to have the 'from_number' on your Twilio account
- twilio:
- name: Send a text message to a mobile phone through Twilio
twilio:
msg: Deployment complete!
account_sid: ACXXXXXXXXXXXXXXXXX
auth_token: ACXXXXXXXXXXXXXXXXX

View file

@ -36,7 +36,8 @@ author: "Takashi Someda (@tksmd)"
'''
EXAMPLES = '''
- typetalk:
- name: Send a message to typetalk
typetalk:
client_id: 12345
client_secret: 12345
topic: 1

View file

@ -83,28 +83,28 @@ author: "Tim Hoiberg (@thoiberg)"
'''
EXAMPLES = '''
# Installs gems from a Gemfile in the current directory
- bundler:
- name: Install gems from a Gemfile in the current directory
bundler:
state: present
executable: ~/.rvm/gems/2.1.5/bin/bundle
# Excludes the production group from installing
- bundler:
- name: Exclude the production group from installing
bundler:
state: present
exclude_groups: production
# Install gems into ./vendor/bundle
- bundler:
- name: Install gems into ./vendor/bundle
bundler:
state: present
deployment_mode: yes
# Installs gems using a Gemfile in another directory
- bundler:
- name: Install gems using a Gemfile in another directory
bundler:
state: present
gemfile: ../rails_project/Gemfile
# Updates Gemfile in another directory
- bundler:
- name: Update Gemfile in another directory
bundler:
state: latest
chdir: ~/rails_project
'''

View file

@ -111,25 +111,26 @@ notes:
'''
EXAMPLES = '''
# Downloads and installs all the libs and dependencies outlined in the /path/to/project/composer.lock
- composer:
- name: Download and installs all libs and dependencies outlined in the /path/to/project/composer.lock
composer:
command: install
working_dir: /path/to/project
- composer:
- name: install a new package
composer:
command: require
arguments: my/package
working_dir: /path/to/project
# Clone project and install with all dependencies
- composer:
- name: Clone and install a project with all dependencies
composer:
command: create-project
arguments: package/package /path/to/project ~1.0
working_dir: /path/to/project
prefer_dist: yes
# Installs package globally
- composer:
- name: Install a package globally
composer:
command: require
global_command: yes
arguments: my/package

View file

@ -66,42 +66,41 @@ author: "Franck Cuny (@fcuny)"
'''
EXAMPLES = '''
# install Dancer perl package
- cpanm:
- name: Install Dancer perl package
cpanm:
name: Dancer
# install version 0.99_05 of the Plack perl package
- cpanm:
- name: Install version 0.99_05 of the Plack perl package
cpanm:
name: MIYAGAWA/Plack-0.99_05.tar.gz
# install Dancer into the specified locallib
- cpanm:
- name: Install Dancer into the specified locallib
cpanm:
name: Dancer
locallib: /srv/webapps/my_app/extlib
# install perl dependencies from local directory
- cpanm:
- name: Install perl dependencies from local directory
cpanm:
from_path: /srv/webapps/my_app/src/
# install Dancer perl package without running the unit tests in indicated locallib
- cpanm:
- name: Install Dancer perl package without running the unit tests in indicated locallib
cpanm:
name: Dancer
notest: True
locallib: /srv/webapps/my_app/extlib
# install Dancer perl package from a specific mirror
- cpanm:
- name: Install Dancer perl package from a specific mirror
cpanm:
name: Dancer
mirror: 'http://cpan.cpantesters.org/'
# install Dancer perl package into the system root path
- cpanm:
- name: Install Dancer perl package into the system root path
cpanm:
name: Dancer
system_lib: yes
# install Dancer if it's not already installed
# OR the installed version is older than version 1.0
- cpanm:
- name: Install Dancer if it is not already installed OR the installed version is older than version 1.0
cpanm:
name: Dancer
version: '1.0'
'''

View file

@ -61,13 +61,13 @@ author: "Matt Wright (@mattupstate)"
'''
EXAMPLES = '''
# Examples from Ansible Playbooks
- easy_install:
- name: Install or update pip
easy_install:
name: pip
state: latest
# Install Bottle into the specified virtualenv.
- easy_install:
- name: Install Bottle into the specified virtualenv
easy_install:
name: bottle
virtualenv: /webapps/myapp/venv
'''

View file

@ -94,19 +94,19 @@ author:
'''
EXAMPLES = '''
# Installs version 1.0 of vagrant.
- gem:
- name: Install version 1.0 of vagrant
gem:
name: vagrant
version: 1.0
state: present
# Installs latest available version of rake.
- gem:
- name: Install latest available version of rake
gem:
name: rake
state: latest
# Installs rake version 1.0 from a local gem on disk.
- gem:
- name: Install rake version 1.0 from a local gem on disk
gem:
name: rake
gem_source: /path/to/gems/rake-1.0.gem
state: present

View file

@ -119,21 +119,21 @@ extends_documentation_fragment:
'''
EXAMPLES = '''
# Download the latest version of the JUnit framework artifact from Maven Central
- maven_artifact:
- name: Download the latest version of the JUnit framework artifact from Maven Central
maven_artifact:
group_id: junit
artifact_id: junit
dest: /tmp/junit-latest.jar
# Download JUnit 4.11 from Maven Central
- maven_artifact:
- name: Download JUnit 4.11 from Maven Central
maven_artifact:
group_id: junit
artifact_id: junit
version: 4.11
dest: /tmp/junit-4.11.jar
# Download an artifact from a private repository requiring authentication
- maven_artifact:
- name: Download an artifact from a private repository requiring authentication
maven_artifact:
group_id: com.company
artifact_id: library-name
repository_url: 'https://repo.company.com/maven'
@ -141,31 +141,31 @@ EXAMPLES = '''
password: pass
dest: /tmp/library-name-latest.jar
# Download a WAR File to the Tomcat webapps directory to be deployed
- maven_artifact:
- name: Download a WAR File to the Tomcat webapps directory to be deployed
maven_artifact:
group_id: com.company
artifact_id: web-app
extension: war
repository_url: 'https://repo.company.com/maven'
dest: /var/lib/tomcat7/webapps/web-app.war
# Keep a downloaded artifact's name, i.e. retain the version
- maven_artifact:
- name: Keep a downloaded artifact's name, i.e. retain the version
maven_artifact:
version: latest
artifact_id: spring-core
group_id: org.springframework
dest: /tmp/
keep_name: yes
# Download the latest version of the JUnit framework artifact from Maven local
- maven_artifact:
- name: Download the latest version of the JUnit framework artifact from Maven local
maven_artifact:
group_id: junit
artifact_id: junit
dest: /tmp/junit-latest.jar
repository_url: "file://{{ lookup('env','HOME') }}/.m2/repository"
# Download the latest version between 3.8 and 4.0 (exclusive) of the JUnit framework artifact from Maven Central
- maven_artifact:
- name: Download the latest version between 3.8 and 4.0 (exclusive) of the JUnit framework artifact from Maven Central
maven_artifact:
group_id: junit
artifact_id: junit
version_by_spec: "[3.8,4.0)"

View file

@ -36,23 +36,23 @@ options:
'''
EXAMPLES = '''
# Install pear package
- pear:
- name: Install pear package
pear:
name: Net_URL2
state: present
# Install pecl package
- pear:
- name: Install pecl package
pear:
name: pecl/json_post
state: present
# Upgrade package
- pear:
- name: Upgrade package
pear:
name: Net_URL2
state: latest
# Remove packages
- pear:
- name: Remove packages
pear:
name: Net_URL2,pecl/json_post
state: absent
'''