Remove the old fedmsg module.
This commit is contained in:
parent
1ed6213786
commit
c8e12740b6
2 changed files with 0 additions and 101 deletions
|
@ -1,81 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# (c) 2013, Ralph Bean <rbean@redhat.com>
|
|
||||||
# LGPLv2+
|
|
||||||
#
|
|
||||||
# You can pass this action an arbitrary number of kw arguments which will be
|
|
||||||
# used to make up the main message body (json).
|
|
||||||
#
|
|
||||||
# Dedicated to Seth Vidal. This was his idea.
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
|
||||||
---
|
|
||||||
module: fedmsg
|
|
||||||
short_description: Publish a message to fedmsg.
|
|
||||||
description:
|
|
||||||
- Send a message to a fedmsg-relay daemon.
|
|
||||||
options:
|
|
||||||
topic:
|
|
||||||
description:
|
|
||||||
- The short portion of the message topic.
|
|
||||||
required: false
|
|
||||||
default: log
|
|
||||||
modname:
|
|
||||||
description:
|
|
||||||
- The modname portion of the message topic.
|
|
||||||
required: false
|
|
||||||
default: ansible
|
|
||||||
|
|
||||||
requirements: [ fedmsg ]
|
|
||||||
author: Ralph Bean
|
|
||||||
'''
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
|
||||||
- fedmsg: msg="Testing this out"
|
|
||||||
|
|
||||||
- local_action: fedmsg
|
|
||||||
topic="run.complete"
|
|
||||||
msg="{{ ansible_date_time.iso8601 }}"
|
|
||||||
'''
|
|
||||||
|
|
||||||
import fedmsg
|
|
||||||
import fedmsg.config
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
|
|
||||||
module = AnsibleModule(
|
|
||||||
argument_spec=dict(
|
|
||||||
topic=dict(default="log"),
|
|
||||||
modname=dict(default="ansible"),
|
|
||||||
cert_prefix=dict(default="ansible"),
|
|
||||||
),
|
|
||||||
check_invalid_arguments=False,
|
|
||||||
supports_check_mode=True
|
|
||||||
)
|
|
||||||
|
|
||||||
topic = module.params.pop('topic')
|
|
||||||
modname = module.params.pop('modname')
|
|
||||||
cert_prefix = module.params.pop('cert_prefix')
|
|
||||||
|
|
||||||
try:
|
|
||||||
config = fedmsg.config.load_config()
|
|
||||||
config.update(dict(
|
|
||||||
name='relay_inbound',
|
|
||||||
cert_prefix=cert_prefix,
|
|
||||||
active=True,
|
|
||||||
))
|
|
||||||
fedmsg.init(**config)
|
|
||||||
except Exception, e:
|
|
||||||
module.fail_json(msg="unable to initialize fedmsg: %s" % e)
|
|
||||||
|
|
||||||
try:
|
|
||||||
fedmsg.publish(modname=modname, topic=topic, msg=module.params)
|
|
||||||
except Exception, e:
|
|
||||||
module.fail_json(msg="unable to send to fedmsg: %s" % e)
|
|
||||||
|
|
||||||
module.exit_json(changed=False, **module.params)
|
|
||||||
|
|
||||||
# this is magic, see lib/ansible/module_common.py
|
|
||||||
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
|
||||||
main()
|
|
|
@ -3,16 +3,6 @@
|
||||||
# NOTE: make sure there is room/space for this server on the vmhost
|
# NOTE: make sure there is room/space for this server on the vmhost
|
||||||
# NOTE: most of these vars come from group_vars/badges-web* or from hostvars
|
# NOTE: most of these vars come from group_vars/badges-web* or from hostvars
|
||||||
|
|
||||||
- name: emit a fedmsg message that we are done
|
|
||||||
hosts: badges-web;badges-web-stg
|
|
||||||
user: root
|
|
||||||
gather_facts: False
|
|
||||||
tasks:
|
|
||||||
- local_action: fedmsg
|
|
||||||
cert_prefix="shell"
|
|
||||||
topic="playbook.start"
|
|
||||||
msg="just a test that we are starting"
|
|
||||||
|
|
||||||
- name: make badges-web server
|
- name: make badges-web server
|
||||||
hosts: badges-web;badges-web-stg
|
hosts: badges-web;badges-web-stg
|
||||||
user: root
|
user: root
|
||||||
|
@ -61,13 +51,3 @@
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- include: $handlers/restart_services.yml
|
- include: $handlers/restart_services.yml
|
||||||
|
|
||||||
- name: emit a fedmsg message that we are done
|
|
||||||
hosts: badges-web;badges-web-stg
|
|
||||||
user: root
|
|
||||||
gather_facts: False
|
|
||||||
tasks:
|
|
||||||
- local_action: fedmsg
|
|
||||||
cert_prefix="shell"
|
|
||||||
topic="playbook.complete"
|
|
||||||
msg="just a test that we are completing"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue