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

Native YAML - messaging (#3599)

This commit is contained in:
Fabio Alessandro Locati 2016-12-01 13:59:53 +00:00 committed by Matt Clay
parent 5209969a7c
commit 8a6df38cc5
8 changed files with 60 additions and 26 deletions

View file

@ -94,10 +94,18 @@ options:
EXAMPLES = '''
# Bind myQueue to directExchange with routing key info
- rabbitmq_binding: name=directExchange destination=myQueue type=queue routing_key=info
- rabbitmq_binding:
name: directExchange
destination: myQueue
type: queue
routing_key: info
# Bind directExchange to topicExchange with routing key *.info
- rabbitmq_binding: name=topicExchange destination=topicExchange type=exchange routing_key="*.info"
- rabbitmq_binding:
name: topicExchange
destination: topicExchange
type: exchange
routing_key: *.info
'''
import requests

View file

@ -80,10 +80,14 @@ options:
EXAMPLES = '''
# Create direct exchange
- rabbitmq_exchange: name=directExchange
- rabbitmq_exchange:
name: directExchange
# Create topic exchange on vhost
- rabbitmq_exchange: name=topicExchange type=topic vhost=myVhost
- rabbitmq_exchange:
name: topicExchange
type: topic
vhost: myVhost
'''
import requests

View file

@ -63,10 +63,11 @@ options:
EXAMPLES = """
# Set the federation parameter 'local_username' to a value of 'guest' (in quotes)
- rabbitmq_parameter: component=federation
name=local-username
value='"guest"'
state=present
- rabbitmq_parameter:
component: federation
name: local-username
value: '"guest"'
state: present
"""
class RabbitMqParameter(object):

View file

@ -56,7 +56,9 @@ options:
EXAMPLES = '''
# Enables the rabbitmq_management plugin
- rabbitmq_plugin: names=rabbitmq_management state=enabled
- rabbitmq_plugin:
names: rabbitmq_management
state: enabled
'''
import os

View file

@ -74,13 +74,19 @@ options:
EXAMPLES = '''
- name: ensure the default vhost contains the HA policy via a dict
rabbitmq_policy: name=HA pattern='.*'
rabbitmq_policy:
name: HA
pattern: .*
args:
tags:
"ha-mode": all
ha-mode: all
- name: ensure the default vhost contains the HA policy
rabbitmq_policy: name=HA pattern='.*' tags="ha-mode=all"
rabbitmq_policy:
name: HA
pattern: .*
tags:
- ha-mode: all
'''
class RabbitMqPolicy(object):
def __init__(self, module, name):

View file

@ -94,10 +94,15 @@ options:
EXAMPLES = '''
# Create a queue
- rabbitmq_queue: name=myQueue
- rabbitmq_queue:
name: myQueue
# Create a queue on remote host
- rabbitmq_queue: name=myRemoteQueue login_user=user login_password=secret login_host=remote.example.org
- rabbitmq_queue:
name: myRemoteQueue
login_user: user
login_password: secret
login_host: remote.example.org
'''
import requests

View file

@ -107,20 +107,26 @@ options:
EXAMPLES = '''
# Add user to server and assign full access control on / vhost.
# The user might have permission rules for other vhost but you don't care.
- rabbitmq_user: user=joe
password=changeme
vhost=/
configure_priv=.*
read_priv=.*
write_priv=.*
state=present
- rabbitmq_user:
user: joe
password: changeme
vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
state: present
# Add user to server and assign full access control on / vhost.
# The user doesn't have permission rules for other vhosts
- rabbitmq_user: user=joe
password=changeme
permissions=[{vhost='/', configure_priv='.*', read_priv='.*', write_priv='.*'}]
state=present
- rabbitmq_user:
user: joe
password: changeme
permissions:
- vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
state: present
'''
class RabbitMqUser(object):

View file

@ -55,7 +55,9 @@ options:
EXAMPLES = '''
# Ensure that the vhost /test exists.
- rabbitmq_vhost: name=/test state=present
- rabbitmq_vhost:
name: /test
state: present
'''
class RabbitMqVhost(object):