mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Fix Ansible documentation in part of example formatting (#334)
This commit is contained in:
parent
58ed77e851
commit
983d937b7b
58 changed files with 376 additions and 353 deletions
|
@ -53,7 +53,8 @@ requirements: []
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- airbrake_deployment:
|
||||
- name: Notify airbrake about an app deployment
|
||||
airbrake_deployment:
|
||||
token: AAAAAA
|
||||
environment: staging
|
||||
user: ansible
|
||||
|
|
|
@ -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 }}'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -46,7 +46,8 @@ options:
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- honeybadger_deployment:
|
||||
- name: Notify Honeybadger.io about an app deployment
|
||||
honeybadger_deployment:
|
||||
token: AAAAAA
|
||||
environment: staging
|
||||
user: ansible
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue