-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rabbitmq_plugin): add node to module args #106
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- rabbitmq_plugin - add node arguments. | ||
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -29,6 +29,11 @@ | |||||||
- Does not disable plugins that are not in the names list. | ||||||||
type: bool | ||||||||
default: "no" | ||||||||
node: | ||||||||
description: | ||||||||
- Erlang node name of the rabbit we wish to configure. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please also add a note that this use |
||||||||
type: str | ||||||||
default: rabbit | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
state: | ||||||||
description: | ||||||||
- Specify if plugins are to be enabled or disabled. | ||||||||
|
@@ -74,6 +79,12 @@ | |||||||
names: rabbitmq_peer_discovery_aws_plugin | ||||||||
state: enabled | ||||||||
broker_state: offline | ||||||||
|
||||||||
- name: Enables plugin with custom node name | ||||||||
community.rabbitmq.rabbitmq_plugin: | ||||||||
names: rabbitmq_management | ||||||||
state: enabled | ||||||||
node: bunny | ||||||||
''' | ||||||||
|
||||||||
RETURN = r''' | ||||||||
|
@@ -114,6 +125,8 @@ def __init__(self, module): | |||||||
def _exec(self, args, force_exec_in_check_mode=False): | ||||||||
if not self.module.check_mode or (self.module.check_mode and force_exec_in_check_mode): | ||||||||
cmd = [self._rabbitmq_plugins] | ||||||||
if self.module.params['node']: | ||||||||
cmd.extend(['-n', self.module.params['node']]) | ||||||||
rc, out, err = self.module.run_command(cmd + args, check_rc=True) | ||||||||
return out.splitlines() | ||||||||
return list() | ||||||||
|
@@ -139,6 +152,7 @@ def main(): | |||||||
arg_spec = dict( | ||||||||
names=dict(required=True, aliases=['name']), | ||||||||
new_only=dict(default='no', type='bool'), | ||||||||
node=dict(default='rabbit'), | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was just wondering, by specifying I was looking through the rabbitmq.server code on github, but, it seems quite time consuming to go back through all the versions looking for when I was wondering, can we guarantee backward compatibility by changing line 155 to:
At least then, the user can chose not to put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The option is here at least since rabbitmq:3.4.4 ( 11 February 2015 )
I personally prefer to have all modules working the same that having some specificities depending on the module There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking that. It appears that 3.4.4 is the earliest docker container.
The only risk with the proposed PR is that it will specify If we proceed as is, perhaps we consider adjusting the changelog fragment to include a message that this will be a breaking change if the users There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO all module should not force options if not mandatory but for an obscure reason Off-topic : For an example, #35 broke my ansible role because the choice was made to force There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Im0 / @Andersson007 : so, force or not force There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cognifloyd @Im0 @odyssey4me what do you think? @rockandska I'm unfortunately not an expert in the context, so i can provide only general feedback.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cognifloyd @Im0 @odyssey4me PTAL ^ Hope you folks have great holidays:) |
||||||||
state=dict(default='enabled', choices=['enabled', 'disabled']), | ||||||||
broker_state=dict(default='online', choices=['online', 'offline']), | ||||||||
prefix=dict(required=False, default=None) | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.