choria-plugins / shell-agent

Choria Plugin for running arbitrary shell commands
Apache License 2.0
1 stars 2 forks source link

mco shell plugin doesn't load #15

Closed jstewart612 closed 3 years ago

jstewart612 commented 3 years ago

Here's my hieradata:

choria::server: true
mcollective_choria::config:
  security.serializer: "json"
mcollective::plugin_classes:
  - mcollective_agent_bolt_tasks
  - mcollective_agent_shell

Here's what an "mco shell" run does:

mgmt001 agent [tools.useast2] # mco shell
The Marionette Collective version 2.24.1

Unknown command 'shell', searched for applications in:

   /opt/puppetlabs/mcollective/plugins
   /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib
   /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/systemu-2.6.5/lib
   /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/nats-pure-0.6.2/lib
   /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/choria-mcorpc-support-2.24.2/lib
   /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0
   /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.5.0/x86_64-linux
   /opt/puppetlabs/puppet/lib/ruby/site_ruby
   /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.5.0
   /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.5.0/x86_64-linux
   /opt/puppetlabs/puppet/lib/ruby/vendor_ruby
   /opt/puppetlabs/puppet/lib/ruby/2.5.0
   /opt/puppetlabs/puppet/lib/ruby/2.5.0/x86_64-linux

Known commands:

   choria               completion           facts
   federation           find                 help
   inventory            ping                 playbook
   plugin               r10k                 rpc
   tasks

Type '/bin/mco help' for a detailed list of commands and '/bin/mco help command'
to get detailed help for a command

mgmt001 agent [tools.useast2] #

I don't know why it says this because:

mgmt001 plugins [tools.useast2] # find /opt/puppetlabs/mcollective/plugins/ -name "*shell*"
/opt/puppetlabs/mcollective/plugins/mcollective/agent/shell.ddl
/opt/puppetlabs/mcollective/plugins/mcollective/agent/shell.rb
/opt/puppetlabs/mcollective/plugins/mcollective/agent/shell
/opt/puppetlabs/mcollective/plugins/mcollective/agent/shell.json
mgmt001 plugins [tools.useast2] #

Am I missing something?

If I manually copy https://github.com/choria-plugins/shell-agent/blob/master/application/shell.rb to /opt/puppetlabs/mcollective/plugins/mcollective/application/, it just works. Is there some param I'm not setting?

ripienaar commented 3 years ago

The mco shell command would only be on machines marked as clients and will not be installed on all managed servers. So check on one of your client machines

jstewart612 commented 3 years ago

Oh, that was supposed to be the client machine.

jstewart612 commented 3 years ago

.... if I didn't fat-finger the node name.

User error. Closing.

jstewart612 commented 3 years ago

My apologies.

ripienaar commented 3 years ago

So it goes, glad its working now :)