Re: [Puppet-dev] Facter returns IPv4 address for IPv6 when IPv6 is disabled

2017-10-09 Thread James Perry
Just some additional details I found when looking at the debug output versus the code blocks. I don't yet know how the code for facter in networking_resolver.cc (networking_resolver::read_routing_table() and networking_resolver::populate_from_routing_table) need to be modified. What I do see i

Re: [Puppet-dev] Facter returns IPv4 address for IPv6 when IPv6 is disabled

2017-10-05 Thread James Perry
#x27;ll be able to fix > things like this more quickly in the future. Unfortunately, I still can't > say for certain when we'll be able to prioritize this. > > On Thu, Oct 5, 2017 at 10:59 AM James Perry > wrote: > >> I was generating a report from Foreman us

Re: [Puppet-dev] Anyway to trigger cleanups when classes are removed from a host?

2017-10-05 Thread James Perry
On Thursday, October 5, 2017 at 1:45:59 PM UTC-4, Ryan Whitehurst wrote: > > On Thu, Oct 5, 2017 at 10:35 AM, James Perry > wrote: > >> I'm using the saz/sudoers as well and it removes, say ERPM10-20, when I >> remove the user from the host, exactly as expected.

[Puppet-dev] Facter returns IPv4 address for IPv6 when IPv6 is disabled

2017-10-05 Thread James Perry
I was generating a report from Foreman using the Hammer CLI to list my hosts for management on my Dev box. I started noticing that I wasn't seeing any IP addresses for SUSE 11 SP3. Thinking it was a OS specific issue, I checked my PROD environment that has a large number of SUSE 11 SP1 - SP4 be

Re: [Puppet-dev] Anyway to trigger cleanups when classes are removed from a host?

2017-10-05 Thread James Perry
I'm using the saz/sudoers as well and it removes, say ERPM10-20, when I remove the user from the host, exactly as expected. What doesn't happen is the user ERPM10-20 isn't removed from the server. Let me try to see if I can put it another way to make it clearer. Say I have ERPM01-01, ERPM01-22

Re: [Puppet-dev] Anyway to trigger cleanups when classes are removed from a host?

2017-10-04 Thread James Perry
Thanks Rob. > > As for reclassifying nodes that is a use case outside of what I'm trying to accomplish. Mostly I was trying to work more a scenario like the following: I have a set of restricted accounts for use with ERPM.on Linux. Each DBA is assigned a Linux local ERPM user that is the same

[Puppet-dev] Anyway to trigger cleanups when classes are removed from a host?

2017-10-04 Thread James Perry
Recently we have been changing out some software that was deployed via tarball extractions. Now we have a different app that deploys via RPM. To not break the legacy hosts where the new software doesn't we created a whole new class for deployments and setups on the new software. I've Googled, d

[Puppet-dev] Re: Rspec giving no implicit conversion of Hash into String for an array

2017-08-25 Thread James Perry
As an update to this odd issue, I did a puppet module generate to create a fresh directory setup and then copied in the the Puppet code, templates and spec files from the old one. Oddly it had no problems without any code modification that I can find anywhere. The same applies to using the PDK t

[Puppet-dev] Re: Rspec giving no implicit conversion of Hash into String for an array

2017-08-18 Thread James Perry
*Continued:* # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:45:in `call' # :2:in `block in call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:313:in `eval' # /usr/local/share/gems/gems

[Puppet-dev] Re: Rspec giving no implicit conversion of Hash into String for an array

2017-08-18 Thread James Perry
# Continued # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:45:in `call' # :2:in `block in call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:313:in `eval' # /usr/local/share/gems

[Puppet-dev] Re: Rspec giving no implicit conversion of Hash into String for an array

2017-08-18 Thread James Perry
So let me try this again. Here is the full init.pp and spec file being used. The setup is very simple. Likewise it does't matter if the *$sshd_hostkey_rhel_cent_7 *is setup as a smart parameter or set inside the module itself, the error "*Evaluation Error: Error while evaluating a Function C

[Puppet-dev] Re: Rspec giving no implicit conversion of Hash into String for an array

2017-08-18 Thread James Perry
So let me try this again. Here is the full init.pp and spec file being used. The setup is very simple. Likewise it does't matter if the *$sshd_hostkey_rhel_cent_7 *is setup as a smart parameter or set inside the module itself, the error "*Evaluation Error: Error while evaluating a Function C

[Puppet-dev] Rspec giving no implicit conversion of Hash into String for an array

2017-08-16 Thread James Perry
I am getting an odd error when running rake spec on my module. The functions work fine when setup in Puppet, but when I try to test it rspec is kicking out an error about my $myarr arrays. When I comment it out, the tests pass. What they heck does this error mean and why does it complain whe

[Puppet-dev] Most Spec tests fail if using fail('some error') to test with and_raise(Puppet::Error, /some error/)

2017-07-26 Thread James Perry
Can anyone assist my confusion on how to use is_expected.to compile.and_raise(Puppet::Error, /some error/)? I have a class where I have fail('some error') and it is only calls class ABC if parameters A=1, B=2, C=3, which I am using to test this functionality out. If I have fail('some error')

