puppet-mcollective
puppet-mcollective copied to clipboard
refresh-mcollective-metadata produces invalid fact file
Following PRs https://github.com/voxpupuli/puppet-mcollective/pull/346 https://github.com/voxpupuli/puppet-mcollective/pull/353 and https://github.com/voxpupuli/puppet-mcollective/pull/358 the refresh-mcollective-metadata cronjob still produces a file that mcollective is not able to correctly parse.
Mcollective assumes all the facts will be top level keys. Instead they are now all nested under values.
See https://github.com/voxpupuli/puppet-mcollective/pull/346#issuecomment-351820746
A few options I could think of...
- Revert the PRs.
- Have the cron somehow parse the output of
puppet factsto extract thevalueshash. - Submit a PR to mcollective (patching this)
argh :) and I first thought my mco facter filters are wrong.. I workaround this with an ugly sed:
- remove the 3rd line (values:)
- remove the two spaces of the yaml at the beginning of every line
|sed '3d' | sed 's/^ //'
I just change the command for refresh-mcollective-metadata cron in modules/mcollective/manifests/server/config/factsource/yaml.pp as follows:
cron { 'refresh-mcollective-metadata':
command => "facter -p --yaml >${yaml_fact_path_real} 2>&1",
....