choria-plugins / nettest-agent

Choria Plugin capable of performing basic TCP and ICMP connectivity tests
Apache License 2.0
1 stars 2 forks source link

Broken Archlinux support #6

Closed bastelfreak closed 6 years ago

bastelfreak commented 6 years ago

this module tries to install net-ping with the puppet_gem provider. Archlinux doesn't use the AIO packages, so it has no vendored ruby version. All dependencies for choria need to be installed as packages, not gems. I want to contribute a fix for this, like I did it in https://github.com/choria-io/mcollective-choria/issues/434, but the directory structure in this module is a bit confusing. Could you explain how the module is generated? I'm happy to submit patches.

ripienaar commented 6 years ago

I will write something up tomorrow for you

But a question when you say it tries to install it I am. It sure it follows. I on purpose (I think) avoided installing gem dependencies here and one or two others that have them for this reason

The docs says to add the data to install the dependency with gem - but that’s a choice on operating systems that do their own thing it’s up to those users to figure out how to drop the dependency

So as far as I can tell this does not try to install it. It just asks you to satisfy it somehow

Isn’t that the case?

If you disable gem management in the main mcollective module no plugins will try to install any gems.

ripienaar commented 6 years ago

“...install it I am. It sure it follows. ” I mean “...install it I am not sure I follow.”

On mobile and can’t edit comments.

bastelfreak commented 6 years ago

My Archlinux specific hiera setting:

---
mcollective_choria::manage_gem_dependencies: false

And in my global hiera config I got something like this:

mcollective_agent_nettest::gem_dependencies:
  "sys-proctable": "1.2.0"
mcollective_agent_nettest::gem_dependencies:
  "net-ping": "2.0.2"
mcollective::client: false
mcollective::server: true
mcollective::server_config:
  rpcauditprovider: 'choria'
  plugin.rpcaudit.logfile: '/var/log/puppetlabs/choria-audit.log'
mcollective::plugin_classes:
  - mcollective_agent_puppetca
  - mcollective_agent_puppet
  - mcollective_agent_nrpe
  - mcollective_agent_service
  - mcollective_agent_package
  - mcollective_util_actionpolicy
  - mcollective_agent_filemgr
  - mcollective_agent_iptables
  - mcollective_data_sysctl
  - mcollective_agent_shell
  - mcollective_agent_process
  - mcollective_agent_nettest

My thought was to install the gems via the puppet_gem provider on all operatingsystems that I have, except for archlinux. Arch is currently (besides freebsd) the only distributions we use without the AIO packages.


The error I get in during a Puppet run on my archlinux boxes:

Error: /Stage[main]/Mcollective_agent_nettest/Mcollective::Module_plugin[mcollective_agent_nettest]/Package[net-ping]: Provider puppet_gem is not functional on this host
bastelfreak commented 6 years ago

I just noticed that there is a copy and paste issue in my hiera config, I define the mcollective_agent_nettest::gem_dependencies key twice. Will rework this.

ripienaar commented 6 years ago

Hmm ok then something is wrong in the choria/mcollective module it should honour what you have

This specific plugin gets built using mco plugin package and while we can create arch specific data to avoid this here what you see is a larger issue - we don’t need to fix these plugins in this way.

So I have to dig into there. If you want check there is a defined type https://github.com/choria-io/puppet-mcollective/blob/master/manifests/module_plugin.pp that’s to blame

bastelfreak commented 6 years ago

I corrected my global hiera config to:

mcollective_agent_process::gem_dependencies:
  sys-proctable: 1.2.0
mcollective_agent_nettest::gem_dependencies:
  net-ping: 2.0.2
mcollective::client: false
mcollective::server: true
mcollective::server_config:
  rpcauditprovider: 'choria'
  plugin.rpcaudit.logfile: '/var/log/puppetlabs/choria-audit.log'
mcollective::plugin_classes:
  - mcollective_agent_puppetca
  - mcollective_agent_puppet
  - mcollective_agent_nrpe
  - mcollective_agent_service
  - mcollective_agent_package
  - mcollective_util_actionpolicy
  - mcollective_agent_filemgr
  - mcollective_agent_iptables
  - mcollective_data_sysctl
  - mcollective_agent_shell
  - mcollective_agent_process
  - mcollective_agent_nettest

Arch specific:

---
mcollective_choria::manage_gem_dependencies: false
mcollective_agent_nettest:manage_gem_dependencies: false

Now with two errors:

Error: /Stage[main]/Mcollective_agent_process/Mcollective::Module_plugin[mcollective_agent_process]/Package[sys-proctable]: Provider puppet_gem is not functional on this host
Error: /Stage[main]/Mcollective_agent_nettest/Mcollective::Module_plugin[mcollective_agent_nettest]/Package[net-ping]: Provider puppet_gem is not functional on this host

which makes a bit more sense now. The agent_process and the agent_testtest modules are failing and they have the same structure. The mcollective module itself works, it doesn't try to install the nats-pure gem.

ripienaar commented 6 years ago

Looks like I am wrong he define does not inherit this setting from the main class. We should fix that then this will work

ripienaar commented 6 years ago

You are missing a : in

mcollective_agent_nettest:manage_gem_dependencies: false
bastelfreak commented 6 years ago

ahhhhh

bastelfreak commented 6 years ago

That is working for me. Still if you're interesting in out-of-the-box archlinux support I'm happy to supply patches for it.

ripienaar commented 6 years ago

Nice. We should add a global flag to enable/disable gem management for all plugins like I thought we had.

Then this will be much smoother. Fwiw you can set

mcollective_agent_nettest::package_dependencies

To your OS packages and things will happen in the right way and use native packages :)

Since we don’t auto install gems (I want people to make the decision themselves) I want to avoid auto installing native packages too here but maybe a doc update?

ripienaar commented 6 years ago

closing this one then, tracking the general improvement in https://github.com/choria-io/puppet-mcollective/issues/161