Skip to content
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

erlang_cookie detection was better when NOT facter based #94

Closed
zeph opened this issue Jul 26, 2013 · 7 comments
Closed

erlang_cookie detection was better when NOT facter based #94

zeph opened this issue Jul 26, 2013 · 7 comments

Comments

@zeph
Copy link

zeph commented Jul 26, 2013

the new erlang_cookie change detection is based on a facter
...which is not covered by an rspec btw (I'm trying to, any help is welcome)
seems to lead a continuous un-needed erlang/rabbitmq db deletion

based on the feedback from my colleagues,
the previous implementation "file based" seems to be preferred and more portable across puppet versions

      exec { 'wipe_db':
        command => '/etc/init.d/rabbitmq-server stop; /bin/rm -rf /var/lib/rabbitmq/mnesia',
        require => Package[$package_name],
        unless  => "/bin/grep -qx ${erlang_cookie} /var/lib/rabbitmq/.erlang.cookie"
      }
@jurgenweber
Copy link

To sum it up; using puppet 2.7.22-1puppetlabs1, the custom fact rabbitmq_erlang_cookie seems to be not available to the client so if $erlang_cookie != $::rabbitmq_erlang_cookie { is always evaluating to true. A fact should just be available so just like a the $hostname fact I should be able to reference it with $rabbitmq_erlang_cookie....... but its always ""/null. I am very confused. :)

@apenney
Copy link
Contributor

apenney commented Jul 26, 2013

Before I start digging into this I just want to check the very obvious case of making sure pluginsync is enabled for your 2.7 clients, right?

@jurgenweber
Copy link

confirmed, pluginsync is on:

info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
info: Caching catalog for node0.shop.com
info: Applying configuration version '1374851492'
notice: /Stage[main]/Rabbitmq::Config/Exec[wipe_db]/returns: executed successfully
info: Class[Rabbitmq::Config]: Scheduling refresh of Class[Rabbitmq::Service]
info: Class[Rabbitmq::Service]: Scheduling refresh of Service[rabbitmq-server]
notice: /Stage[main]/Rabbitmq::Service/Service[rabbitmq-server]/ensure: ensure changed 'stopped' to 'running'
notice: /Stage[main]/Rabbitmq::Service/Service[rabbitmq-server]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 27.07 seconds
root@node0:~# cat /etc/puppet/puppet.conf
[main]
server=middleware.shop.com
listen=true
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
pluginsync=true

@apenney
Copy link
Contributor

apenney commented Jul 26, 2013

Urgh, so embarrassing - #97 fixes this and I'll merge it tomorrow as I'm about to head out of the door. Sorry about this. I'm going to add spec tests for the fact as soon as I can get them to work properly!

@jurgenweber
Copy link

no need to be embarrassed. :)

after merging your commit I received the error: err: Failed to apply catalog: Could not find dependency Exec[wipe_db] for File[erlang_cookie] at /etc/puppet/modules/rabbitmq/manifests/config.pp:87

I assume the exec is never executed/processed when the if statement evaluates to true so you end up with this catch 22. I just removed the require.

@apenney
Copy link
Contributor

apenney commented Jul 29, 2013

I'll dig into this today, I'm working through this with a cold and conjunctivitis so hang in there while I stumble around and fix it up. :)

@apenney
Copy link
Contributor

apenney commented Jul 30, 2013

This should be fixed now in master.

@apenney apenney closed this as completed Jul 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants