Re: [Puppet Users] Windows exec resource cannot find command error

2020-12-08 Thread Michael Watters
Probably need to quote the executable due to spaces:

exec { '"c:/program files/telegraf/telegraf.exe" --service install': 

Looks like that worked.  Thanks for the help.
On Tuesday, December 8, 2020 at 1:58:12 PM UTC-5 Josh Cooper wrote:

> On Tue, Dec 8, 2020 at 10:37 AM Michael Watters  wrote:
>
>> Here is the exact error message.
>>
>> Info: /Stage[main]/Dart::Abstract::Windows_node/File[c:/program 
>> files/telegraf/telegraf.conf]: Scheduling refresh of Exec[c:/program 
>> files/telegraf/telegraf.exe --service install]
>> Error: Could not find command 'c:/program'
>> Error: /Stage[main]/Dart::Abstract::Windows_node/Exec[c:/program 
>> files/telegraf/telegraf.exe --service install]/returns: change from 
>> 'notrun' to ['0'] failed: Could not find command 'c:/program'
>>
>> The manifest resource is defined as follows.
>>
>> exec { 'c:/program files/telegraf/telegraf.exe --service install':
>> cwd => 'c:/program files/telegraf',
>> refreshonly => true,
>>  }
>>
>> On Tuesday, December 8, 2020 at 1:29:55 PM UTC-5 Michael Watters wrote:
>>
>>> I tried that as well and it simply results in an error stating "Could 
>>> not find command: c:/program".
>>>
>>
> Probably need to quote the executable due to spaces:
>
> exec { '"c:/program files/telegraf/telegraf.exe" --service install': 
> ...
>
>
>>> On Monday, December 7, 2020 at 2:06:53 PM UTC-5 Martin Alfke wrote:
>>>
>>>> Have you tried using the full path to the executable? 
>>>>
>>>> exec { 'c:/program files/telegraf/telegraf.exe --service install' : 
>>>> ... 
>>>> } 
>>>>
>>>> > On 7. Dec 2020, at 18:17, Michael Watters  wrote: 
>>>> > 
>>>> > I have an exec resource in a manifest for our Windows nodes however 
>>>> the command is failing each time that puppet runs. Here is the definition 
>>>> of the resource and a screenshot of the error. 
>>>> > 
>>>> > ~> exec { 'telegraf.exe --service install': 
>>>> > cwd => 'c:/program files/telegraf', 
>>>> > refreshonly => false, 
>>>> > } 
>>>> > 
>>>> > 
>>>> > 
>>>> > Is there a way to resolve this? I've tried changing the path 
>>>> parameters which doesn't make any difference. 
>>>> > 
>>>> > 
>>>> > 
>>>> > -- 
>>>> > You received this message because you are subscribed to the Google 
>>>> Groups "Puppet Users" group. 
>>>> > To unsubscribe from this group and stop receiving emails from it, 
>>>> send an email to puppet-users...@googlegroups.com. 
>>>> > To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/puppet-users/ca2819ca-1930-4842-8ed8-0820f19ea343n%40googlegroups.com.
>>>>  
>>>>
>>>>
>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/88f80e94-2efc-4ca7-bfb1-70abd422f44dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/88f80e94-2efc-4ca7-bfb1-70abd422f44dn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> -- 
> Josh Cooper | Software Engineer
> jo...@puppet.com
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b54d0549-46f0-4c76-b264-8a2d0af98581n%40googlegroups.com.


Re: [Puppet Users] Windows exec resource cannot find command error

2020-12-08 Thread Michael Watters
Here is the exact error message.

Info: /Stage[main]/Dart::Abstract::Windows_node/File[c:/program 
files/telegraf/telegraf.conf]: Scheduling refresh of Exec[c:/program 
files/telegraf/telegraf.exe --service install]
Error: Could not find command 'c:/program'
Error: /Stage[main]/Dart::Abstract::Windows_node/Exec[c:/program 
files/telegraf/telegraf.exe --service install]/returns: change from 
'notrun' to ['0'] failed: Could not find command 'c:/program'

The manifest resource is defined as follows.

exec { 'c:/program files/telegraf/telegraf.exe --service install':
cwd => 'c:/program files/telegraf',
refreshonly => true,
 }

On Tuesday, December 8, 2020 at 1:29:55 PM UTC-5 Michael Watters wrote:

> I tried that as well and it simply results in an error stating "Could not 
> find command: c:/program".
>
> On Monday, December 7, 2020 at 2:06:53 PM UTC-5 Martin Alfke wrote:
>
>> Have you tried using the full path to the executable?
>>
>> exec { 'c:/program files/telegraf/telegraf.exe --service install' :
>> ...
>> }
>>
>> > On 7. Dec 2020, at 18:17, Michael Watters  wrote:
>> > 
>> > I have an exec resource in a manifest for our Windows nodes however the 
>> command is failing each time that puppet runs. Here is the definition of 
>> the resource and a screenshot of the error.
>> > 
>> > ~> exec { 'telegraf.exe --service install':
>> > cwd => 'c:/program files/telegraf',
>> > refreshonly => false,
>> > }
>> > 
>> > 
>> > 
>> > Is there a way to resolve this? I've tried changing the path parameters 
>> which doesn't make any difference.
>> > 
>> > 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "Puppet Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to puppet-users...@googlegroups.com.
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/ca2819ca-1930-4842-8ed8-0820f19ea343n%40googlegroups.com
>> .
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/88f80e94-2efc-4ca7-bfb1-70abd422f44dn%40googlegroups.com.


Re: [Puppet Users] Windows exec resource cannot find command error

2020-12-08 Thread Michael Watters
I tried that as well and it simply results in an error stating "Could not 
find command: c:/program".

On Monday, December 7, 2020 at 2:06:53 PM UTC-5 Martin Alfke wrote:

> Have you tried using the full path to the executable?
>
> exec { 'c:/program files/telegraf/telegraf.exe --service install' :
> ...
> }
>
> > On 7. Dec 2020, at 18:17, Michael Watters  wrote:
> > 
> > I have an exec resource in a manifest for our Windows nodes however the 
> command is failing each time that puppet runs. Here is the definition of 
> the resource and a screenshot of the error.
> > 
> > ~> exec { 'telegraf.exe --service install':
> > cwd => 'c:/program files/telegraf',
> > refreshonly => false,
> > }
> > 
> > 
> > 
> > Is there a way to resolve this? I've tried changing the path parameters 
> which doesn't make any difference.
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Puppet Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to puppet-users...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/ca2819ca-1930-4842-8ed8-0820f19ea343n%40googlegroups.com
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/034bb3ea-e8a1-4e98-9d11-25ece25b6012n%40googlegroups.com.


[Puppet Users] Puppet errors on Fedora 33 RC1

2020-10-19 Thread Michael Watters
There appears to be an issue with the puppet agent on Fedora 33 RC1.  
Running the agent against a test environment results in errors as follows.  
Does anybody know how to resolve this?  

Info: Using configured environment 'dev27_f33'
Info: Retrieving pluginfacts
Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not 
retrieve information from environment f33_test source(s) 
puppet:///pluginfacts
ce: /File[/var/lib/puppet/facts.d/puppet_vendor.sh]: Dependency 
File[/var/lib/puppet/facts.d] has failures: true
Warning: /File[/var/lib/puppet/facts.d/puppet_vendor.sh]: Skipping because 
of failed dependencies
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve 
information from environment dev27_f33 source(s) puppet:///plugins
ce: /File[/var/lib/puppet/lib/facter]: Dependency File[/var/lib/puppet/lib] 
has failures: true
Warning: /File[/var/lib/puppet/lib/facter]: Skipping because of failed 
dependencies

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a5cb13e2-e148-48a3-a2cf-93c884c3f068n%40googlegroups.com.


Re: [Puppet Users] Mysqldump using puppet

2020-08-03 Thread Michael Watters


Why do these feel like homework questions?  :D


You can add logic to your manifest  based on what environment the agent is 
running under using simple if statements.  For example:


if $facts['environment'] != 'production' {

notify { 'This is a non-production node!': }

}


If you're not familiar with writing puppet manifests the Puppet Learning VM 
would be a good place to start.


https://puppet.com/try-puppet/puppet-learning-vm/



On Sunday, August 2, 2020 at 9:30:41 AM UTC-4, Md Juyel Haque wrote:
>
> Hi y tickets are these
> I am struggling with to write scripts
>
> another two scripts I need please 
> 1 ) 
> In the Puppet scripts, create a script which is active on every 
> environment *except for prod and is only installed on the SSH servers*. 
> This script should run via cron every 5 minutes, which can be installed via 
> Puppet (see common::cronjob).  
>
> 2) Create a script in Puppet which is installed in the Tomcat servers *only 
> for non-production environments and is not available in production* and 
> runs via cron every 5 minutes. The script will install the DB backup when 
> it is found in the IAM user’s directory  
>
>
>
>
>
> On Sat, Aug 1, 2020 at 3:38 AM Md Juyel Haque  > wrote:
>
>> okay Thank You 
>>
>> On Sat, Aug 1, 2020 at 3:17 AM Chris > 
>> wrote:
>>
>>> You put the perl script and backup scripts in a module, and deploy as 
>>> files.  In my case, they are part of a private module called bayhosting:
>>>
>>> file {
>>> "/var/local/backups/mysql":
>>>   ensure  => directory,
>>>   mode  =>  '0700',
>>>   owner  =>  'root',
>>>   group  =>  'root',
>>>   require => File['/var/local/backups'];
>>>
>>> "/opt/bin/MySQLBackup.pl":
>>>   source => "puppet:///modules/bayhosting/opt/bin/MySQLBackup.pl",
>>>   owner   => 'root',
>>>   group   => 'root',
>>>   mode=> '0555';
>>>
>>> "/root/backup.sh":
>>>   source => "puppet:///modules/bayhosting/root/backup.sh",
>>>   owner   => 'root',
>>>   group   => 'root',
>>>   mode=> '0555';
>>>  }
>>>
>>> And then you set up a cron job:
>>>
>>> cron {
>>> cron_mysqlbackup:
>>>   command  =>  "/root/backup.sh",
>>>   user  =>  root,
>>>   hour  => 0,
>>>   minute  => 0,
>>>   require => 
>>> File['/opt/bin/MySQLBackup.pl',"/var/local/backups/mysql", 
>>> "/root/backup.sh"];
>>> }
>>>
>>> On Sat, Aug 1, 2020 at 9:31 AM Md Juyel Haque >> > wrote:
>>>
 if I write this code how will I run it from puppet

 On Sat, Aug 1, 2020 at 1:39 AM Chris > 
 wrote:

> I use this as my mysql backup script:  
> https://github.com/ghstwhl/MySQLBackup
>
> It expects that the credentials for the database are in ~/.my.cnf for 
> the user running the script.  If you are using puppetlabs/mysql to manage 
> your mysql database then this is already set up for you and you just need 
> to run your cron job as root.  Right now it assumes it is running on the 
> DB 
> server itself, but the ParseMyCnf function could be easily tweaked to 
> read the server address from ~/.my.cnf if it exists and only default to 
> localhost if a host isn't specified.
>
> It doesn't currently send emails on errors, but you can fork the repo 
> and submit a PR and I'd be happy to merge.
>
>
> -Chris
>
> On Sat, Aug 1, 2020 at 5:17 AM Md Juyel Haque  > wrote:
>
>> Please help me.I want to create  script database backup. This should 
>> be deployed with the puppet scripts on the Tomcat server.
>> Errors from the dump should be noted and an email sent to particular 
>> email address in case of errors/failure.
>> The script should also take the IP addresses from the Cloudformation 
>> template specified and SCP the backup to each of these servers.
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to puppet...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/74ab9a41-6043-42db-8e25-68ec2adaa998o%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to puppet...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/CAABnqB8rJDhgQFUrmGsnLTOuj6h15Q9ZaDjzBC%2BHJR%3DRi-8iLQ%40mail.gmail.com
>  
> 

[Puppet Users] Re: Packages for SLES 15

2019-07-02 Thread Michael Watters
Never mind, I see the packages are available 
at https://yum.puppet.com/puppet/sles/15/x86_64 however there appears to be 
a packaging problem with the puppe-agent package.  I'm getting an error 
when I try to install puppet-agent as shown in this screenshot.  The server 
has libyaml installed already as well.


[image: Screenshot_SLES15_2019-07-02_11:41:26.png]


On Tuesday, July 2, 2019 at 11:35:47 AM UTC-4, Michael Watters wrote:
>
> Are there any plans to package puppet for SLES 15?  I only see packages 
> for SLES 11 and 12 at http://release-archives.puppet.com/yum/sles.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9912ffe9-d10a-49a1-bde2-c37a00797a86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Packages for SLES 15

2019-07-02 Thread Michael Watters
Are there any plans to package puppet for SLES 15?  I only see packages for 
SLES 11 and 12 at http://release-archives.puppet.com/yum/sles.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7026dc18-1b7d-49a8-92d4-857561d120aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] stdlib module causes puppet failure

2019-06-26 Thread Michael Watters
Thanks.  Unfortunately that doesn't seem to be the issue.  There is no file 
named .resource_types within the puppet configuration dir.


>
> You may be running into 
> https://tickets.puppetlabs.com/browse/PUP-9602. Try deleting 
> /mnt/live/puppeteer/conf.d/puppet/.resource_types 
>
> Josh 
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to puppet...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/e93ac4af-6e04-4aae-96dc-0362b4290f50%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3b7cdda7-ae94-4280-8d4d-fcdae38ab903%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] stdlib module causes puppet failure

2019-06-20 Thread Michael Watters
I'm having an issue with the puppetlabs-stdlib module causing compilation 
failures using the puppet apply command.  

> Error: Class 'stdlib' is already defined (file: 
/mnt/live/puppeteer/conf.d/puppet/modules/stdlib/manifests/init.pp, line: 
16); cannot redefine (file: 
/mnt/live/puppeteer/conf.d/puppet/modules/stdlib/manifests/init.pp, line: 
16) on node host.example.com

The command used to apply our manifest is as follows.

puppet apply -d --noop --modulepath=puppet/modules --hiera_config=hiera.yaml 
./



This node is running Fedora 29 with the puppet-headless package.  No 
changes have been made to the manifest and I'm able to apply the same code 
on other nodes with an older version of puppet.  Does anybody know how to 
resolve this or what would cause puppet to include the same class twice?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e93ac4af-6e04-4aae-96dc-0362b4290f50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet does not recognize bind mounts

2019-06-20 Thread Michael Watters
Thanks.  I believe the issue may be that we are bind mounting paths that 
are bind mounts themselves.  I found another way to accomplish what I need 
using file_line resources so everything is mounted when the system boots.


On Tuesday, June 11, 2019 at 4:33:42 AM UTC-4, Bart-Jan Vrielink wrote:
>
> Hello,
>
>
> I'm unable to reproduce this behavior. To see about which mounts Puppet 
> knows about, use 'puppet resource mount' or 'puppet resource mount 
> /pub/fedora/site/candidates/30'
>
>
> # puppet resource mount /mnt/home
> mount { '/mnt/home':
>   ensure  => 'mounted',
>   device  => '/home',
>   dump=> '0',
>   fstype  => 'none',
>   options => 'rw,bind,seclabel,relatime,errors=remount-ro',
>   pass=> '0',
>   target  => '/etc/fstab',
> }
>
>
> -Original message-
> *From:* Michael Watters >
> *Sent:* Friday 7th June 2019 16:02
> *To:* Puppet Users >
> *Subject:* [Puppet Users] Puppet does not recognize bind mounts
>
> I'm having an issue with puppet repeatedly attempting to mount resources 
> which are configured as bind mounts on one of my nodes.  Here is a copy of 
> the relevant lines from my manifest. 
>
> $koji_fedora_releases = ['28', '29', '30']
>
> $koji_fedora_releases.each |$release| {
> ['released', 'testing'].each |$tag| {
> mount { "/pub/fedora/org/${tag}/${release}":
> ensure => mounted,
> device => 
> "/storage/projects/koji/repos-dist/aos-${release}-${tag}/latest",
> fstype => 'none',
> options => 'rw,bind',
> }
> }
> }
>
> The agent is able to successfully apply these resources however it 
> attempts to remount the directories every time that puppet runs.  For 
> example, here is the output on the agent side.
>
> Notice: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]/ensure: 
> current_value unmounted, should be mounted (noop)
> Info: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]: 
> Scheduling refresh of Mount[/pub/fedora/site/candidates/30]
> Notice: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]: 
> Would have triggered 'refresh' from 1 events
> Info: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]: 
> Scheduling refresh of Mount[/pub/fedora/site/candidates/30]
> Notice: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]/ensure: 
> current_value unmounted, should be mounted (noop)
> Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]: 
> Scheduling refresh of Mount[/pub/fedora/site/released/30]
> Notice: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]: Would 
> have triggered 'refresh' from 1 events
> Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]: 
> Scheduling refresh of Mount[/pub/fedora/site/released/30]
> Notice: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]/ensure: 
> current_value unmounted, should be mounted (noop)
> Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]: 
> Scheduling refresh of Mount[/pub/fedora/site/testing/30]
> Notice: 
> /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]: Would 
> have triggered 'refresh' from 1 events
> Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]: 
> Scheduling refresh of Mount[/pub/fedora/site/testing/30]
>
> These lines are repeated for each bind mount resource.
>
> How does puppet actually verify that a device is mounted?  The source 
> directories *are* mounted and I'm able to access data in each directory 
> without an issue.
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/198a335b-9582-4053-ae52-50cc15bf02b1%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/198a335b-9582-4053-ae52-50cc15bf02b1%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3c8a0a35-c890-4762-a01d-1a8633ab6e4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: [ACTION] Changes to release package links

2019-06-10 Thread Michael Watters
Thanks.  I've updated our agents to use the new location.


On Wednesday, June 5, 2019 at 5:25:47 PM UTC-4, Molly Waggett wrote:
>
> Hi Michael,
>
> The puppetlabs-release-pc1 packages on yum.puppetlabs.com are the ones we 
> plan to re-archive. You will need to install new release packages from 
> http://release-archives.puppet.com/yum/ if you want to continue using the 
> PC1 repository. Neither of these repos will receive future updates.
>
> If you have additional questions, please let me know!
>
> On Wed, Jun 5, 2019 at 10:36 AM Michael Watters  > wrote:
>
>> Hello,
>>
>> I see the puppetlabs-release-pc1 package is available on 
>> yum.puppetlabs.com however it doesn't actually show as an available 
>> update when running "yum update".
>>
>> For example, here's the output on one of our servers.
>>
>> ```
>> [root@server1 yum.repos.d]# yum update puppetlabs-release-pc1
>> Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks, 
>> versionlock
>> Loading mirror speeds from cached hostfile
>>  * elrepo: reflector.westga.edu
>>  * epel-debuginfo: mirror.uic.edu
>> No packages marked for update
>> ```
>>
>> I *was* able to update the package using the rpm command directly however 
>> I'd like to avoid doing this on hundreds of nodes.
>>
>>
>> On Tuesday, June 4, 2019 at 12:37:21 PM UTC-4, Molly Waggett wrote:
>>>
>>> Hi all,
>>>
>>> We have enabled repositories on release-archives.puppet.com.
>>>
>>> If you're using Puppet 3, install the puppet-archives-release-* packages.
>>> If you're using Puppet 4, install the puppetlabs-release-pc1-* packages.
>>>
>>> We do not yet have a timeline for when these packages will be 
>>> re-archived from the main {yum,apt}.puppet.com sites, but we'll let you 
>>> know when we do. 
>>> Nonetheless, we recommend switching to these archive repositories as 
>>> soon as possible.
>>>
>>> Thanks for bearing with us!
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/71411a67-f71e-47df-8e6e-915cebcc6e2b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/71411a67-f71e-47df-8e6e-915cebcc6e2b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> *Molly Waggett*
> she/her/hers
> Release Engineer @ Puppet, Inc.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7e8f2e8c-e611-45b9-94e3-004c42c42feb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet does not recognize bind mounts

2019-06-07 Thread Michael Watters
I'm having an issue with puppet repeatedly attempting to mount resources 
which are configured as bind mounts on one of my nodes.  Here is a copy of 
the relevant lines from my manifest.

$koji_fedora_releases = ['28', '29', '30']

$koji_fedora_releases.each |$release| {
['released', 'testing'].each |$tag| {
mount { "/pub/fedora/org/${tag}/${release}":
ensure => mounted,
device => 
"/storage/projects/koji/repos-dist/aos-${release}-${tag}/latest",
fstype => 'none',
options => 'rw,bind',
}
}
}

The agent is able to successfully apply these resources however it attempts 
to remount the directories every time that puppet runs.  For example, here 
is the output on the agent side.

Notice: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]/ensure: 
current_value unmounted, should be mounted (noop)
Info: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]: 
Scheduling refresh of Mount[/pub/fedora/site/candidates/30]
Notice: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]: 
Would have triggered 'refresh' from 1 events
Info: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/candidates/30]: 
Scheduling refresh of Mount[/pub/fedora/site/candidates/30]
Notice: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]/ensure: 
current_value unmounted, should be mounted (noop)
Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]: 
Scheduling refresh of Mount[/pub/fedora/site/released/30]
Notice: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]: Would 
have triggered 'refresh' from 1 events
Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/released/30]: 
Scheduling refresh of Mount[/pub/fedora/site/released/30]
Notice: 
/Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]/ensure: 
current_value unmounted, should be mounted (noop)
Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]: 
Scheduling refresh of Mount[/pub/fedora/site/testing/30]
Notice: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]: 
Would have triggered 'refresh' from 1 events
Info: /Stage[main]/Site::Fileserver01/Mount[/pub/fedora/site/testing/30]: 
Scheduling refresh of Mount[/pub/fedora/site/testing/30]

These lines are repeated for each bind mount resource.

How does puppet actually verify that a device is mounted?  The source 
directories *are* mounted and I'm able to access data in each directory 
without an issue.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/198a335b-9582-4053-ae52-50cc15bf02b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: [ACTION] Changes to release package links

2019-06-05 Thread Michael Watters
Hello,

I see the puppetlabs-release-pc1 package is available on yum.puppetlabs.com 
however it doesn't actually show as an available update when running "yum 
update".

For example, here's the output on one of our servers.

```
[root@server1 yum.repos.d]# yum update puppetlabs-release-pc1
Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
 * elrepo: reflector.westga.edu
 * epel-debuginfo: mirror.uic.edu
No packages marked for update
```

I *was* able to update the package using the rpm command directly however 
I'd like to avoid doing this on hundreds of nodes.


On Tuesday, June 4, 2019 at 12:37:21 PM UTC-4, Molly Waggett wrote:
>
> Hi all,
>
> We have enabled repositories on release-archives.puppet.com.
>
> If you're using Puppet 3, install the puppet-archives-release-* packages.
> If you're using Puppet 4, install the puppetlabs-release-pc1-* packages.
>
> We do not yet have a timeline for when these packages will be re-archived 
> from the main {yum,apt}.puppet.com sites, but we'll let you know when we 
> do. 
> Nonetheless, we recommend switching to these archive repositories as soon 
> as possible.
>
> Thanks for bearing with us!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/71411a67-f71e-47df-8e6e-915cebcc6e2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: [ACTION] Changes to release package links

2019-05-30 Thread Michael Watters
How does this change affect private mirrors?  Will rsync services be 
available on the archive repos?


On Monday, April 22, 2019 at 5:31:09 PM UTC-4, Molly Waggett wrote:
>
> TLDR: On May 14, 1. yum release packages will move to the top-level of 
> yum.puppet.com; 2. links to nightly release packages will be removed from 
> {yum,apt}.puppet.com; and 3. PC1 (and older) packages will be moved to 
> release-archives.puppet.com. 
>
> All Puppet-maintained tooling and documentation referencing these paths 
> will be updated by the time these changes are made. Please ensure that 
> you are using current versions.
>
> Read on for details, especially if you've written custom tooling with 
> hard-coded download paths (e.g. CI testing or provisioning workflows).
>
> ---*---*---
>
> Hey folks,
>
> In an effort to reduce clutter and confusion on some of our public 
> download sites (yum.puppet.com, apt.puppet.com, downloads.puppet.com, and 
> nightlies.puppet.com), we are planning to make some changes. 
>
> 1. Release packages (for all active streams) will live at the top level 
> only. 
>
> This change only affects yum.puppet.com (and nightlies.puppet.com/yum), 
> giving us consistency with the layout on apt.puppet.com. Currently, yum 
> release packages live inside their corresponding repo directory, e.g. 
> yum.puppet.com/puppet6/puppet6-release-fedora-28.noarch.rpm 
> . 
> THESE WILL BE REMOVED. 
>
> Here are some examples of where you will be able to find release packages:
>
> Old: yum.puppet.com/puppet6/puppet6-release-el-7.noarch.rpm
>
> New: yum.puppet.com/puppet6-release-el-7.noarch.rpm
>
> Old: nightlies.puppet.com/yum/puppet-nightly/
> puppet-nightly-release-sles-12.noarch.rpm
>
> New: nightlies.puppet.com/yum/puppet-nightly-release-sles-12.noarch.rpm
>
> These new paths are currently available for use. We plan to remove the 
> old ones on May 14. Please plan to make all updates during this period. 
>
> 2. There will be no links to nightlies from main download sites.
>
> Links like yum.puppet.com/puppet-nightly 
>  and 
> apt.puppet.com/puppet-nightly  
> WILL BE REMOVED on May 14.
>
> If you're looking for nightlies, visit nightlies.puppet.com. The 
> directory structure will match that of our main download sites.
>
> 3. All PC1 (and older) packages will be removed from {yum, apt, downloads}.
> puppet.com. 
>
> PC1 (which includes puppet-agent 1.10.x and puppet 4.10.x) is reaching 
> end-of-life, so all packages will be moved to release-archives.puppet.com 
> on May 14 and no further updates will be made to these streams.
>
> ---*---*---
>
> We have set up a temporary s3 bucket that reflects the new layout if you’d 
> like to test changes before the cutover:  
> yum-test.puppet.com.s3-website-us-west-2.amazonaws.com
>
> PLEASE NOTE that s3 buckets are not naturally browsable on the web. If 
> you visit the above url in your browser, the info you'll see is NOT 
> ACCURATE. You CAN, however, download packages via wget/curl/etc. so this 
> should only affect human eyes.
>
> If you have any questions or concerns about these changes, please 
> reply-all to this email.
>
> Thanks!
>
> -- 
> *Molly Waggett*
> she/her/hers
> Release Engineer @ Puppet, Inc.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/67d776c9-7490-4113-8220-580a838098f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: adding require to if/elseif statement?

2018-09-11 Thread Michael Watters
You should be able to add a require => Package['client_package'] parameter 
to the exec resource to resolve this.  For example:


$file_source = lookup('application.client')

  if $facts['domain'] == 'internal' {
   file { 'sccm_setup':
 path=> 'C:/Windows/ccmsetup/ccmsetup.exe',
 source  => "$file_source /file.exe"
   }
 }
 else {
   exec { 'client_setup':
 command => 'Invoke-WebRequest "$$file_source/file.exe " -outfile 
"C:/Windows/dir/file.exe" ',
 provider => powershell,
 creates => 'C:/Windows/dir/file.exe'
 require => Package['client_package'],
   }
 }
package { 'client_package':
}



On Tuesday, September 11, 2018 at 9:09:25 AM UTC-4, Jason McMahan wrote:
>
> Thanks Michael, 
> I think my problem is not syntax but rather the invoke-webrequest is not 
> actually completing before moving to the package resource. Then as the file 
> doesnt exist the run fails.
> Back to drawing board.
>
> Appreciate the quick reply.
>
>
> On Tuesday, September 11, 2018 at 7:27:49 AM UTC-5, Michael Watters wrote:
>>
>> What you have there looks fine but I would change the elsif to an else 
>> statement.
>>
>>
>> On Tuesday, September 11, 2018 at 8:08:53 AM UTC-4, Jason McMahan wrote:
>>>
>>> Good day,
>>> I am attempting to add require to an if statement and not sure i am 
>>> doing it right. Any help would be greatly appreciated.
>>>
>>> If the machine is joined to our internal domain it will use a file 
>>> resource, if external i am using a invoke-webrequest as the file is on 
>>> azure blob storage.
>>>   
>>>
>>>   $file_source = lookup('application.client')
>>>
>>>   if $facts['domain'] == 'internal' {
>>> file { 'sccm_setup':
>>>   path=> 'C:/Windows/ccmsetup/ccmsetup.exe',
>>>   source  => "$file_source /file.exe"
>>> }
>>>   }
>>>   elsif $facts['domain'] != 'internal' {
>>> exec { 'client_setup':
>>>   command => 'Invoke-WebRequest "$$file_source/file.exe " -outfile 
>>> "C:/Windows/dir/file.exe" ',
>>>   provider => powershell,
>>>   creates => 'C:/Windows/dir/file.exe'
>>> }
>>>   }
>>>  package { 'client_package':
>>> }
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/861aa7fe-8e71-49d5-a36b-df650596827a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: adding require to if/elseif statement?

2018-09-11 Thread Michael Watters
What you have there looks fine but I would change the elsif to an else 
statement.


On Tuesday, September 11, 2018 at 8:08:53 AM UTC-4, Jason McMahan wrote:
>
> Good day,
> I am attempting to add require to an if statement and not sure i am doing 
> it right. Any help would be greatly appreciated.
>
> If the machine is joined to our internal domain it will use a file 
> resource, if external i am using a invoke-webrequest as the file is on 
> azure blob storage.
>   
>
>   $file_source = lookup('application.client')
>
>   if $facts['domain'] == 'internal' {
> file { 'sccm_setup':
>   path=> 'C:/Windows/ccmsetup/ccmsetup.exe',
>   source  => "$file_source /file.exe"
> }
>   }
>   elsif $facts['domain'] != 'internal' {
> exec { 'client_setup':
>   command => 'Invoke-WebRequest "$$file_source/file.exe " -outfile 
> "C:/Windows/dir/file.exe" ',
>   provider => powershell,
>   creates => 'C:/Windows/dir/file.exe'
> }
>   }
>  package { 'client_package':
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a5678630-875d-478d-b821-401492ad9fe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Duplicate declaration

2018-09-10 Thread Michael Watters
I'd prefer to see the entire vhost.pp code but it looks like the issue is 
the same as I mentioned previously, you have multiple atqapache::vhost 
resources attempting to manage the client base directory.  I've ran into a 
similar issue with my own modules and was able to hack around it using the 
defined() function.  For example:

if !defined(File["$client_base"]) {
   file { [ "$client_base", ]:
  ensure  => 'directory',
  owner   => "$owner",
  group   => "$group",
  mode=> 0744,
}
}

There may be a better option but this way ensures that the resource is only 
created once.


On Monday, September 10, 2018 at 10:22:18 AM UTC-4, Ugo Bellavance wrote:
>
>
>
> On Monday, September 10, 2018 at 9:46:18 AM UTC-4, Michael Watters wrote:
>>
>> It sounds like your atqapache::vhost type is attempting to create 
>> the /var/www/dev/user1/client1 directory for every vhost that is defined.  
>> Can you post your definition for this type here?
>>
>>
>>>
> Wasn't it in my first post?
>
> file { [ "$client_base", ]:
>   ensure  => 'directory',
>   owner   => "$owner",
>   group   => "$group",
>   mode=> 0744,
> } 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9bc26f73-8d1a-4824-a7f8-baf5bf414547%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Duplicate declaration

2018-09-10 Thread Michael Watters
It sounds like your atqapache::vhost type is attempting to create 
the /var/www/dev/user1/client1 directory for every vhost that is defined.  
Can you post your definition for this type here?


On Friday, September 7, 2018 at 5:05:44 PM UTC-4, Ugo Bellavance wrote:
>
> Hi,
>
> I have made a module, a long time ago, that allows me to create 
> directories and httpd config files.
>
> My pattern is /var/www/dev/$devuser/$clientname/$appname/
>
> It worked perfectly until I ended up having more than one $appname for the 
> same $clientname. Here's the error message I get:
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Duplicate declaration: File[/var/www/dev/user1/client1] is already declared 
> in file /etc/puppet/modules/atqapache/manifests/vhost.pp:146; cannot 
> redeclare at /etc/puppet/modules/myapache/manifests/vhost.pp:146 on node 
> server1.example.com
>
> The directive responsible for the creation of the folder is this one:
>
> file { [ "$client_base", ]:
>   ensure  => 'directory',
>   owner   => "$owner",
>   group   => "$group",
>   mode=> 0744,
> }
>
> This line defines the variable: 
>
> $vhost_base = 
> "${atqapache::params::home}/$envstage/$client-${application}"
>
> Here's my declaration:
>
>   atqapache::vhost { 'client1-user1app1dev1' :
> client => 'client1',
> envstage   => 'dev',
> application=> 'app1',
> devuser=> 'user1',
>   }
>
>   atqapache::vhost { 'client1-user1app2dev11' :
> client => 'clien1',
> envstage   => 'dev',
> application=> 'app2',
> devuser=> 'user1',
>   }
>
> Does anyone know how I could modify my code so that I can have more than 
> one app per client?
>
> Thanks,
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a3b15e66-e8d4-4ed6-8d6f-10cc32834b80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet Apache Module

2018-08-24 Thread Michael Watters
What happens when there's a bug fix or security update that you need?  
Pinning versions also only works as long as you have no *other* modules 
that depend on a newer version of the apache module.

IMO the apache module should not be dropping support for an Apache release 
that is still widely used by several organizations.  RHEL 6 End of Extended 
Life-cycle Support does not expire until November 30, 2020 and there are 
still customers deploying RHEL 6 systems *today* along with httpd version 
2.2.


On Thursday, August 23, 2018 at 8:18:45 PM UTC-4, Ben Ford wrote:
>
> Is there a reason you can't pin to the module to a version that supports 
> your needs?
>
> Any users that use either Apache 2.2 or use one of the above operating 
>> systems should pin to an older version of the module. We will continue to 
>> support these operating systems for older versions of the module.
>
>
> On Thu, Aug 23, 2018 at 12:01 PM Tim Skirvin  > wrote:
>
>> Davin Hanlon > writes:
>>
>> > Quick note to let you know of some major work that we're performing
>> > to the module. As you probably know, Apache 2.2 has been end-of-lifed
>> > since the start of 2018 [...] Therefore, we're taking steps to remove
>> > support for that version of Apache from the module. This also impacts
>> > the operating systems that we will support for the module. The following
>> > operating systems won't be supported by the Apache module after the
>> > changes:
>>
>> >- RHEL 5
>> >- RHEL 6
>> >- CentOS 5
>> >- CentOS 6
>> >- Oracle Linux 6
>> >- Scientific Linux 6
>>
>> Is there any chance you'd consider delaying this change?  RHEL 6
>> and family are "officially supported" releases for years to come, and I
>> and many other sites still use it for many or most most of our services.
>> Without speaking for anybody else, if you drop support for Apache 2.2 at
>> this point, I'll probably have to transition away from using the 
>> puppetlabs/apache module entirely, and I'd really rather not.
>>
>> - Tim Skirvin (tski...@fnal.gov 
>> )
>> -- 
>> HPC Systems Administrator / Developer  
>> http://www.linkedin.com/in/tskirvin
>>USCMS-T1 Collaboration Fermilab ECF
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/20180823190134.GB91021%40fnal.gov
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6ef044ba-d685-462a-b2da-d23ebf3c839c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Automatic parameter lookup including metaparameters

2018-08-16 Thread Michael Watters
> Is there in fact any reason for concern that applying class autofs before 
applying one or both of the other two might result in a Puppet failure or a 
target system misconfiguration? 

In this case, yes.  In order for autofs to work properly NFS must be 
configured first and in order for NFS to work things like sssd, 
nsswitch.conf, PAM, etc. must be configured properly.  That is handled by 
our authconfig module.

I'll look into updating our manifest to use the chain parameters you 
mentioned.  Thanks for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/fce9aaef-665b-4856-9d97-e02a017a98c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Release and Archive repository changes for Puppet software

2018-08-13 Thread Michael Watters
Also, does the release-archives site have rsync enabled?

On Thursday, August 9, 2018 at 7:29:40 PM UTC-4, Rob Kenefeck wrote:
>
> Hi Eric, when will this be happening?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6f5392e2-a7c5-4460-a10c-9a508b71315b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Automatic parameter lookup including metaparameters

2018-08-13 Thread Michael Watters
The error I was getting was due to duplicate declarations of the autofs 
class as follows.

```
29) dart::abstract::aos_master_node on fedora-26-x86_64 should contain 
Logrotate::Rule[httpd] with path => "/var/log/httpd/*log", missingok => 
true, ifempty => false, sharedscripts => true, delaycompress => false and 
postrotate => "/bin/systemctl reload httpd.service > /dev/null 2>/dev/null 
|| true"
  Failure/Error: include '::dart::subsys::autofs::common'
  
  Puppet::PreformattedError:
Evaluation Error: Error while evaluating a Resource Statement, 
Duplicate declaration: Class[Autofs] is already declared; cannot redeclare 
(file: 
projects/puppet/modules/dart/spec/fixtures/modules/dart/manifests/subsys/autofs/common.pp,
 
line: 35) (file: 
projects/puppet/modules/dart/spec/fixtures/modules/dart/manifests/subsys/autofs/common.pp,
 
line: 35, column: 5) on node mdct-aos-master-f26.example.com
```

This occurs due to the dart::subsys::autofs::common class already being 
included by our base node class.  I've ran into this issue previously using 
resource-like declarations as well.
Adding the if !defined wrapper solves the issue but it still feels like a 
kludge instead of a proper solution.


On Thursday, August 9, 2018 at 3:33:47 PM UTC-4, Ben Ford wrote:
>
> Hi Michael. Can you share the code you tried and the errors you ran into?
>
> On Thu, Aug 9, 2018 at 11:30 AM Michael Watters  > wrote:
>
>> Hello,
>>
>> Is it possible to define metaparameters for a resource in Hiera?  For 
>> example, I have a class that is currently declared within another class as 
>> follows.
>>
>> if !defined(Class['autofs']) {
>> class { 'autofs':
>> require => [
>> Class['authconfig'],
>> Class['nfs::client'],
>> ],
>> }
>> }
>>
>> I would like to get rid of this mess and use a standard include statement 
>> with parameters defined in my common.yaml as follows.
>>
>> include 'autofs'
>>
>> ---
>> autofs::require:
>> - "Class['authconfig']"
>> - "Class['nfs::client']"
>>
>>
>> Will this work or do I have to stick with resource-like declarations to 
>> define dependencies?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/ea13260d-673f-4322-a787-271c7f4b1259%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/ea13260d-673f-4322-a787-271c7f4b1259%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/98c525cc-4f3e-46d1-9f97-ff9a7c3adc76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Automatic parameter lookup including metaparameters

2018-08-09 Thread Michael Watters
Hello,

Is it possible to define metaparameters for a resource in Hiera?  For 
example, I have a class that is currently declared within another class as 
follows.

if !defined(Class['autofs']) {
class { 'autofs':
require => [
Class['authconfig'],
Class['nfs::client'],
],
}
}

I would like to get rid of this mess and use a standard include statement 
with parameters defined in my common.yaml as follows.

include 'autofs'

---
autofs::require:
- "Class['authconfig']"
- "Class['nfs::client']"


Will this work or do I have to stick with resource-like declarations to 
define dependencies?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ea13260d-673f-4322-a787-271c7f4b1259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Managing "live" network configuration

2018-05-29 Thread Michael Watters


Not familiar with this module but you could set up a custom exec resource to 
restart the network when $facts['ipaddress'] does not match what is defined in 
hiera.  We do something similar for SELinux to make sure the server is actually 
in the mode that it should be.



On Thursday, May 24, 2018 at 7:41:25 AM UTC-4, jeffster wrote:
>
> Good day
>
> I'm using Example42/Network to manage SLES configuration files for the 
> network. So far it seems to be working: if the configuration file changes, 
> the *network *service is restarted.
>
> What I'm wondering is how to deal with the following case: If a user makes 
> a temporary change to the network, say, using the *ip *command; how can 
> Puppet be aware of this and reset the network? It seems as though Puppet, 
> using the Example42 module, only looks at the non-persistent configuration 
> and not the live/active one.
>
> Thank you
>
> JF
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/30b4e4d0-f5c2-4516-b8ec-d0c8b0c211f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec cannot load required gems

2018-04-23 Thread Michael Watters
Thanks.  I found that adding "require 'parseconfig'" to the 
spec/spec_helper.rb file also allows the tests to run.  bundle exec is 
failing with dependency errors as well.


On Monday, April 23, 2018 at 5:24:08 PM UTC-4, Garrett Honeycutt wrote:
>
> On 4/23/18 4:38 PM, Michael Watters wrote: 
> > Has anybody used rspec-puppet to run tests using a function that 
> > requires external ruby gems?  I'm running unit tests on resources that 
> > call functions in the puppet_thycotic module however rspec is failing 
> > with an error as shown below. 
> > 
> > Failure/Error: require 'parseconfig' 
> >   
> >  Puppet::PreformattedError: 
> >Evaluation Error: Error while evaluating a Function Call, Could 
> > not autoload puppet/parser/functions/getsecret: cannot load such file -- 
> > parseconfig at 
> > 
> /home/username/projects/puppet/modules/example/spec/fixtures/modules/example/manifests/hostname.pp:32:20
>  
>
> > on node host.example.com 
> > 
> > I've installed the parseconfig gem using both the gem and puppet_gem 
> > providers but rspec still complains that it can't find the file.  Any 
> > idea how to resolve this?  Is there another directory where rspec looks 
> > for gem packages? 
> > 
>
> Hi Michael, 
>
> Try putting the gem in your Gemfile and using bundler when you invoke 
> rspec, such as `bundle exec rake spec_standalone` or `bundle exec rspec`. 
>
> Best regards, 
> -g 
>
> -- 
> Garrett Honeycutt 
> @learnpuppet 
> Puppet Training with LearnPuppet.com 
> Mobile: +1.206.414.8658 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c222ad53-e852-4ef2-a529-96fc5b8d83fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] rspec cannot load required gems

2018-04-23 Thread Michael Watters
Has anybody used rspec-puppet to run tests using a function that requires 
external ruby gems?  I'm running unit tests on resources that call 
functions in the puppet_thycotic module however rspec is failing with an 
error as shown below.

Failure/Error: require 'parseconfig'
 
 Puppet::PreformattedError:
   Evaluation Error: Error while evaluating a Function Call, Could not 
autoload puppet/parser/functions/getsecret: cannot load such file -- 
parseconfig at 
/home/username/projects/puppet/modules/example/spec/fixtures/modules/example/manifests/hostname.pp:32:20
 
on node host.example.com

I've installed the parseconfig gem using both the gem and puppet_gem 
providers but rspec still complains that it can't find the file.  Any idea 
how to resolve this?  Is there another directory where rspec looks for gem 
packages?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d65a1d78-0f98-43cc-ad6e-2d21196f1ec9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Managing MySQL Users and Permissions with Puppet

2018-04-23 Thread Michael Watters
Use the puppetlabs-mysql module to manage the grants for each user/db.  You 
can have different values for each environment stored in hiera.

On Friday, April 20, 2018 at 11:42:22 AM UTC-4, Jonathan Preston wrote:
>
> I've searched for answers, but couldn't find anything quite matching my 
> use case.
>
> I have a series of servers, managed with Puppet and Foreman. These make up 
> my company's development, staging, and production environments, plus a few 
> small stand-alone servers for side projects.
>
> I want to manage MySQL permissions on these servers, but the trick is that 
> each server environment may have some different accounts.
>
> We use scripts based around Percona XtraBackup to copy production 
> databases to staging and development environments for testing purposes. If 
> I restore a backup from our production environment to our development 
> environment, it copies all the data, which is good, but it also sets the 
> users and permissions to match the production environment as well. This is 
> a problem in our case.
>
> What I want to do is configure, in Puppet/Foreman, all of the credentials 
> that should be present on a given server, and have the Puppet client not 
> only set up whatever the Puppet master says, but also purge any credentials 
> that aren't in the list. In other words, the accounts I specify, and only 
> those, should end up on the Puppet client machine, and Puppet should be 
> responsible for purging anything else there.
>
> Naturally, I don't want to rebuild the grant tables every time Puppet 
> runs, so I presume I'd need a way to intelligently read and parse what's 
> already there.
>
> Is anyone aware of someone having done something like this? Any ideas at 
> all on how I might accomplish it?
>
> Thanks in advance.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b62a9108-0599-4a1b-9f5f-1a1345b04207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: PuppetDB: manually import reports

2018-04-19 Thread Michael Watters
Puppetdb data is all stored in postgresql so you should be able to copy the 
reports table from one server to the other.  For example, run this on your 
prod node.

pg_dump -h puppetdb-dev -U puppetdb -W -d puppetdb -t reports | psql -U 
puppetdb puppetdb

I'm not sure if you need more than just the reports table though.

On Thursday, April 19, 2018 at 7:46:01 AM UTC-4, Thomas Müller wrote:
>
> HI 
>
> I've got some prod puppetserver/puppetdb and some dev 
> puppetserver/puppetdb. But to have the complete overview over all nodes 
> with the prod puppetdb I'd like to import the reports from the dev 
> puppetserver (stored by reports=store config) into the prod puppetdb.
>
> is there some hidden tool to do so? I wasn't able to find anything in that 
> direction. 
>
> Reading 
> https://github.com/puppetlabs/puppetdb/blob/master/puppet/lib/puppet/reports/puppetdb.rb
>  
> this could maybe adapted to read a yaml file and then send it to puppetdb.
>
> - Thomas 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d08210de-d968-49d4-8c85-6f8060aa05c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppet in epel

2018-04-09 Thread Michael Watters
Most likely there are dependencies which would also need to be updated and 
Redhat likes to avoid breaking things in a RHEL release.  If you really 
need the latest version of puppet installed the packages from the official 
repos work fine.

On Thursday, April 5, 2018 at 12:26:19 PM UTC-4, Michael Di Domenico wrote:
>
> does anyone know who or how puppet gets into epel?  the packages for 
> puppet/facter in epel are woefully out of date.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/83b11bd0-67fe-4885-8f62-1833ca8c0404%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Pre-generated certificates?

2018-03-31 Thread Michael Watters
I've done this for a few nodes but I'm not sure how this would be an 
improvement over just enabling autosign.  Private keys should remain 
private to a node and should never be transmitted over the network if 
possible.

On Wednesday, March 28, 2018 at 3:10:35 PM UTC-4, Eric Sorenson wrote:
>
> Is anybody out there pre-generating certificates for your agents? I've 
> heard whispered tales of some folks doing this but we're starting work on 
> improving the CA / signing / revocation workflow and it'd be great to talk 
> to somebody directly. The workflow would be using 'puppet cert generate' on 
> the master/CA then distributing both the private key and the resulting 
> certificate in some secure, out-of-band mechanism (cloud-init?) to the 
> nodes, so the agent finds the CA cert as well as its own key/cert pair 
> ready and waiting when it starts up, bypassing the CSR 
> generation/submission completely.
>
> --eric0
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7a75eaf6-b71a-4b34-9b76-fe6dbf6f96fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec-puppet with custom types

2017-11-03 Thread Michael Watters
Thanks.  I'll create an issue with the rspec-puppet project.


On Tuesday, October 24, 2017 at 10:15:14 AM UTC-4, Henrik Lindberg wrote:
>
> On 23/10/17 22:29, Michael Watters wrote: 
> > Hello, 
> > 
> > Does anybody know how to make rspec-puppet work with modules that use 
> > custom types for class parameters?  I am getting an error when I run 
> > spec tests such as follows. 
> > 
> > # Puppet::ParseError: 
> >#   Expected parameter 'ensure' of 'Class[Logrotate]' to have 
> > type Logrotate::Ensurable, got String 
> > 
> > The Logrotate::Ensurable type is defined in the logrotate module which 
> > is listed in .fixtures.yml. 
> > 
> > As a workaround I can use an older version of the logrotate module which 
> > does not include custom types but I'd rather have our tests match the 
> > production environment. 
> > 
>
> It sounds like rspec-puppet does not initialize a complete environment 
> with all required modules on the modulepath. 
>
> Suggest filing an issue against rspec-puppet. 
>
> - henrik 
>
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to puppet-users...@googlegroups.com  
> > <mailto:puppet-users+unsubscr...@googlegroups.com >. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/puppet-users/dcc5425d-9745-4b5d-8b65-cb45666c532a%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/puppet-users/dcc5425d-9745-4b5d-8b65-cb45666c532a%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
> -- 
>
> Visit my Blog "Puppet on the Edge" 
> http://puppet-on-the-edge.blogspot.se/ 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f9c65bce-b70e-4647-908a-49e377481498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] rspec-puppet with custom types

2017-10-23 Thread Michael Watters
Hello,

Does anybody know how to make rspec-puppet work with modules that use 
custom types for class parameters?  I am getting an error when I run spec 
tests such as follows.

# Puppet::ParseError:
  #   Expected parameter 'ensure' of 'Class[Logrotate]' to have type 
Logrotate::Ensurable, got String

The Logrotate::Ensurable type is defined in the logrotate module which is 
listed in .fixtures.yml. 

As a workaround I can use an older version of the logrotate module which 
does not include custom types but I'd rather have our tests match the 
production environment.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/dcc5425d-9745-4b5d-8b65-cb45666c532a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Clean Puppet 3 to Puppet 4 migration

2017-10-11 Thread Michael Watters
Been through a similar upgrade myself.  The first step would be to spin up 
a new puppet master running Puppet Server.  You can copy over the SSL dir 
from your old/current master to avoid SSL errors on the agents.  For 
testing you'll want to make sure your manifests work correctly using the 
future parser, that can be enabled in the puppet.conf file on the agents.  
Setting up a separate environment for testing is also recommended.

Puppet Server will work with 3.7 clients so once you have a manifest that 
compiles correctly you can just point the agents to the new master's IP.


On Wednesday, October 11, 2017 at 8:07:13 AM UTC-7, Salty Old Cowdawg wrote:
>
> About three years ago (4 years ago?) I deployed a Puppet infrastructure 
> for my company and department based on FOSS Puppet 3.7.   Given that's been 
> deprecated of course I'm very much looking to migrate to Puppet 4.   
> Besides for about three months I worked for another company and got spoiled 
> by Puppet 4. 
>
> So I'm back at my old digs and assessing what it will take to go from P3 
> to P4.   Here are some of the things I have to think about
>
> 1) the migration needs to be fully automated both on the server end and 
> the client end. 
> 2) no really this is going to be done by operations personnel who have 
> a low threshold of fright for Puppet in spite of my best efforts to 
> desensitize them.
> 3) There is as penetrable firewall between me (developer) and the Puppet 
> infrastructure servers and clients so I cannot personally intervene
>
> Anybody out there been through this pain and have any suggestions and 
> pointers on how to make this happen with minimal "breakage?" 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8c276e2e-e692-43ec-9560-06f29138559c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: hiera style guide

2017-10-06 Thread Michael Watters


You do not *have* to quote strings however I have ran into issues with hiera 
turning strings that look like integers into an integer which causes problems 
when you attempt to do a key lookup using a string value or pass a value to a 
parameter that expects a string value.

For example, there is a difference between this:

signing_keys:
epel: '7':
key_name: foo 


And this:

signing_keys:
epel: 7:
key_name: foo

The latter causes the value for signingkeys['epel'] to be converted into an 
integer instead of a string.  This can cause issues with puppet depending 
on how you reference the data.


On Thursday, September 28, 2017 at 12:44:05 PM UTC-4, Georg Faerber wrote:
>
> Hi all, 
>
> Searching the Internets didn't reveal anything: Is there some style 
> guide or best practice regarding syntax used in hiera, writing .yaml 
> files? For example, should it be: 
>
> array: 
>   - string 
>   - string 
>
> or 
>
> array: 
>   - 'string' 
>   - 'string' 
>
> Thanks in advance, 
> all the best, 
> Georg 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/300854eb-2727-4299-93ec-189fae953ddf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Data in Modules: Fail on unsupported OS

2017-08-25 Thread Michael Watters
I usually do this within the manifest itself.  For example:

if $facts['osfamily']!='RedHat'{fail("$operatingsystem is not supported")}





On Tuesday, August 22, 2017 at 7:34:12 AM UTC-4, plapp...@gmail.com wrote:
>
> Good morning :)
>
> I'm currently writing a puppet module for the OpenBSD specific 
> implementation of SNMPd, and was wondering if there is any elegant way  for 
> the module to fail on unsupported operating systems?
>
> With the params.pp-pattern, you can fail as the default of the OS-specific 
> configuration; but how would I do this with the data comes via Hiera from 
> the module itself (
> https://docs.puppet.com/puppet/4.10/hiera_migrate_modules.html#module-data-with-yaml-data-files
> )? 
>
> Of course I can simply leave the common.yaml empty and the module will 
> fail with missing variables, but I'd rather have a helpful error message 
> about an unsupported OS (which will be less confusing, should this module 
> be used by someone else but me).
>
>
>
>
> Kind regards, 
>
> Jake
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6173b094-bf6b-468e-b20c-cf3865b51476%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Custom Facts using awk

2017-03-30 Thread Michael Watters
%x is a ruby method which captures command output.  IMO you can do most of 
what you need using native ruby methods, there's no need to pipe output to 
grep/sed/awk since ruby has built in pattern matching functions and if 
you're using ruby you might as well do it the ruby way.

For example, this fact uses the =~ operator to do pattern matching on an 
array of strings.

Facter.add(:screen_count) do
confine :kernel => 'Linux'
setcode do
@screens = Facter::Core::Execution.exec("/usr/bin/xrandr -display 
:0").split("\n")
@screens.count { |x| x =~ /connected/ }
end
end

IMO piping grep to awk is never necessary.  awk has a built-in search 
function, just use it!  The command used in that fact could be rewritten as 
follows.

 ethtool_g = %x{ethtool -g #{int} 2>/dev/null  | awk '/^(RX|TX)/ {print 
$2}'}

Still messy and a more native way to do it would be like this.

%x{ethtool -g #{int} 2>/dev/null}.each_line do |line|
puts line.split("\s")[-1] if line =~ /^(RX|TX):/
end


On Thursday, March 30, 2017 at 11:11:35 AM UTC-4, Warron French wrote:
>
> Hi Luke, I have some questions for you.
>
> First, the link= 
> https://github.com/puppetlabs/puppetlabs-apache/blob/master/lib/facter/apache_version.rb
>  
> didn't have any reference to awk at all, was this the file you intended to 
> suggest?
>
> Secondly, the link= 
> https://github.com/LMAX-Exchange/puppet-networking-example/blob/master/lib/facter/interface_ringbuffer.rb
>  
> did have a reference to awk; thank you.
> However, the syntax:
>   ethtool_g = %x{/sbin/ethtool -g #{int} 2>/dev/null | grep -P 
> '^(RX|TX):' | awk '{print $2}'}
>
> Looks like something other than just plain shell scripting, so can you 
> break this down for me just a little bit?
>
> I recognize what looks like a variable, called ethtool_g, and then it 
> continues with assignement based on %x{...}  where the "" is your 
> shell scripting.
>
> What is the *%x* a reference for/to?  Can I simply replace your variable 
> with one of my own, and your shell scripting between the curly braces with 
> my own shell scripting?
>
> Is that legal, and is this in the language of ruby (so I have a reference 
> point of where to go to look up more examples?
>
> Sorry for the load of questions.  Thank you for the information.
>
> --
> Warron French
>
>
> On Thu, Mar 30, 2017 at 11:03 AM, warron.french  > wrote:
>
>> Hey, thanks for the examples Luke!  I am looking at them now.
>>
>> --
>> Warron French
>>
>>
>> On Thu, Mar 30, 2017 at 8:31 AM, Luke Bigum > > wrote:
>>
>>> Puppet modules on Github are a good source. I've found a simple one:
>>>
>>>
>>> https://github.com/puppetlabs/puppetlabs-apache/blob/master/lib/facter/apache_version.rb
>>>
>>> And one of my own that's a little more complicated:
>>>
>>>
>>> https://github.com/LMAX-Exchange/puppet-networking-example/blob/master/lib/facter/interface_ringbuffer.rb
>>>
>>> -Luke
>>>
>>> On Thursday, 30 March 2017 13:10:35 UTC+1, Warron French wrote:

 Joshua, thanks for this feedback.  I don't really know ruby; can you 
 offer some ideas of where I can find other Puppet Facts written in Ruby 
 that don't look like my originally posted example?

 Thank you sir.

 --
 Warron French


 On Tue, Mar 28, 2017 at 10:51 AM, Joshua Schaeffer <
 jschaef...@gmail.com> wrote:

> External facts are a Puppet v4 feature only. You have to use Ruby to 
> create custom facts in Puppet v3.
>
> On Monday, March 27, 2017 at 3:54:00 PM UTC-6, Warron French wrote:
>>
>> OK, done, and done.  But it still isn't showing up.
>>
>> Is this potentially because I am using PE-3.8 as a component of Red 
>> Hat Satellite?
>>
>> --
>> Warron French
>>
>>
>> On Mon, Mar 27, 2017 at 5:28 PM, Peter Bukowinski  
>> wrote:
>>
>>> Hi Warron,
>>>
>>> Puppet executes the script directly, so you need the shebang line 
>>> and you must ensure the file is executable.
>>>
>>> -- Peter
>>>
>>> On Mar 27, 2017, at 2:25 PM, warron.french  
>>> wrote:
>>>
>>> Peter, perhaps I misunderstood you; but, I thought I was supposed to 
>>> be able to use bash or sh scripting to generate facters of my own 
>>> without 
>>> the use of Ruby.
>>>
>>> The link you provided refers to a python script example.  It also 
>>> adds a shebang line at the top of the script; do I need the shebang 
>>> line, 
>>> or will Puppet simply execute the shell script with:
>>>
>>> sh scriptname.sh
>>>
>>> Thanks for the feedback,
>>>
>>> --
>>> Warron French
>>>
>>>
>>> On Wed, Mar 22, 2017 at 7:07 PM, Peter Bukowinski  
>>> wrote:

[Puppet Users] Re: Custom Facts using awk

2017-03-22 Thread Michael Watters
You can do everything you need entirely in ruby.  For example, here's a 
custom fact that returns the number of screens reported by the X server.

Facter.add(:screen_count) do
confine :kernel => 'Linux'
setcode do
@screens = Facter::Core::Execution.exec("/usr/bin/xrandr -display 
:0").split("\n")
@screens.count { |x| x =~ /connected/ }
end
end

Note that this only counts screens currently in use by X which may not 
match the graphics card's total capabilities.  A second option would be to 
look at /sys/class/drm directly for any devices detected by the kernel. 
 For example:

Facter.add(:screen_count2) do
> confine :kernel => 'Linux'
> setcode "ls -d /sys/class/drm/*-DP-* | /usr/bin/wc -w"
> end

 


On Wednesday, March 22, 2017 at 6:25:10 PM UTC-4, Warron French wrote:
>
> Hello, I have finally learned how to write a Custom Fact; and duplicated 
> the syntax several times over inside the same .rb file.
>
> I am using syntax that looks like the following:
>
> Facter.add('qty_monitors_total') do
>   setcode  do
>  Facter::Util::Resolution.exec('/bin/grep " connected" 
> /var/log/Xorg.0.log | cut -d\) -f2,3,4 | grep GPU |sort -u | wc -l')
>   end
> end
>
> I don't know of any other way to do this yet; but that's not my concern 
> yet.
>
> What I would like to know is how can I use an awk command within the 
> Facter::Util::Resolution.exec('.') line.
>
> I have a need to essentially reproduce the line above *but drop   wc -l 
> and add awk '{ print $2"_"$3"_on_"$1$4 }'*
>
> I need the awk command to pretty much look like this; the problem is awk 
> uses its own single quotes (') and it will break the ruby code.
>
> I am not a ruby developer; so if someone could either tell me:
>
>1. It's just not possible; or
>2. *do it this way*
>
>
> That would be greatly appreciated.  Thank you,
> --
> Warron French
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8097a0bc-5709-45c8-a140-3a673b68dd31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Manage delivery and execution of RPMs not in YUM

2017-03-03 Thread Michael Watters
This would be the ideal but you *can* use the rpm provider when needed. 
 For example:

package { 'jdk':
ensure  => installed,
provider => 'rpm',
source  => '/pub/oracle/jdk-8-linux-x64.rpm',
}


This will install the rpm using the defined source path.  In our 
environment the /pub directory is available to all nodes via nfs.


On Thursday, March 2, 2017 at 8:03:11 PM UTC-5, LinuxDan wrote:
>
> +1 
> To manage an RPM not in yum, put it into yum. 
>
> > On Mar 2, 2017, at 11:02 AM, Garrett Honeycutt <
> g...@garretthoneycutt.com > wrote: 
> > 
> >> On 3/2/17 9:58 AM, warron.french wrote: 
> >> Hello all, 
> >> can someone please advise me on a proper set of syntax (a file to look 
> >> at) for an example to follow to solve the following challenge: 
> >> 
> >> 1. I have 2 deliver 2 *.rpm files that are not in a YUM repository, so 
> >>I dropped them into the files directory of my module path. 
> >> 2. I need to be able to execute each of them either together, or   
> >>_A.rpm before B.rpm_ 
> >> 3. __Then execute a shell script that requires the 2 RPMs to be in 
> >>place before that happens. 
> >> 
> >> I am starting to get into slightly more complicated modules, instead of 
> >> simply delivering basic ASCII text files using  *content => 
> >> template('modulename/some.erb')*. 
> >> 
> >> I just need an example that is know to provide proper execution, proper 
> >> syntax, and something I can learn from correctly.  I am still building 
> >> the foundation of my understanding, so troubleshooting someone else's 
> >> code isn't going to be too good for my development yet. 
> >> 
> >> 
> >> Thank you in advance, 
> >> -- 
> >> Warron French 
> >> 
> > 
> > Hi Warron, 
> > 
> > What you want to accomplish is a bad idea and you should use a yum repo 
> > and definitely not check in binary data with your modules. You could at 
> > least store the rpm's somewhere and then download them from that 
> > canonical source. Take a look at Artifactory which can help with where 
> > to store things such as your random rpm's. 
> > 
> > Sometimes you have to automate what you have before you build something 
> > better. Suggest writing an exec resource that can handle what you are 
> > trying to do. The key here is to have two commands. One that checks to 
> > see if you are already in the desired state and another to get you to 
> > the desired state. Figure that out without Puppet and once you have 
> > those commands, you can write a manifest. 
> > 
> > Best regards, 
> > -g 
> > 
> > -- 
> > Garrett Honeycutt 
> > @learnpuppet 
> > Puppet Training with LearnPuppet.com 
> > Mobile: +1.206.414.8658 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Puppet Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to puppet-users...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/4fc045bb-3e5f-f9d4-88a6-688ca3e3436b%40garretthoneycutt.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a3b09ecf-da09-4c0c-9342-abe941d887e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: restart NginX ONCE (after default file has been removed)

2017-03-03 Thread Michael Watters
Also, it looks like somebody tried to fix this previously but the changes 
weren't merged in. 
 See https://github.com/voxpupuli/puppet-nginx/issues/333 for example.  IMO 
there should be a class parameter to control this behavior so you might 
want to submit a PR with any changes you make.


On Friday, March 3, 2017 at 7:00:36 AM UTC-5, Steve Button wrote:
>
> Hi,
>
> I've got a small piece of puppet in my profile module to remove the 
> default nginx.conf file which gets installed by the nginx module. 
>
> # Upon install this file gets created and displays "Welcome to NginX" page, 
> which we don't need.
> file { '/etc/nginx/conf.d/default.conf':
>   ensure  => 'absent',
>   # Need to force NGinx to restart after this change has completed so we 
> don't get a default page.
>   notify  => Service['ningx'],
> }
>
>
> However this fails because the service is defined within with NginX module, 
> not the profile. 
>
>
> Am I going about this in the wrong way? 
>
>
> Obviously I don't want it to restart every time Puppet runs, only triggered 
> by the file being removed.
>
>
> I was to avoid modifying the component module 
> https://forge.puppet.com/puppet/nginx if at all possible.
>
>
> Thanks,
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/81fb7aab-b02d-4311-80c2-0cf51bbb9ece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: restart NginX ONCE (after default file has been removed)

2017-03-03 Thread Michael Watters
notify events are queued and grouped together so nginx should only be 
restarted once when puppet runs.  You may also need to include nginx in 
your profile so that the service is properly defined.


On Friday, March 3, 2017 at 7:00:36 AM UTC-5, Steve Button wrote:
>
> Hi,
>
> I've got a small piece of puppet in my profile module to remove the 
> default nginx.conf file which gets installed by the nginx module. 
>
> # Upon install this file gets created and displays "Welcome to NginX" page, 
> which we don't need.
> file { '/etc/nginx/conf.d/default.conf':
>   ensure  => 'absent',
>   # Need to force NGinx to restart after this change has completed so we 
> don't get a default page.
>   notify  => Service['ningx'],
> }
>
>
> However this fails because the service is defined within with NginX module, 
> not the profile. 
>
>
> Am I going about this in the wrong way? 
>
>
> Obviously I don't want it to restart every time Puppet runs, only triggered 
> by the file being removed.
>
>
> I was to avoid modifying the component module 
> https://forge.puppet.com/puppet/nginx if at all possible.
>
>
> Thanks,
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3fd6ee29-96e5-4c38-927d-730fb09d8fd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: What's the best way to deal with multiple OS's

2017-03-02 Thread Michael Watters
This is pretty much exactly what module data is for.  Check 
out https://docs.puppet.com/puppet/4.9/lookup_quick_module.html for more 
details.


On Friday, September 30, 2011 at 2:33:50 PM UTC-4, Jeff Falgout wrote:
>
> We're in the situation of dealing with multiple operating systems (and 
> will likely add another) and I'm quickly realizing that building logic in 
> the manifest to deal with the differences in Red Hat i386 vs Red Hat x86_64 
> vs SuSE i586 vs SuSE x86_64 vs Mac is getting tedious. For instance, in the 
> sshd_config:
>
> SLES i586 has the sftp-server binary in a different path than the x86_64 
> version and it's different than RHEL - so I end up with logic as such:
>
> # Set the SFTP Path
> if $lsbdistid == 'SUSE LINUX' {
>if $architecture == 'x86_64' {
>   $sftppath = '/usr/lib64/ssh/sftp-server'
>} else {
>   $sftppath = '/usr/lib/ssh/sftp-server'
>}
> } else {
>$sftppath = "/usr/libexec/openssh/sftp-server"
> }
>
>
> Is there a better way to deal with different OS's or is the long and 
> winding road of config mgmt?
>
> Do people do something like:
>
> include ssh::server::$operatingsystem
>
> class ssh::server::RedHat {
>   blah
> }
>
> class ssh::server::SLES {
>   blah
> }
>
>
> Different modulepath? Different puppet servers based on OS? 
>
> Cheers,
>
> Jeff
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/55a8b25b-a8c3-400d-911f-2864cc2c4428%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: optimize my configuration

2017-02-13 Thread Michael Watters
ensure => '5.0' should work but you may want to add a dependency to the 
package resource to ensure that the file is downloaded first.

package { "package":
ensure => '5.0',
provider => 'rpm',
source => '/tmp/package-5.0.el6.noarch.rpm',
require => File['/tmp/package-5.0.el6.noarch.rpm',
}


On Monday, February 13, 2017 at 7:56:09 AM UTC-5, puppetstan wrote:
>
> Hi,
>
> i would like modify my conf because is not satisfactory
>
> i would live verify my package version and if my version is 5.0 i do 
> notfhing but if the version is 2.0 for example i download my package in 
> /tmp and i update package...this is my conf but it's not very good...
>
> file { "/tmp/package-5.0.el6.noarch.rpm":
> ensure => 'present',
>source => "puppet:///modules/package/package-5.0.el6.noarch.rpm"
>   }
>
> package { "package":
> ensure => '5.0',
> provider => 'rpm',
> source => "/tmp/package-5.0.el6.noarch.rpm"
> }
>
> can you have an idea with condition if i do nothing else dwonload package 
> and i update...
> regards
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/183e82ab-3287-449f-9612-93031acf0c91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: No nodes reported in Dashboard 2.0.0

2017-02-13 Thread Michael Watters


puppet-dashboard is EOL and has not been updated in quite a while. 
You'll need to move to a modern solution such as Puppetboard which does
work with Puppet Server and Puppetdb 4.



On Friday, February 10, 2017 at 3:06:23 PM UTC-5, Dimitri Yioulos wrote:
>
> Hi, All.
>
> Previously, I had a Puppet server running version 3.x, and Puppet 
> Dashboard 1.2.  Worked a treat.  Now, I created a new Puppet server version 
> 4.  I got that all working fine.  I also installed Dashboard 2.0.0.  While 
> I can see the Dashboard, there are no nodes reported.  Has anyone else 
> installed Puppet Dashboard 2.0.0 to work with Puppet 4 that might give me 
> some help?
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/fd8ca648-b1e7-4e55-952c-2ae980be771d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Issue with puppetlabs-java

2017-01-22 Thread Michael Watters


It looks like you need to add a package_type for deb and a case
statement for Ubuntu.  Would be a good time to patch the module and
submit a pull request.  :)



On Friday, January 20, 2017 at 10:37:58 AM UTC-5, Salty Old Cowdawg wrote:
>
> Supposedly on the forge site it says the module was tested under Ubuntu.  
> I'm running Ubuntu Xenial and when I apply the java::oracle class to the 
> machine I get --
>
> Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
> Server Error: Evaluation Error: Error while evaluating a Resource 
> Statement, Evaluation Error: Error while evaluating a Function Call, 
> unsupported platform Ubuntu at 
> /etc/puppetlabs/code/environments/production/modules/java/manifests/oracle.pp:127:11
>
>
> Suggestions?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cb81605c-ea7b-4d77-8855-6306000f017d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Announce: Puppet Agent 1.8.0 is available

2016-11-02 Thread Michael Watters


There seems to be a bug in the mount provider with the new puppet-agent 
1.8 package.  I have a node that is reporting changed file system 
options every time that puppet runs although nothing is actually 
changing.  I downgraded back to puppet-agent 1.7.1 and this behavior 
goes away.

 >Notice: /Stage[main]/Mount[/srv/git_home]/options: options changed 
'bind' to 'bind'

My cifs mounts are also reporting "changed" file system options as shown 
below.

 > Mount[/srv/mas-cad55-volumes]/options: options changed 
'credentials=/etc/tc-credentials,dir_mode=0555' to 
'credentials=/etc/tc-credentials,dir_mode=0555'

As you can see these are the exact same string.



On Tuesday, November 1, 2016 at 9:29:23 PM UTC-4, Geoff Nichols wrote:
>
> I’m excited to announce a new backwards-compatible feature release of 
> Puppet Agent. Puppet Agent 1.8.0 contains several updated component 
> versions, including new feature releases of Puppet and Facter.
>
> * Puppet 4.8.0 - This release includes several improvements to the type 
> system and updates puppet module tool to use "forgeapi.puppet.com" 
> (instead of "forgeapi.puppetlabs.com"). 
>
> * Facter 3.5.0 - New feature release allowing settings for configuring 
> external and custom fact directories, setting command line options, and 
> blocking facts - loaded by default from /etc/puppetlabs/facter/facter.conf.
>
> This release also adds support for macOS Sierra and Windows Server 2016. 
>
> Release notes for each of these are linked from the main puppet-agent 
> note: 
> https://docs.puppet.com/puppet/4.8/reference/release_notes_agent.html
>
> For information on upcoming platform end-of-life (EOL) for Puppet Agent, 
> please see our Platform Support Lifecycle page: 
> https://puppet.com/content/platform-support-lifecycle
>
> Community shout-out to Clay Caviness for several contributions to this 
> release - including a fix for ‘tidy’ and additional fixes for Mac OS X. 
>
>
> -- 
> Geoff Nichols
> Puppet Ecosystem - Agent and Platform Team
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0e45a4d0-5b87-4d5d-9a23-0530f7b57bbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet agent not able to connect to puppet server after rebooting puppet server

2016-10-24 Thread Michael Watters
Looks like your master's host name isn't included on the certificate.  Are 
you able to run the agent using puppet agent -t --server puppet ?

You can also see what host names are returned by the master's cert using 
openssl.

openssl s_client -connect puppet:8140

This should show you the entire certificate chain.  For example:

openssl s_client -connect puppet:8140
> CONNECTED(0003)
> depth=0 CN = puppetmaster.example.com
> verify error:num=20:unable to get local issuer certificate
> verify return:1
> depth=0 CN = puppetmaster.example.com
> verify error:num=21:unable to verify the first certificate
> verify return:1
> ---
> Certificate chain
>  0 s:/CN=puppetmaster.example.com
>i:/CN=Puppet CA: puppet-f20.example.com
>
>
On Friday, October 21, 2016 at 8:27:17 AM UTC-4, rakshath...@yahoo.in wrote:
>
> Hi All,
>
> I have puppet open source installed on RHEL server and puppet agent on 
> windows server 2012. Setup was done and was working fine, but after 
> rebooting the puppet server, command puppet agent -t is throwing an error 
> *'Failed 
> to generate additional resources using 'eval_generate': Server hostname 
> '' did*
>
> *not match server certificate; expected one of localhost.localdomain, 
> DNS:puppet, DNS:localhost.localdomain'. *Can anyone help me understand 
> this issue, or help me get it resolved permanently?
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/70dbd2fe-7060-406d-9626-394185d2b336%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to find out, which directories/objects are puppetized?

2016-10-11 Thread Michael Watters


Puppet keeps a cache of classes and resources on every node.  You can 
look at the /opt/puppetlabs/puppet/cache/state/resources.txt file to see 
which resources are managed by puppet.



On Tuesday, October 11, 2016 at 7:41:11 AM UTC-4, Al wrote:
>
> Hi, subj. 
> Configuration is very complex, so there may be wasted too much time to 
> determine, when and how every config resolves directory name. Any simple 
> way to get it from puppet agent right on host?
> Tnx
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9a1e7eee-af3c-47d6-9c96-30ec6dd0927b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: I am unable to download puppet 3 above version

2016-07-14 Thread Michael Watters
Depending on what you need you can install puppet packages directly from 
the puppet repos as documented here.

https://docs.puppet.com/puppet/4.5/reference/install_linux.html#install-a-release-package-to-enable-puppet-collection-repositories


On Thursday, July 14, 2016 at 3:12:51 AM UTC-4, krishna kanth wrote:
>
> Any one can provide link for puppet 3 above version
>  
> Thanks in advance
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/90720ff1-6e15-4adb-a67f-21f8ef5317a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: hiera-eyaml not decrypting?

2016-07-08 Thread Michael Watters
I think I ran into a similar issue before.  Try putting "eyaml" as the 
first backend to see if that helps.

Here's a copy of our hiera.yaml file which works.

---
:backends:
  - eyaml
  - yaml


:hierarchy:
  - "nodes/%{::trusted.certname}"
  - common


:yaml:
# datadir is empty here, so hiera uses its defaults:
# # - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
# # - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata 
on Windows
# # When specifying a datadir, make sure the directory exists.
#   :datadir:


:eyaml:
:extension: 'yaml'
:pkcs7_private_key: '/etc/puppetlabs/puppet/keys/private_key.pkcs7.pem'
:pkcs7_public_key:  '/etc/puppetlabs/puppet/keys/public_key.pkcs7.pem'



On Friday, July 8, 2016 at 1:09:02 PM UTC-4, dkoleary wrote:
>
> Hi;
>
> I have hiera.eyaml installed and functional from the CLI; however, when I 
> attempt to use it in a module, the encrypted string is being used rather 
> than the decrypted value.
>
> I have to be missing something mind numbingly simple; but, I've been 
> through the doc at https://github.com/TomPoulton/hiera-eyaml so many 
> times it's starting to blur.  Can someone tell me waht I messed up?
>
> From the CLI:
>
> -bash-4.1$ cat nap1d030.yaml 
> ---
> # mpintp::source: 'ntp.conf.dmz'
> # mpisyslog::el6::source: 'mpi-custom.conf'
> mpisshd::enabled: false
> mpiroot::pwd: >
> ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw
> DQYJKoZIhvcNAQEBBQAEggEAANy7eyKzeNLVeNqF3h4qM5pEw38G8yWJOezA
> SQ72MugY8FgwIWNsE2TmS3W2jBe1/zTAggd5p79RBubIdfL5DDPjjNTimzgV
> k0qppx3EefolMSzphfvVv5JOz8ue13OvpzFV/MM5qZLhOeUFAIUY3NM9RqHN
> PVM/woxhpnjMStlKXGakJYxLrf8ucMLh5WrW7JpN0jvjjVlVJjGsLaqygUsC
> alJ3zQkgxtaR0SCCgvvsJ2wYCs82fVnuFf6d0g4cPPCGnT3CtNFFffQMlwTt
> uEErGyKswxMPnKWybFNLYj+cVOhbLf946CMzCUcpWUIdHBnT3BcAi4qiryJF
> 6O91WzA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBA5QFyFpSmqqxUlAByZ
> qFWsgBDY6tjQ9Pbb4nRHCvkI29ve]
>
>
> -bash-4.1$ eyaml decrypt -f ./nap1d030.yaml 
> [hiera-eyaml-core] Loaded config from /opt/puppetlabs/server/data/
> puppetserver/.eyaml/config.yaml
> ---
> # mpintp::source: 'ntp.conf.dmz'
> # mpisyslog::el6::source: 'mpi-custom.conf'
> mpisshd::enabled: false
> mpiroot::pwd: snipped
>
> The test module just does a notify:
>
> class mpiroot (
>   $pwd,
> ) {
>
>   notify { "Password: ${pwd}": }
> }
>
>
> And the run shows the encrypted string:
>
> $ sudo puppet agent -t
> Notice: Local environment: 'production' doesn't match server specified 
> node environment 'dkoleary', switching agent to 'dkoleary'.
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Loading facts
> Info: Caching catalog for nap1d030.multiplan.com
> Info: Applying configuration version '1467996521'
> Notice: Password: 
> ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw 
> DQYJKoZIhvcNAQEBBQAEggEAANy7eyKzeNLVeNqF3h4qM5pEw38G8yWJOezA 
> SQ72MugY8FgwIWNsE2TmS3W2jBe1/zTAggd5p79RBubIdfL5DDPjjNTimzgV 
> k0qppx3EefolMSzphfvVv5JOz8ue13OvpzFV/MM5qZLhOeUFAIUY3NM9RqHN 
> PVM/woxhpnjMStlKXGakJYxLrf8ucMLh5WrW7JpN0jvjjVlVJjGsLaqygUsC 
> alJ3zQkgxtaR0SCCgvvsJ2wYCs82fVnuFf6d0g4cPPCGnT3CtNFFffQMlwTt 
> uEErGyKswxMPnKWybFNLYj+cVOhbLf946CMzCUcpWUIdHBnT3BcAi4qiryJF 
> 6O91WzA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBA5QFyFpSmqqxUlAByZ 
> qFWsgBDY6tjQ9Pbb4nRHCvkI29ve]
> [[snip]]
>
>
> The hiera.yaml file and keys:
>
> ---
> :backends:
>   - yaml
>   - eyaml
> :hierarchy:
>   - "hosts/%{facts.hostname}"
>   - "environments/%{facts.environment}"
>   - "host_env/%{facts.env}"
>   - "dc/%{facts.dc}"
>   - "os/%{facts.operatingsystemmajrelease}"
>   - common
> :yaml:
>   :datadir: /etc/puppetlabs/code/hieradata
> :eyaml:
>   :extension: 'yaml'
>   :datadir: /etc/puppetlabs/code/hieradata
>   :pkcs7_private_key: /etc/puppetlabs/secure/keys/private_key.pkcs7.pem
>   :pkcs7_public_key: /etc/puppetlabs/secure/keys/public_key.pkcs7.pem
>
>
> -bash-4.1$ ls -ld /etc/puppetlabs/secure/keys/{public,private}_key*.pem
> -r. 1 puppet puppet 1675 Jul  8 11:28 /etc/puppetlabs/secure/keys/
> private_key.pkcs7.pem
> -r. 1 puppet puppet 1050 Jul  8 11:28 /etc/puppetlabs/secure/keys/
> public_key.pkcs7.pem
>
> Any hints/tips, etc gratefully accepted.
>
> Thanks
>
> Doug
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/095fbca4-af87-41fb-8b59-53373b7cbad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Augtool installation

2016-06-24 Thread Michael Watters
You'll need to install the package that provides augtool in order to use it.

yum provides augtool should show you what package to install.


On Friday, June 24, 2016 at 9:29:25 AM UTC-4, Shrawan Bhagwat wrote:
>
> Hi All,
>
> I have installed Augeas setup from yum repository using command yum 
> install ruby-augeas.x86_64.
>
> I have got all packages of Augeas but not able to find command Augtool.
>
> Please help!
>
> Regards,
> Shrawan
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/88e90a53-ce3e-4a97-b556-dc43d5b0f653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Removing unmanaged path /etc/puppetlabs/code/environments/ - r10k

2016-06-17 Thread Michael Watters


I actually take the opposite approach.  Modules from the forge go in a 
directory named "forge_modules" and r10k will leave anything located in 
modules alone.

 From r10k.yaml:

forge 'http://forge.puppetlabs.com'
moduledir 'forge_modules'



On Friday, June 17, 2016 at 5:28:42 PM UTC-4, Rob Nelson wrote:
>
> r10k will deploy the modules listed in the Puppetfile into the modules 
> directory. If you need some local (to the controlrepo) modules that are not 
> deployed from the Puppetfile, the recommendation is to add them to a 
> directory called site, dist, or similar, and create a file called 
> environment.conf that says:
>
> modulepath = site:modules:$basemodulepath
>
> This allows the contents of the site directory (within the repo), modules 
> (populated by r10k) and the $basemodulepath (set via puppet.conf or 
> defaults, oftentimes unused) to all be valid module locations without r10k 
> or other automation stepping all over it. 
>
>
> Rob Nelson
> rnel...@gmail.com 
>
> On Fri, Jun 17, 2016 at 4:56 PM, Ali  
> wrote:
>
>>
>> r10k deployment is failing, if  my repo paths has  "modules"  in it .   
>> if I change modules to any other word or even module it works fine .  In 
>> order to correctly map environment on my puppet master I need r10k to map 
>> repo as /etc/puppetlabs/code/environments/production [branch name ] / 
>> modules/ modulename .  Trying to figure out where is conflict any help will 
>> be appreciated . 
>>
>> *repo server :*
>>
>> [gitcodereposerver coderepo]# ls -la
>> total 16
>> drwxr-x--- 4 root root 4096 Jun 17 16:35 .
>> drwxr-x--- 7 root root 4096 Jun 15 15:43 ..
>> drwxr-x--- 8 root root 4096 Jun 17 16:35 .git
>> drwxr-x--- 3 root root 4096 Jun 17 16:35 modules
>>
>>
>> gitcodereposerver coderepo]# git branch -v
>>   development ad420ad test
>> * production  ad420ad test
>>
>>
>>
>> *puppet master:* 
>>
>>
>>
>> puppetmaster r10k]# cat r10k.yaml
>> ---
>> sources:
>>   main:
>> remote: 'root@gitcodereposerver:/home/pupp/coderepo'
>> basedir: '/etc/puppetlabs/code/environments'
>>
>>
>>  puppetmaster]#r10k deploy environment -pv
>> INFO -> Deploying environment /etc/puppetlabs/code/environments/
>> development
>> INFO -> Environment development is now at 
>> a20646d68ed3259e3ae6eeda6c31dfca9f9ab9f0
>> INFO -> Deploying environment /etc/puppetlabs/code/environments/
>> production
>> INFO -> Environment production is now at 
>> c73bcc40b41373d87908093035be58e60fc2ea29
>> INFO -> Removing unmanaged path /etc/puppetlabs/code/environments/
>> production/modules/compliance
>>
>>
>> no compliance folder under modules  as shown below .
>>
>> puppetmaster environments]# ls
>> development  production
>> [ environments]# cd production/
>> [ production]# ls
>> modules
>> [ production]# cd modules/
>> [modules]# ls
>>
>>
>>
>> Thanks,
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/f0b9c4e2-a90a-4b3e-ab75-094592e457d0%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2f81ed5f-f975-47b9-9781-81eaf2149a13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: environmentpath in manifest

2016-05-13 Thread Michael Watters


You may need to create a custom fact to determine the environment when 
the agent runs.  For example, here's a
custom fact that reads the environment from a file.

Facter.add("environment") do
   setcode do
 Facter::Util::Resolution.exec('/bin/cat /usr/local/etc/environment')
   end
end

Your site manifest can also be set to update the file contents when it runs.



On Monday, May 9, 2016 at 9:45:38 AM UTC-4, Daniele Palumbo wrote:
>
> Hi, 
>
> i need to check if a file exists on the puppet master. 
>
> No big deal: 
>
> http://stackoverflow.com/questions/18784329/how-to-test-for-existence-of-a-file-on-the-puppet-master
>  
>
> So i made: 
> -- 
> cat ./modules/braveconf/lib/puppet/parser/functions/file_exists.rb 
> require"puppet" 
>   module Puppet::Parser::Functions 
> newfunction(:file_exists, :type => :rvalue) do |args| 
> if File.exists?(args[0]) 
>   return 1 
> else 
>   return 0 
> end 
>   end 
> end 
> -- 
>
> Now, my problem is about path. 
>
> Since i have environmentpath, as seen is 
> puppet config print  environmentpath --section master --environment 
> development 
> /etc/puppetlabs/code/environments 
>
> I would like to use, in the manifest: 
> -- 
> if ( file_exists 
> ("${::environmentpath}/${::environment}/modules/module/files/configfile-${::hostname}")
>  
> == 1 ) { 
> -- 
>
> But ${::environmentpath} is empty. 
>
> How can i manage this topic, avoiding to hardcode 
> /etc/puppetlabs/code/environments in the code? 
> Is there a way to get variable from puppet master config? 
>
> Thanks, 
> Daniele 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9b1f21ea-a95c-4bd3-a44d-8ba85b32a636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.