Re: [Puppet-dev] It is possible to mock / stub a local variable in the module being tested?

2017-07-26 Thread James Perry
:28:53 PM UTC-4, Ryan Whitehurst wrote: > > On Tue, Jul 25, 2017 at 3:15 PM, James Perry > wrote: > >> So I am over thinking it then. I'm taking fact values from a list of >> installed directories and removing the one matching the current version. >> This is b

Re: [Puppet-dev] It is possible to mock / stub a local variable in the module being tested?

2017-07-25 Thread James Perry
the tasks testing out fine. On Tuesday, July 25, 2017 at 5:59:50 PM UTC-4, Ryan Whitehurst wrote: > > On Tue, Jul 25, 2017 at 2:33 PM, James Perry > wrote: > >> I'm not sure if it can be done, but I am trying to test a case where I >> take an array of values and

[Puppet-dev] It is possible to mock / stub a local variable in the module being tested?

2017-07-25 Thread James Perry
I'm not sure if it can be done, but I am trying to test a case where I take an array of values and use stdlib's delete to remove one value before iterating over it. The class will fail if the removed value is present. That all works fine except I am trying to write an rspec for it. Nothing I ha

Re: [Puppet-dev] Puppet Rspec - Check against Catalogue Value

2017-07-25 Thread James Perry
Thanks David. Simple things seem more complex with RSpec than they should be. On Tuesday, July 25, 2017 at 6:14:55 AM UTC-4, David Schmitt wrote: > > > > On 25 July 2017 at 00:21, James Perry > > wrote: > >> So I have a simple class, for now, where I am trying

[Puppet-dev] Puppet Rspec - Check against Catalogue Value

2017-07-24 Thread James Perry
So I have a simple class, for now, where I am trying to write RSPEC tests to check the following: 1. Smart Parameter $current_version is in catalogue. 2. If $current_version = $installed_version (custom fact that will be stubbed as a :fact), that 'class foo' exits without doing anything. 3. if

Re: [Puppet-dev] Steps to build a Puppet 4 install in my home directory for building modules

2017-07-24 Thread James Perry
or simplicity. > > > Rob Nelson > rnel...@gmail.com > > On Mon, Jul 24, 2017 at 2:42 PM, James Perry > wrote: > >> Thanks. >>> >> >> I had looked at these but was missing something along the way. I now >> have what appears to b

Re: [Puppet-dev] Steps to build a Puppet 4 install in my home directory for building modules

2017-07-24 Thread James Perry
> > Thanks. > I had looked at these but was missing something along the way. I now have what appears to be a working setup and a *rake rspec* is now properly mocking and testing the modules. Now I just have to figure out why it isn't picking up the custom fact. That will require more RTFM

[Puppet-dev] Steps to build a Puppet 4 install in my home directory for building modules

2017-07-18 Thread James Perry
Years ago there were a lot of docs about how to setup Puppet to allow someone to build modules outside having to have a master/client setup using puppet apply. I am trying to figure out the very cryptic world of spec/rspec, as it seems to not be documented very well anywhere for anyone other t

[Puppet-dev] Puppet-Rspec - Can it test for smart paramaters

2017-02-07 Thread James Perry
I have started to use Smart Parameters in Puppet, as I am running Foreman with Puppet, and I started writing a new module where I am going to be setting smart parameters. Is there a way with the puppet-rspec tests to check that the smart parameter was set? If they can be tested to be set I wo

[Puppet-dev] Building Puppet-Agent 1.8.0 from GIT

2016-11-21 Thread James Perry
I am trying to build a puppet-agent 1.8.x package for older SUSE 10.x, RHEL 4 and OEL 4. On the SUSE 10.3 I have a Puppet 3.8.7 agent running on Ruby 2.0. Wanting to have all of the servers running puppet-agent, I cloned the https://github.com/puppetlabs/puppet-agent repo and steps as define

Re: [Puppet-dev] Help with mocks / stubs on user provider

2015-01-14 Thread James Perry
Thanks for the pointers! That is the understanding I was missing and I will rework the code to rewrite it to get that working. On Wednesday, January 14, 2015 at 7:37:12 PM UTC-5, Michael Smith wrote: > > This is related to https://github.com/puppetlabs/puppet/pull/3443. > > The piece that's imp

[Puppet-dev] Help with mocks / stubs on user provider

2015-01-14 Thread James Perry
I am a bit stuck here with a modification to the HPUX user provider module. What I wrote works fine when running the rspec against it on HP-UX but fails everywhere else. Part of the problem I is that to find if the system is trusted I have to run a shell command. To get the modify command to

[Puppet-dev] Need some rspec and ruby assistance please.

2015-01-05 Thread James Perry
I am trying to add some functionality to the HP-UX user provider module. In the past I was able to submit changes that allowed it to check for trusted computing and find the password crypt properly. Unfortunately, even through the password was updated, HP-UX was not resetting the password age