fiddyspence / mcoresource Goto Github PK
View Code? Open in Web Editor NEWPuppet resource to trigger mcollective runs
License: Other
Puppet resource to trigger mcollective runs
License: Other
When I use an identity filter mcoresource does not use it:
$repo_server = 'repo.domain.local'
...
mco { 'action':
...
agent => 'puppetd',
action => 'runonce',
filter => { 'identity' => [ $repo_server ] },
...
}
results in a debug log with an empty identiry filter:
debug: {:disctimeout=>2, :agent=>"puppetd", :collective=>"mcollective", :timeout=>2, :filter=>{"identity"=>[], "compound"=>[], "fact"=>[], "agent"=>[], "cf_class"=>[]}, :discovery_method=>nil, :discovery_options=>[], :config=>"/etc/mcollective/client.cfg", :verbose=>false, :mcollective_limit_targets=>false}
By the way, the action isn't shown in the debug, is this a possible net issue to log?
I'd like to use mcoresource for creating subversion repositories on a remote subversion server via storedconfigs. mco is used to fire the remote puppet-run to create the repo. Before and afterwards I use an exec for precheck and wait loop for remote puppetrun to complete. When de precheck results in executing a refresh event will be propagated:
debug: Exec[PreCheck_lvg9](provider=posix): Executing check '/usr/bin/svn list --username=svn_lvg9 --password=LVG9 --no-auth-cache --non-interactive --trust-server-cert https://svn.domain.local/lvg9 2>/dev/null'
debug: Executing '/usr/bin/svn list --username=svn_lvg9 --password=LVG9 --no-auth-cache --non-interactive --trust-server-cert https://svn.domain.local/lvg9 2>/dev/null'
debug: Exec[PreCheck_lvg9](provider=posix): Executing '/bin/true'
debug: Executing '/bin/true'
notice: /Stage[main]/Svn::Client/Svn::Reporemote[lvg9]/Exec[PreCheck_lvg9]/returns: executed successfully
debug: /Stage[main]/Svn::Client/Svn::Reporemote[lvg9]/Exec[PreCheck_lvg9]: The container Svn::Reporemote[lvg9] will propagate my refresh event
but mco is NOT executed!
I'm using the following code-snippet
$check = "/usr/bin/svn list --username=svn_${repo_name} --password=${repo_pw} --no-auth-cache --non-interactive --trust-server-cert https://${repo_server}/${repo_name} 2>/dev/null"
exec { "PreCheck_${repo_name}":
command => '/bin/true',
unless => $check,
logoutput => false,
require => Package["subversion-${svn::params::version}*"],
} ->
mco { "Create_${repo_name}":
agent => 'puppetd',
action => 'runonce',
filter => {
'identity' => [
$repo_server,
],
},
configfile => '/etc/mcollective/client.cfg',
} ->
exec { "Check_${repo_name}":
command => $check,
tries => 20,
try_sleep => 10,
logoutput => false,
refreshonly => true,
}
Adding refreshonly => true does not help, adding refreshonly => false results in an always executing mco and that is not wanted.
Collecive now defaults to mcollective, with the use of subcollectives I'd like to use a subcollective. See corresponding debug:
debug: {:disctimeout=>2, :agent=>"puppetd", :collective=>"mcollective", :timeout=>2, :filter=>{"identity"=>[], "compound"=>[], "fact"=>[], "agent"=>[], "cf_class"=>[]}, :discovery_method=>nil, :discovery_options=>[], :config=>"/etc/mcollective/client.cfg", :verbose=>false, :mcollective_limit_targets=>false}
Example call with subcollective definition:
mco { 'action':
agent => $agent,
action => $action,
filter => $filter,
configfile => $configfile,
collective => $subcollective,
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.