Ask Your Question
0

How can I manage Solaris publishers?

asked 2017-07-17 23:49:27 -0600

wfsaxton gravatar image

updated 2017-07-17 23:49:59 -0600

I know Solaris has the "pkg_publisher" resource type but that only appears to work if you are using a Solaris puppet master. I'm running a Linux Puppet master but am trying to set up the publishers for my Solaris clients.

The best I could come up with is:

exec { 'solaris publisher':
    path => '/usr/bin:/usr/sbin',
    command => 'pkg set-publisher -g http://pkg.oracle.com/solaris solaris',
    unless => 'pkg publisher solaris | grep http://pkg.oracle.com/solaris'
 }

The obvious issue with this is that Puppet spawns 2 processes every time it needs to check this. Is there a better way?

edit retag flag offensive close merge delete

Comments

Where are two processes? First the unless-check, and then possibly the command, so? Or don't you like the `pkg pipe grep`-command? Then you could think of directly acting on the underlying files. But that's bad.

Kai Burghardt gravatar imageKai Burghardt ( 2017-07-18 05:10:14 -0600 )edit

The unless spawns 2 processes, pkg and grep. I don't run execs very often but they seem like a very resource-intensive way of doing things, no?

wfsaxton gravatar imagewfsaxton ( 2017-07-18 06:48:11 -0600 )edit

I don't think so. It's a legitimate approach and an easy to read command (KISS). So why not? It isn't like `pkg publisher solaris` outputs gigabytes of data `grep(1)` has to walk through.

Kai Burghardt gravatar imageKai Burghardt ( 2017-07-18 09:55:40 -0600 )edit

I guess I'm in a workplace where our nodes are running @ 75% capacity and every process spawn could be disruptive. In any case, I've provided the solution below.

wfsaxton gravatar imagewfsaxton ( 2017-07-18 10:18:37 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-07-18 07:27:32 -0600

wfsaxton gravatar image

You can install Oracle's solaris providers module and that will allow you to support Solaris-specific providers, such as pkg_publisher:

https://github.com/oracle/puppet-sola...

So, in your Puppetfile:

mod 'puppetlabs-stdlib', '4.17.0' 
mod 'solaris_providers',
    :git    => 'https://github.com/oracle/puppet-solaris_providers',
    :branch => 'master'
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-07-17 23:49:27 -0600

Seen: 41 times

Last updated: Jul 18