voxpupuli/puppet-rabbitmq

rabbitmqadmin install broke with ipv6

mbaldessari opened this issue · 6 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: puppet-4.8.2-2.el7ost.noarch
  • Ruby: ruby-2.0.0.648-34.el7_6.x86_64
  • Distribution: RHEL 7.6
  • Module version: puppet-rabbitmq-8.1.1-0.20180216013831.d4b06b7.el7ost.noarch

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

In the TripleO project we use a simple 'include ::rabbitmq' for the undercloud. When the rabbitmq::{management_ip_address,node_ip_address} is set to an IPv6 address it now fails with the following:

What are you seeing

The default provider of the archive class (curl) fails when downloading from an ipv6 ip.

What behaviour did you expect instead

IIRC this used to work before f223f66 (aka before we moved to the archive {} class). As a matter of fact now all the $curl_prefix instances are unused:

$ grep -ir curl_prefix
manifests/install/rabbitmqadmin.pp:      $curl_prefix = ''
manifests/install/rabbitmqadmin.pp:      $curl_prefix  = "--noproxy ${management_ip_address} -g -6"
manifests/install/rabbitmqadmin.pp:      $curl_prefix  = "--noproxy ${management_ip_address}"

Output log

2019-04-11 14:02:25,220 INFO: Notice: /Stage[main]/Rabbitmq/Rabbitmq_plugin[rabbitmq_management]/ensure: created
2019-04-11 14:02:28,853 INFO: Notice: /Stage[main]/Rabbitmq::Service/Service[rabbitmq-server]/ensure: ensure changed 'stopped' to 'running'
2019-04-11 14:02:28,884 INFO: Error: Execution of '/bin/curl http://[abcd:abcd:abcd:abcd:c0:fe0:0:c000]:15672/cli/rabbitmqadmin -o /tmp/rabbitmqadmin_20190411-26312-58b4zx -fsSL --max-redirs 5 --user 4a670a54492e90e2379f3e6f20c0896fe5eca17e:e01decab4b54a9f2cd1e5601d505aba7a8dde27f --insecure' returned 3: curl: (3) [globbing] error: bad range specification after pos 9
2019-04-11 14:02:28,885 INFO: Error: /Stage[main]/Rabbitmq::Install::Rabbitmqadmin/Archive[rabbitmqadmin]/ensure: change from absent to present failed: Execution of '/bin/curl http://[abcd:abcd:abcd:abcd:c0:fe0:0:c000]:15672/cli/rabbitmqadmin -o /tmp/rabbitmqadmin_20190411-26312-58b4zx -fsSL --max-redirs 5 --user 4a670a54492e90e2379f3e6f20c0896fe5eca17e:e01decab4b54a9f2cd1e5601d505aba7a8dde27f --insecure' returned 3: curl: (3) [globbing] error: bad range specification after pos 9
2019-04-11 14:02:28,885 INFO: Notice: /Stage[main]/Rabbitmq::Install::Rabbitmqadmin/File[/usr/local/bin/rabbitmqadmin]: Dependency Archive[rabbitmqadmin] has failures: true
2019-04-11 14:02:28,885 INFO: Warning: /Stage[main]/Rabbitmq::Install::Rabbitmqadmin/File[/usr/local/bin/rabbitmqadmin]: Skipping because of failed dependencies

Any additional information you'd like to impart

We can work around it by setting rabbitmq::archive_options: [ "-g" ] in hiera. Ideally this should work out of the box in case of ipv6 (as it used to)

What's interesting is that g does seem to be in the default options for curl in current version of puppet-archive:
https://github.com/voxpupuli/puppet-archive/blob/2a76ca057beda43c59e62bbf9e049380dc273cc5/lib/puppet/provider/archive/curl.rb#L22

My take is that probably, if a fix is needed, it should be in puppet-archive, rather than in this module?

@mbaldessari I do not think this problem is related to the variable curl_preifix because it is not used anywhere. Can you please check which version of puppet-archive you are using? The option g was introduced with puppet-archive 3.0.0.

Oh, I see, thanks for the pointer. Yes indeed in this environment I had a puppet-archive < 3.0.0. Let me retest with a more recent version. Mind if I push a PR removing the unused curl_prefix vars? I got a bit confused there.

@mbaldessari No problem. Please let me know if your tests were successful and I would appreciate if you could provide a pull request.

Ack, I confirm that a with a puppet-archive cherry-pick of voxpupuli/puppet-archive@dcac140 fixes this issue. #800 proposed to remove the unused stuff.

Closing this one out. Thanks for the help!

We could consider bumping the lower bound for archive version for the next major release, though not sure if it's worth it - that might create inconveniences for people who might depend on other versions of it.