[Puppet Users] Using variable for user password hash causes password updated each run.

2018-10-18 Thread James Perry
I have been asked to set password for a user so it is unique on every single host we support. I have a script that generates the password and I had pulled it in via a generate call. The scripts takes in two of facter values to be used to aid in generating the password. $myvar = generate("/bin/

[Puppet Users] Re: interpolation of puppet fact, with quotes, into erb template

2017-08-19 Thread James Perry
Did you try assigning the @domain_suffix to a local variable in the embedded Ruby and see if that would permit it to do as you want? On Friday, August 18, 2017 at 8:02:59 PM UTC-4, John wrote: > > i have this bit of code here > ><% @microservices.sort.each do |service,val| -%> > upstr

[Puppet Users] Re: Patch Automation By Puppet

2017-06-01 Thread James Perry
It really depends on the OS and how you want to handle it. Puppet already has the package ( https://docs.puppet.com/puppet/latest/type.html#package) with the option *ensure => latest,* that will keep the package at the most recent patches available in repos defined on the hosts. If you want

[Puppet Users] Re: Need to put iterative value in a file

2017-05-05 Thread James Perry
Have you looked into the sshkey type already built into Puppet at https://docs.puppet.com/puppet/4.10/types/sshkey.html? Another option or possible combination would be to look at file_line function in Puppet's stdlib package. Using

[Puppet Users] Have Puppet remove a user when the associated class which created it is removed

2017-05-05 Thread James Perry
As I keep tweaking our Puppet/Foreman setup, I was wondering if it was somehow possible to auto-magically remove uses when the associated class is removed from the server. All of our Puppet code is under source code management and requires a full change approval process to implement. I though

[Puppet Users] Way to dynamically build a hash / array using wrapper class

2017-04-28 Thread James Perry
So as I began working through sudo setups I found a unexpected problem I'm trying to find the *proper* way to correct the first time instead of having to hack code to make it work for now. In particular we have multiple cases were the same Cmnd_alias is used with different settings. I know the

[Puppet Users] Re: err: Could not request certificate: unknown message digest algorithm

2017-04-28 Thread James Perry
Looking at the help for the Puppet Agent (puppet agent --help), it seems that the supportable message digests depend on what your version of OpenSSL installed. * --digest: Change the certificate fingerprinting digest algorithm. The default is SHA256. Valid values depends on the version of O

Re: [Puppet Users] theforeman\foreman module?

2017-04-28 Thread James Perry
This may sound stupid, or even idiotic, but have you tried running the foreman-installer --noop --verbose to see what it shows? I have found that when I patch my Linux servers that HTTP and other configs get completely messed up. Running the foreman-installer pulls the details from the answers

[Puppet Users] Re: puppetlabs-inifile versus sudoers

2017-04-28 Thread James Perry
As I have very recently dug into modifying sudoers myself, you may want to look at the saz/sudo module at Puppet Forge. It allows you to do a lot of different methods to create a sudoers file that fits the supported OS. If you want to just do edits, you may want to look at the stdlib - file_

Re: [Puppet Users] Re: How to dynamically change sudoers

2017-04-26 Thread James Perry
of setups when we let them do that on the old config. On Wednesday, April 26, 2017 at 11:54:24 AM UTC-4, Rob Nelson wrote: > > > On Wed, Apr 26, 2017 at 10:45 AM James Perry > wrote: > >> Since all of our Puppet code is in a source code repo and requires a >> change

[Puppet Users] Re: How to dynamically change sudoers

2017-04-26 Thread James Perry
I guess I should have running a Foreman / Puppet setup, so I am trying to keep from having to go creating .yaml files as well as editing things like site.pp and other files. The object I am trying to accomplish is on the KISS principal. So for example my sudoers.erb has an array block for *sud

Re: [Puppet Users] How to dynamically change sudoers

2017-04-26 Thread James Perry
What I seem to be missing is do you have subsequent classes called sudo::user_alias and sudo::user_priv? I get the Hiera yaml file setup, not how to use them selectively to have them added to the sudoers file. Thanks! -- You received this message because you are subscribed to the Google Group

Re: [Puppet Users] How to dynamically change sudoers

2017-04-23 Thread James Perry
le receives both the > sysadmin and the infrastructure snippet. That is all you need to get > started with saz/sudo, but I'm sure there's other functionality if you need > it. > > > Rob Nelson > rnels...@gmail.com > > On Fri, Apr 21, 2017 at 1:33 PM, James Per

Re: [Puppet Users] How to dynamically change sudoers

2017-04-21 Thread James Perry
I will look into that John, thanks. I haven't gotten to the Yaml level yet, but we already have a temple we use now that is standard across the OS we support. We then add in lines accordingly. I had some luck with the sudo::config setup, so I may try to merge the two. With having a class per

Re: [Puppet Users] How to dynamically change sudoers

2017-04-21 Thread James Perry
BTW. I am running Foreman 1.14.3 and Puppet 4. All class assignments to nodes are done via Foreman versus the site.pp. On Friday, April 21, 2017 at 1:33:38 PM UTC-4, James Perry wrote: > > Thanks. I looked at saz/sudo, but at least they I did it, it didn't for my > needs. We hav

Re: [Puppet Users] How to dynamically change sudoers

2017-04-21 Thread James Perry
Thanks. I looked at saz/sudo, but at least they I did it, it didn't for my needs. We have a wide range of hosts that would have oracle, dba and tomcat sudo rules. On another it would only have dba rules. I didn't quite get how I would have it setup the sudo::conf blocks to do what I would nee

[Puppet Users] Re: How to copy and install 3 different files from puppet master to 3 different locations

2017-04-21 Thread James Perry
I'm no expert by far, but since I have been doing a lot of reading lately for an issue I am trying to resolve, would it make sense to do a define block for this? Looking at https://docs.puppet.com/puppet/4.9/lang_defined_types.html it seems this *may* work for you with some tweaking / testing.

[Puppet Users] How to dynamically change sudoers

2017-04-21 Thread James Perry
I'm at an impasse. Due to changing requirements we have different local service accounts being added 'ad hoc' to various servers. Each needs their own set of sudoers lines. When moving from Puppet 0.25 to Puppet 4 I had to kludge something together in a hurry. It works, but not well. I look

Re: [Puppet Users] Puppet Language Style Guide update

2017-02-13 Thread James Perry
Are the any open source or free replacements for Geppetto? RubyMine is like $200/year, which is outside of an IT budget of $0/year for tools. On Friday, January 13, 2017 at 5:03:48 AM UTC-5, Henrik Lindberg wrote: > > On 13/01/17 08:38, Peter Faller wrote: > > Has the Gepetto auto-formatter b

[Puppet Users] Re: Can we install puppet agent on multiple host machine using remote machine (considering puppet master is already installed on the remote machine)?

2017-01-31 Thread James Perry
Prior to installing Spacewalk on my Linux hosts to push updates / packages, I used to do the following: 1. Setup SSH trust from a secured account to Remote host with sudo permissions to root. 2. Remotely copy and install the Puppet Agent 3. Remotely run, as root, /puppet config set server= 4. R

Re: [Puppet Users] How to read in file into array of hashes to use build start script template

2017-01-27 Thread James Perry
cycle level) to just go back to the good old days :) On Sunday, January 22, 2017 at 10:56:46 PM UTC-5, John Gelnaw wrote: > > On Friday, January 20, 2017 at 12:28:02 PM UTC-5, James Perry wrote: >> >> Thanks. >> >> The reason I have a CSV is that is what is provided f

