voxpupuli / puppet-rabbitmq

RabbitMQ Puppet Module
http://forge.puppetlabs.com/puppet/rabbitmq
Apache License 2.0
172 stars 499 forks source link

Wrong rabbitmq-plugins command is used installing plugins #748

Closed rzitter closed 5 years ago

rzitter commented 5 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Install and configure a rabbitmq server for the first time and enable an extra plugin

What are you seeing

The extra plugins are enable but not running.

[root@rmq first_puppet]# rabbitmq-plugins list 
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@rmq
 |/
[  ] rabbitmq_amqp1_0                  3.7.7
[  ] rabbitmq_auth_backend_cache       3.7.7
[  ] rabbitmq_auth_backend_http        3.7.7
[  ] rabbitmq_auth_backend_ldap        3.7.7
[  ] rabbitmq_auth_mechanism_ssl       3.7.7
[  ] rabbitmq_consistent_hash_exchange 3.7.7
[  ] rabbitmq_event_exchange           3.7.7
[  ] rabbitmq_federation               3.7.7
[  ] rabbitmq_federation_management    3.7.7
[  ] rabbitmq_jms_topic_exchange       3.7.7
[E*] rabbitmq_management               3.7.7
[e*] rabbitmq_management_agent         3.7.7
[E ] rabbitmq_message_deduplication    0.3.5
[e ] rabbitmq_mqtt                     3.7.7
[  ] rabbitmq_peer_discovery_aws       3.7.7
[  ] rabbitmq_peer_discovery_common    3.7.7
[  ] rabbitmq_peer_discovery_consul    3.7.7
[  ] rabbitmq_peer_discovery_etcd      3.7.7
[  ] rabbitmq_peer_discovery_k8s       3.7.7
[  ] rabbitmq_random_exchange          3.7.7
[  ] rabbitmq_recent_history_exchange  3.7.7
[  ] rabbitmq_sharding                 3.7.7
[  ] rabbitmq_shovel                   3.7.7
[  ] rabbitmq_shovel_management        3.7.7
[  ] rabbitmq_stomp                    3.7.7
[  ] rabbitmq_top                      3.7.7
[  ] rabbitmq_tracing                  3.7.7
[  ] rabbitmq_trust_store              3.7.7
[e*] rabbitmq_web_dispatch             3.7.7
[E ] rabbitmq_web_mqtt                 3.7.7
[  ] rabbitmq_web_mqtt_examples        3.7.7
[  ] rabbitmq_web_stomp                3.7.7
[  ] rabbitmq_web_stomp_examples       3.7.7

What behaviour did you expect instead

The extra plugins are enabled and running

Output log

rmq.development.org - 2018-12-10 16:28:47: Debug: Puppet::Type::Rabbitmq_plugin::ProviderRabbitmqplugins: file /usr/lib/rabbitmq/bin/rabbitmq-plugins does not exist
rmq.development.org - 2018-12-10 16:28:47: Debug: Puppet::Type::Rabbitmq_plugin::ProviderRabbitmqplugins: file /usr/lib/rabbitmq/bin/rabbitmq-plugins does not exist
rmq.development.org - 2018-12-10 16:28:47: Debug: Puppet::Type::Rabbitmq_plugin::ProviderRabbitmqplugins: file /usr/lib/rabbitmq/bin/rabbitmq-plugins does not exist
rmq.development.org - 2018-12-10 16:28:47: Debug: Puppet::Type::Rabbitmq_plugin::ProviderRabbitmqplugins: file /usr/lib/rabbitmq/bin/rabbitmq-plugins does not exist
rmq.development.org - 2018-12-10 16:28:47: Debug: Puppet::Type::Rabbitmq_plugin::ProviderRabbitmqplugins: file /usr/lib/rabbitmq/bin/rabbitmq-plugins does not exist
rmq.development.org - 2018-12-10 16:30:16: Debug: Executing '/usr/lib/rabbitmq/bin/rabbitmq-plugins list -E -m'
rmq.development.org - 2018-12-10 16:30:18: Debug: Executing '/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management'
rmq.development.org - 2018-12-10 16:33:22: Debug: Executing '/usr/lib/rabbitmq/bin/rabbitmq-plugins list -E -m'
rmq.development.org - 2018-12-10 16:33:23: Debug: Executing '/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_message_deduplication'
rmq.development.org - 2018-12-10 16:33:26: Debug: Executing '/usr/lib/rabbitmq/bin/rabbitmq-plugins list -E -m'
rmq.development.org - 2018-12-10 16:33:27: Debug: Executing '/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_web_mqtt'

Any additional information you'd like to impart

Related to issue #566 and #570

wyardley commented 5 years ago

Which version does which rabbitmq-plugins give you? Does /sbin/rabbitmq-plugins exist, and is /sbin in the path of the user running Puppet at the time of the run? Does it only fail on the first run, and succeed on subsequent runs (idempotency problem), or does it fail every time (is the example debug output from a single run, or from two consecutive runs)?

Since the code uses which, you may be able to influence this by adjusting the PATH that your puppet run runs under.

If this is with RabbitMQ 3.7.x (which I'm assuming it is from the versions above), this module doesn't explicitly list support for that version yet. As you'll see in the current issues, there are some other issues which may affect later 3.7.x issues like 3.7.9 and later.