I've did more checks. I've updated aws api. Now command looks like:
aws ec2 describe-tags --filters Name=resource-id,Values=instance_id |
grep Role | /bin/cut -f5
Custom and external facts with this string still not works. Facter see it's
ok, but mcollective - doesn't.
I've created cronjob that run this command and send value to file. Created
external fact that cat file and echo role=$role. Mcollective worked fine.
On Saturday, August 2, 2014 9:57:07 PM UTC+3, Maxim Nikolaev wrote:
Hello
I met following issue with mcollective puppet agent.
I have custom fact that read tags from AWS cli and transform them to facts.
Facter.add(role) do
setcode do
iregion = Facter.value(ec2_region)
Facter::Util::Resolution.exec(ec2-describe-tags --region #{iregion} -O
KEY -W SEC_KEY --filter \resource-id=$(ec2-metadata -i | cut -d \ \
-f2)\ --filter \key=Role\ | cut -f5 -)
end
end
When I run facter from instance aor puppet agent from instance itself -
everything working fine.
When I run pupper runnonce from mcollective server - it doesn't read this
fact and apply only common manifest.
I checked several times and found, that if I set static file with role and
use external fact like:
#!/bin/bash
role=`grep Role /etc/server_facts | awk '{print $NF}'`
echo role=$role
Mcollective works fine. If Itry to use AWS cli command in script - again
fact doesn't wrk.
Have someone met such problem with mcollective? Can someone advise?
Puppet 3.6.2
Mcollective 2.5.3
--
You received this message because you are subscribed to the Google Groups
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/db88a075-bf5c-4697-be6d-cb463397c436%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.