puppetlabs-toy-chest / puppetlabs-package_updates

Package update discovery Puppet Face and custom Facter fact
12 stars 6 forks source link

face doesn't seem to be loading...? #6

Closed sjoeboo closed 8 years ago

sjoeboo commented 8 years ago

So I wanted to kick the tires on this as it looked cool, but, so far, no luck...

Module is installed:

[root@master modules]# pwd
/etc/puppetlabs/code/environments/production/modules
[root@master modules]# ls -l package_updates/
total 20
-rw-r--r-- 1 vagrant vagrant   73 Jan 12 06:30 CHANGELOG.md
-rw-r--r-- 1 vagrant vagrant  352 Jan 12 06:32 checksums.json
drwxr-xr-x 3 vagrant vagrant   19 Jan 12 16:32 lib
drwxr-xr-x 2 vagrant vagrant   20 Jan 12 16:32 manifests
-rw-r--r-- 1 vagrant vagrant  771 Jan 12 06:32 metadata.json
-rw-r--r-- 1 vagrant vagrant 4477 Jan 12 06:28 README.md

But, a client, which IS getting the package updates class, doesn't have the face available:

[root@sensu ~]# cat /opt/puppetlabs/puppet/cache/state/classes.txt  | grep package_updates
package_updates
[root@sensu ~]# ls -l /opt/puppetlabs/puppet/cache/lib/puppet/
face/       feature/    functions/  package.rb  parser/     provider/   type/       util/
[root@sensu ~]# ls -l /opt/puppetlabs/puppet/cache/lib/puppet/face/
total 4
-rw-r--r-- 1 root root 3039 Jan 13 10:17 package.rb
[root@sensu ~]# puppet package
Error: Unknown Puppet subcommand 'package'
See 'puppet help' for help on available puppet subcommands

Cron job was created:

# Puppet Name: package_updates
* 3 * * * puppet package updates --render-as json > /etc/puppetlabs/facter/facts.d/package_updates.json

But thats it.

[root@sensu ~]# puppet --version
4.3.1
[root@sensu ~]# ls -l /opt/puppetlabs/puppet/cache/lib/puppet/face/
total 4
-rw-r--r-- 1 root root 3039 Jan 13 10:17 package.rb
ptierno commented 8 years ago

also experiencing this

ccaum commented 8 years ago

Hmm, the face should be available after pluginsync. You shouldn't have to modify the RUBYLIB like you used to in Puppet. I'll try it out on a fresh agent install.

ptierno commented 8 years ago

pluginsync is enabled. and the updates action is listed in the output of puppet help package

[root@puppet-us-east-1 ~]# puppet config print pluginsync
true
[root@puppet-us-east-1 ~]# puppet help package

USAGE: puppet package <action> [--terminus TERMINUS] [--extra HASH] 

This subcommand interacts with package objects, using the default provider.
Upgrading multiple packages and viewing what updates are available for any
package type requires providers  that supports 'versionable' and 'upgradeable'.

OPTIONS:
  --render-as FORMAT             - The rendering format to use.
  --verbose                      - Whether to log verbosely.
  --debug                        - Whether to log debug information.
  --extra HASH                   - Extra arguments to pass to the indirection
                                   request
  --terminus TERMINUS            - The indirector terminus to use.

ACTIONS:
  destroy    Invalid for this face. Use the resource subcommand
  find       Retrieve an object by name.
  info       Print the default terminus class for this face.
  list       List installed packages
  save       Invalid for this face. Use the resource subcommand
  search     Search for an object or retrieve multiple objects.
  update     Perform an update on a package
  updates    List all packages with updates available from packaging system

TERMINI: 

See 'puppet man package' or 'man puppet-package' for full help.
[root@puppet-us-east-1 ~]# puppet package updates --render-as json
Error: Unknown Puppet subcommand 'package'
See 'puppet help' for help on available puppet subcommands
ccaum commented 8 years ago

Looks like the application directory didn't get committed prior to release. Sorry about that. Take a look at PR #8. That should resolve the issue.

sjoeboo commented 8 years ago

Awesome, thanks, looks good to me!

ccaum commented 8 years ago

PR #8 resolves this.