minor fixes

reviewable/pr18780/r1
Brian Coca 11 years ago
parent d1b1b2b6f3
commit 35a4e70dee

@ -18,18 +18,18 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
DOCUMENTATION = """ DOCUMENTATION = """
module: hall module: hall
short_description: Send notification to Hall short_description: Send notification to Hall
description: description:
- The M(hall) module connects to the U(https://hall.com) messaging API and allows you to deliver notication messages to rooms. - "The M(hall) module connects to the U(https://hall.com) messaging API and allows you to deliver notication messages to rooms."
version_added: 1.6 version_added: "2.0"
author: Billy Kimble <basslines@gmail.com> author: Billy Kimble (@bkimble) <basslines@gmail.com>
options: options:
room_token: room_token:
description: description:
- Room token provided to you by setting up the Ansible room integation on U(https://hall.com) - "Room token provided to you by setting up the Ansible room integation on U(https://hall.com)"
required: true required: true
msg: msg:
description: description:
@ -41,12 +41,12 @@ options:
required: true required: true
picture: picture:
description: description:
- The full URL to the image you wish to use for the Icon of the message. Defaults to U(http://cdn2.hubspot.net/hub/330046/file-769078210-png/Official_Logos/ansible_logo_black_square_small.png?t=1421076128627) - "The full URL to the image you wish to use for the Icon of the message. Defaults to U(http://cdn2.hubspot.net/hub/330046/file-769078210-png/Official_Logos/ansible_logo_black_square_small.png?t=1421076128627)"
required: false required: false
""" """
EXAMPLES = """ EXAMPLES = """
- name: Send Hall notifiation - name: Send Hall notifiation
local_action: local_action:
module: hall module: hall
room_token: <hall room integration token> room_token: <hall room integration token>
@ -57,7 +57,7 @@ EXAMPLES = """
when: ec2.instances|length > 0 when: ec2.instances|length > 0
local_action: local_action:
module: hall module: hall
room_token: <hall room integration token> room_token: <hall room integration token>
title: Server Creation title: Server Creation
msg: "Created EC2 instance {{ item.id }} of type {{ item.instance_type }}.\\nInstance can be reached at {{ item.public_ip }} in the {{ item.region }} region." msg: "Created EC2 instance {{ item.id }} of type {{ item.instance_type }}.\\nInstance can be reached at {{ item.public_ip }} in the {{ item.region }} region."
with_items: ec2.instances with_items: ec2.instances
@ -66,7 +66,7 @@ EXAMPLES = """
HALL_API_ENDPOINT = 'https://hall.com/api/1/services/generic/%s' HALL_API_ENDPOINT = 'https://hall.com/api/1/services/generic/%s'
def send_request_to_hall(module, room_token, payload): def send_request_to_hall(module, room_token, payload):
headers = {'Content-Type': 'application/json'} headers = {'Content-Type': 'application/json'}
payload=module.jsonify(payload) payload=module.jsonify(payload)
api_endpoint = HALL_API_ENDPOINT % (room_token) api_endpoint = HALL_API_ENDPOINT % (room_token)
response, info = fetch_url(module, api_endpoint, data=payload, headers=headers) response, info = fetch_url(module, api_endpoint, data=payload, headers=headers)
@ -83,7 +83,7 @@ def main():
picture = dict(type='str', default='http://cdn2.hubspot.net/hub/330046/file-769078210-png/Official_Logos/ansible_logo_black_square_small.png?t=1421076128627'), picture = dict(type='str', default='http://cdn2.hubspot.net/hub/330046/file-769078210-png/Official_Logos/ansible_logo_black_square_small.png?t=1421076128627'),
) )
) )
room_token = module.params['room_token'] room_token = module.params['room_token']
message = module.params['msg'] message = module.params['msg']
title = module.params['title'] title = module.params['title']

Loading…
Cancel
Save