Ask Your Question

bschonecker's profile - activity

2017-11-26 05:47:14 -0600 answered a question Issues synching yum.puppetlabs.com repo through Red Hat Satellite

To my understanding, Red Hat Satellite must be installed on RHEL7. I don't think it's supported on RHEL6.

2017-10-02 07:27:16 -0600 answered a question can puppet-agent be configured to run ONLY on port 443?

https://docs.puppet.com/puppet/latest/configuration.html#masterport

2017-09-26 00:33:44 -0600 received badge  Famous Question (source)
2017-07-11 16:49:37 -0600 received badge  Good Answer (source)
2017-07-11 16:49:37 -0600 received badge  Enlightened (source)
2017-06-18 20:33:59 -0600 commented question Is there support for Puppet on Oracle Linux/SPARC?

I built Puppet server and 'client' stuff from source RPMs for Red Hat 6 and 7 on zLinux/zVM. I have had zero issues in

2017-06-15 21:16:42 -0600 answered a question How to execute two commands one after the other in puppet program

You could pipe the STDOUT from the gzip command directly to tar and avoid two separate commands: gunzip --to-stdout /op

2017-05-02 06:17:38 -0600 commented question How to handle renamed or removed package versions from package manager (yum, apt, etc)?

Assuming linux, you could mirror the repository internally That way you can control what files are a part of the reposi

2017-04-21 10:17:39 -0600 edited answer How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet:///module/filename-${environment}.sh", Should do the trick on line #6 where you have filename-a.sh

2017-04-21 06:28:30 -0600 commented answer How to copy and install 3 different files from puppet master to 3 different locations , plz help

Ah, yes. I didn't catch that. I was focused on using the ${environment} variable.

2017-04-21 05:22:49 -0600 answered a question How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet:///module/files/filename-${environment}.sh", Should do the trick on line #6 where you have filena

2017-04-21 05:22:32 -0600 received badge  Associate Editor (source)
2017-04-21 05:22:32 -0600 edited answer How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet:///module/files/filename-${environment}.sh", Should do the trick on line #6 where you have filena

2017-04-21 05:21:43 -0600 edited answer How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet://module/files/filename-${environment}.sh", Should do the trick on line #6 where you have filename

2017-04-21 05:21:29 -0600 edited answer How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet://module/files/filename-${environment}.sh", Should do the trick on line #6 where you have filename

2017-04-21 05:21:14 -0600 edited answer How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet://module/files/filename-${environment}.sh", Should do the trick on line #6 where you have filename

2017-04-21 05:20:19 -0600 answered a question How to copy and install 3 different files from puppet master to 3 different locations , plz help

source => "puppet://module/files/filename-${environment}.sh", Should do the trick on line #6.

2017-04-17 03:04:31 -0600 received badge  Notable Question (source)
2017-04-07 05:34:10 -0600 commented question How to identify third-party dependencies that are used within puppet server?

If you search for 'dependencies' in the individual modules' metadata.json file, it'll show you the modules' dependencies on other modules.

2017-04-07 05:33:02 -0600 commented question How to identify third-party dependencies that are used within puppet server?

Are you talking about the OS layer code the puppet requires or are you talking about the include module list that puppet modules need themselves in order to run? For the former, 'rpm -q -R <puppetrpm> will show you the required packages puppet needs in order to run on Linux.

2017-03-30 14:19:13 -0600 received badge  Popular Question (source)
2017-03-29 14:25:00 -0600 received badge  Popular Question (source)
2017-03-22 06:23:26 -0600 answered a question Can I use a package resource here instead of exec?

Why aren't your admins managing YUM repos very well? That seems to be both the cause and solution to your problem; get them to start managing those repositories.

I recommend that you install a custom yum repository file in /etc/yum.repos.d that references the URL where your (custom?) package can be found.

Puppet can manage YUM repos just fine. Just make sure to order the resources properly.

A bit more hackishly:

file {'/path/to/your/rpm': ensure => present, source => 'puppet:///wherever/your/rpm/is', }

exec { "yum -y localinstall /path/to/your/rpm": path => ['/usr/bin'], unless => "rpm -q $packagename", requires => File['path/to/your/rpm', }

Of course, this is pseudo-code. Puppet will ensure the file is downloaded to your local OS first and then do a 'yum localinstall' on the RPM.

I still think using yum repos is a better way to manage what you're tring to accomplish.

2017-03-15 09:16:40 -0600 received badge  Popular Question (source)
2017-03-06 09:11:02 -0600 asked a question Dependency/Ordering two create_resources statements

I have some RPM packages that need to be installed on my Linux servers. However, there are som RPM/GPG keys that need to go on first. I have both GPG keys and RPM packages in hiera but I don't know how to set up the ordering when I use create_resource()

$rpmkeys = hiera_hash('rpmkeys')
create_resources('rpmkey', $rpmkeys)
$required_packages = hiera_array('required_packages')
create_resources('package', $required_packages)

I've tried putting a require in the Package create_resources() statement but puppet gives me errors:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error creating type specialization of a Rpmkey-Type, Cannot use Hash[String, Hash[String, String]] where a resource title String is expected at /etc/puppetlabs/code/modules/profiles/manifests/base.pp:99:33 on node liibt452.healthplan.com","issuekind":"RUNTIMEERROR"} Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Is there a way to specify that ALL rpmkeys are processed before ANY Package resource?

2017-02-24 08:56:23 -0600 commented answer How To Get Access Facter Hash Key in Puppet?

I think he wants to know what the value of the label even if it changes. I have the same issue. I have a one-element hash and I need to put the label into a variable no matter what the label's value.

2017-01-12 14:59:35 -0600 answered a question Add variable in line that contains double quotation mark (")

Assuming you're trying to use the fact $::hostname, why would you want to encase the fact in double-quotes? There's no need to do so. Just use $::hostname or if you must, $hostlocal = $::hostname should work.

2017-01-11 05:43:59 -0600 answered a question Template incompatible with Puppet 4 but works with Puppet 3

The problem was one of variable scope. The template thought that @email_recipients was nil so it always failed.

I've submitted a pull request to the owner of the module. I hope I used proper form 'fixing' the scope problem.

https://github.com/treydock/puppet-mo...

2017-01-11 04:59:06 -0600 asked a question Template incompatible with Puppet 4 but works with Puppet 3

Using 'setroubleshoot' module located at: https://github.com/treydock/puppet-mo..., I have been having trouble getting Puppet 4 to do a 'for each' loop in the template file against the hash (of hashes?).

When running on Puppet 4, the methods "keys.sort.each" fail for the hash @email_recipients in the template file:

    Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template setroubleshoot/email_alert_recipients.erb:

Filepath: /etc/puppetlabs/code/environments/setroubleshoot/modules/setroubleshoot/templates/emailalertrecipients.erb Line: 1 * Detail: undefined methodkeys' for nil:NilClass * at /etc/puppetlabs/code/environments/setroubleshoot/modules/setroubleshoot/manifests/config.pp:22:18 on node ltstd001.healthplan.com","issuekind":"RUNTIMEERROR"} Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Using the puppet site.pp file:

class { 'setroubleshoot': 
  email_recipients => { 'foo@example.com' => { 'filter_type' => 'after_first' } } 
}

Here's the template:

  <% @email_recipients.keys.sort.each do |recipient| -%>
  <% filter_type = @email_recipients[recipient]['filter_type'] || 'after_first' -%>
  <%= recipient %> filter_type=<%= filter_type %>
  <% end -%>

For the life of me I can't figure out why .keys.sort.each is failing. There's no issue with Puppet 3.x and I've not found any reason why the .keys, .each and .sort methods would have been deprecated (which wouldn't make any sense anyway).

2017-01-10 00:31:35 -0600 received badge  Popular Question (source)
2016-12-19 14:58:17 -0600 commented answer How to set a default value for a defined type where the variable is an array of hashes?

No, I'm trying to set the defined type default for ..directories=>options via a manifest.

2016-12-19 14:04:24 -0600 asked a question How to set a default value for a defined type where the variable is an array of hashes?

I have about 50 apache::vhost defines that need some 'refactoring'. I'm trying to set the resource to some default values but I'm having trouble because 'directories' is an array of hashes.

For example:

# set the apache::vhost define type defaults here
Apache::Vhost {
  # What's the correct way to set this since it's an array of hashes?
  directories => { 'options'  => ["Indexes","Symlinks","Somethingelse",],},
}

I'm trying to set apache::vhost::directories OPTIONS section to a default so that I don't have to type it out 50 times in my YAML file:

apache::vhost:
  cache.%{::fqdn}:
    servername: "cache.%{::fqdn}"
    directories:
      - path: '/web/cache'
        #options: DEFAULT HERE VIA MANIFEST
        allow_override: 'None'
        order: 'deny,allow'
        deny: 'from ALL'
        allow: "from 10.0.0.0/8"

Unfortunately, I'm at a loss as to the syntax to ensure that directories=>options is set to the (3 element) array I need.

I'm thinking that the "full path" to options is:

apache::vhost::directories::path::options

but that is even more confusing...

2016-11-29 05:34:53 -0600 commented answer Install Packages after certain conditions met in puppet

Using memory *free* may not be a good metric for installing packages on Linux servers. Unless you've got a LOT of extra RAM, you probably won't have much "free ram." Linux will use all of the memory for caching when it suits itself. 95-100% memory used it *expected* on a properly sized system.

2016-10-21 05:51:01 -0600 commented answer Set File content via Hiera

I'm having the same issue with create_resources() and templates. What's strange is that template functionality doesn't work but "source" works just fine:
'/usr/local/bin/list_cluster_members.sh':
source: 'puppet:///modules/profiles/usr/local/bin/list_cluster

2016-10-12 09:26:39 -0600 received badge  Nice Answer (source)
2016-10-12 09:17:46 -0600 received badge  Teacher (source)
2016-10-12 08:48:21 -0600 edited answer Module yo61/puppet-logrotate -- define multiple paths for the same logrotate::rule

The following worked just fine for me:

  include logrotate
  logrotate::rule { 'foo_bar_baz_logs':
      path     =>  ['/var/log/foo.log', '/var/log/bar.log', '/var/log/baz.log', ], 
      compress => true,
   }

Resultant logrotate conf file:

[root@test logrotate.d]# cat /etc/logrotate.d/foobarbaz_logs

# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.  ANY CHANGES WILL BE
# OVERWRITTEN.

 /var/log/foo.log /var/log/bar.log /var/log/baz.log {
   compress
 }