Re: [Puppet Users] How to read in file into array of hashes to use build start script template

2017-01-20 Thread James Perry
Thanks. The reason I have a CSV is that is what is provided from the users out of their own private database where they keep this data. I have to take the detail as it is given. Now I can manually process the data to be how I think I want, but I'm trying to keep this as simple as possible for t

[Puppet Users] Re: How to read in file into array of hashes to use build start script template

2017-01-20 Thread James Perry
Thanks for the code. What I am trying to find is the correct way to use what Puppet has already defined in the code base to handle processing everything into a hash of key/value pairs inside of the class, if possible. It seems that it should be able to do it, I am just looking at it wrong.

[Puppet Users] How to read in file into array of hashes to use build start script template

2017-01-13 Thread James Perry
After spending most of they day digging around and researching, I find Puppet's immutable variables are keeping me from properly handling what I'm trying to do, so I want to see if anyone else has some suggestions on how to handle was I need to accomplish. Goal: Ingest a CSV file provided by a

Re: [Puppet Users] Upgrading from 0.25.1 to 3.7.4

2015-04-15 Thread James Perry
Hunter: Thanks for the bit about the classes.txt. file. That was exactly what I was needing. Martin: I am in the process of doing that work now. I have been playing with Foreman as a front end to be able to use the smart parameters to clean up a lot of classes. The import and inherits are plentifu

[Puppet Users] Upgrading from 0.25.1 to 3.7.4

2015-04-01 Thread James Perry
I have been tasked to upgrade puppet 0.25.1 to 3.7.4. There has been a lot of past admins tweaking this puppet server and most of the existing modules are all ad-hoc creations. I want to ensure I do not miss any expected dependencies, but I also do not have months to manually traverse the entir

Re: [Puppet Users] Setting validproperties fields in provider modules

2014-04-15 Thread James Perry
The HPUX code I am trying to modify is already in the existing Puppet code base at https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/user/hpux.rb. The functionality I am trying to use is to set the value of a specific property so that I can specify the commands to run depe