Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider does not return package resource information #8

Closed
sudodevnull opened this issue Sep 15, 2017 · 8 comments
Closed

Provider does not return package resource information #8

sudodevnull opened this issue Sep 15, 2017 · 8 comments

Comments

@sudodevnull
Copy link

The update to self.instances to remove the puppet resource package error, does not return valid package resource information.

@bespokebob
Copy link
Contributor

True, but does it need to? The agent package should only be managed inside this module. Why do you need the resource command to return the agent information?

@bespokebob
Copy link
Contributor

The "real" installed package is a native OS package (rpm, deb, etc.), and will show up (as TWAgent or something similar) under that provider. It would be somewhat redundant for the custom provider to also report the package as installed.

I just don't understand exactly why you need the provider to report something with the "resource" command. What are you trying to do with this information? If you are trying to get an inventory of installed packages, then the resource command should already report the native package as being installed (assuming the other issue - the missing self.instances method - is fixed). If you are trying to turn the output of the "resource" command into a manifest to use in some way, then you will have difficulty managing the package outside of this module (as you'll need all the extra command-line arguments as well).

@bespokebob
Copy link
Contributor

The custom provider just makes the install.pp manifest simpler. The installer on non-Windows OS is provided as an executable .bin file that is a wrapper around the native package, and an uninstall.sh script that handles removing it. It could probably be handled differently with several command resources and maybe a custom fact, but it would be a bit messy, and need to be handled differently on Windows. The package provider gives the exact interface needed to handle installing a package in a non-standard way, so that's what I went with.

@joshsleeper
Copy link

@sudodevnull I don't think @youngbob has an issue with the custom provider working properly.
I think he's just looking to understand exactly what you're trying to do, and how #7 resolves that problem for you.

Reading through both this issue and the PR, I'm also confused about what the goal is.
Can you try to clearly spell out both the problem you want to solve as well as your use case where this problem is affecting you?

@sudodevnull
Copy link
Author

When you run 'puppet resource package' on a node, it does not return the package information. Adding this adds the package and version.

@bespokebob
Copy link
Contributor

As I already explained, the "resource" command does, in fact, return the package information. It returns the native packages that are installed by the .bin installer. I don't see why you need an additional resource listed for the .bin installer, since it isn't the real package that is installed.

@bespokebob
Copy link
Contributor

After installing the agent on my CentOS 7 box, and without your changes, I have:

package { 'TWeagent':
  ensure => '8.5.3-0',
}

package { 'teagent-realtime':
  ensure => '0.9-el7.3',
}

The first package is the main agent package, which is I think is exactly what you're looking for.

@bespokebob
Copy link
Contributor

There doesn't seem to be any possible way that your change could have caused a package named teagent-realtime to appear, since your change will only ever return a package named te_agent, and because teagent-realtime is an installed rpm. You should be able to see both packages installed with rpm -qa | grep agent. If Puppet is not returning all installed rpms for some reason, it is not an issue with this module.

And as I have already said before, the custom provider is only intended to be used inside this module. If there were some way to make it "private", then I would. There should be no reason to try to use it directly. If you want to enforce a version of the agent, you can do that through the module already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants