[Puppet Users] How to send console notice to notify email?

2017-04-03 Thread staceytian4321
Hi,

I am using open source puppet 3.7.3 master and client.

I would like to send the notice output of a manifest to email (I don't want 
to receive email about all manifests' notice, just this special manifest). 

In /etc/puppet/tagmail.conf:
pkgNotSync_notice: myem...@hotmail.com

Then I created a new manifest called "pkgcheck" which will call a custom 
function. This custom function (
http://ryanuber.com/11-06-2012/manage-sets-of-packages-in-puppet.html) is 
called "apply_package_list". It will check what packages are missing or 
with incorrect version. This function accepts two argument and has no 
return value. 

Then I created /etc/puppet/modlues/pkgcheck/manifests/init.pp and 
checkpkg.pp.

In checkpkg.pp, I call this function first, then create a notify resource:

class pkgcheck::checkpkg inherits pkgcheck  {
 
   apply_package_list('/root/packagelist', 'nopurge')
   
   notify { 'packageCheck':
  noop=> true,
  tag => packageNotSync_notice, 
  } 
}

When I ran "puppet agent -t" on my client machine, the console displays 
exactly what two packages are not synced (caironmm-1.0.x86_64 and 
libkkc-0.2.1-9.el7.x86_64):

Notice: /Package[caironmm-1.0.x86_64]/ensure: current_value absent, should 
be latest (noop)
Notice: /Package[libkkc-0.2.1-9.el7.x86_64]/ensure: current_value absent, 
should be latest (noop)
Notice: /Stage[main]/Pkgcheck::Checkpkg/Notify[packageCheck]/message: 
current_value absent, should be packageCheck (noop)

However, in the email I received, it only contains the last line which list 
the overall result:

Mon Apr 03 10:48:25 -0400 2017 
/Stage[main]/Pkgcheck::Checkpkg/Notify[packageCheck]/message (notice): 
current_value absent, should be packageCheck (noop) 

I would like to receive the email which looks the same as what is displayed 
on the console for this manifest. 

Please advise how I can achieve this purpose?

Thanks,
Stacey

-- 
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/f7e6385a-7fed-40cc-bfdb-51b431cd16eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to set noop = true in manifest for custom function?

2017-04-03 Thread staceytian4321
Hi Rob,

Thank you for the reply.

The missing comma is a type in the post. In my actual test, I had the comma.

I figured out how to enable noop = true for my custom function.

I edited my custom function

from
{:name => package, :ensure => "latest"}
to
{:name => package, :noop => true, :ensure => "latest"}

Thanks,
Stacey.

On Saturday, April 1, 2017 at 2:58:15 PM UTC-4, Rob Nelson wrote:
>
> In your second example, you're missing a comma after true. Not sure if 
> that's bad copy pasta or accurate with the source. 
>
> On Sat, Apr 1, 2017 at 12:21 PM  
> wrote:
>
>> Hi,
>>
>> I am using open source puppet 3.7.3 master and client.
>>
>> I know how to set noop = true in an individual manifest. For example,
>>
>> file { "/tmp/testfile1" :
>>ensure => present,
>>noop => true
>> }
>>
>> Now I am trying a custom function (
>> http://ryanuber.com/11-06-2012/manage-sets-of-packages-in-puppet.html). 
>> This custom function is called "apply_package_list" and accepts tow 
>> arguments.
>>
>> I created a new manifest called "pkgcheck" and placed this 
>> apply_package_list.rb in its folder 
>> /etc/puppet/modules/pkgcheck/lib/puppet/parser/functions/
>>
>> Then I created /etc/puppet/modlues/pkgcheck/manifests/init.pp and 
>> checkpkg.pp.
>>
>> In checkpkg.pp:
>>
>> class pkgcheck::checkpkg inherits pkgcheck  {
>> apply_package_list("/root/packagelist","nopurge") 
>>  }
>>
>> It works fine when I run "puppet agent -t" on my client machine. It will 
>> check what package is missing or with incorrect version, then try to update 
>> that package.
>>
>> Then I tried to use the noop option to disable the update of the package. 
>> I only want to be notified, but don't do anything.
>>
>> class pkgcheck::checkpkg inherits pkgcheck  {
>>   noop => true  
>>   apply_package_list("/root/packagelist","nopurge") 
>>  }
>>
>> It doesn't work and returns error when I ran "puppet agent -t" on client 
>> machine:
>>
>> Error: Could not retrieve catalog from remote server: Error 400 on 
>> SERVER: Syntax error at '=>'; expected '}' at 
>> /etc/puppet/modules/pkgcheck/manifests/checkpkg.pp:6 on node testclient.
>>
>> I also tried with "$noop = true". This will not give syntax error, but it 
>> doesn't have any effect and puppet will still try to update the package.
>>
>> If I run this command on client machine, it works fine:
>> puppet apply --noop -e 'apply_package_list("/root/packagelist", 
>> "nopurge")'
>>
>> Please advise how I can set noop = true for this custom function? This 
>> function has no return value.
>>
>> Thanks,
>> Stacey
>>
>> -- 
>> 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/5b005c57-d25b-42ef-a88b-bc770dbbb7e2%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Rob Nelson 
>

-- 
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/5d8c9010-b8c7-4659-98da-a5e8487b0fb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to set noop = true in manifest for custom function?

2017-04-01 Thread staceytian4321
Hi,

I am using open source puppet 3.7.3 master and client.

I know how to set noop = true in an individual manifest. For example,

file { "/tmp/testfile1" :
   ensure => present,
   noop => true
}

Now I am trying a custom function 
(http://ryanuber.com/11-06-2012/manage-sets-of-packages-in-puppet.html). 
This custom function is called "apply_package_list" and accepts tow 
arguments.

I created a new manifest called "pkgcheck" and placed this 
apply_package_list.rb in its folder 
/etc/puppet/modules/pkgcheck/lib/puppet/parser/functions/

Then I created /etc/puppet/modlues/pkgcheck/manifests/init.pp and 
checkpkg.pp.

In checkpkg.pp:

class pkgcheck::checkpkg inherits pkgcheck  {
apply_package_list("/root/packagelist","nopurge") 
 }

It works fine when I run "puppet agent -t" on my client machine. It will 
check what package is missing or with incorrect version, then try to update 
that package.

Then I tried to use the noop option to disable the update of the package. I 
only want to be notified, but don't do anything.

class pkgcheck::checkpkg inherits pkgcheck  {
  noop => true  
  apply_package_list("/root/packagelist","nopurge") 
 }

It doesn't work and returns error when I ran "puppet agent -t" on client 
machine:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Syntax error at '=>'; expected '}' at 
/etc/puppet/modules/pkgcheck/manifests/checkpkg.pp:6 on node testclient.

I also tried with "$noop = true". This will not give syntax error, but it 
doesn't have any effect and puppet will still try to update the package.

If I run this command on client machine, it works fine:
puppet apply --noop -e 'apply_package_list("/root/packagelist", "nopurge")'

Please advise how I can set noop = true for this custom function? This 
function has no return value.

Thanks,
Stacey

-- 
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/5b005c57-d25b-42ef-a88b-bc770dbbb7e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to specify wildcat in target path?

2015-10-08 Thread staceytian4321
Hi all,

I am using open source puppet 3.7.3. Wondering if anyone knows how to 
specify wildcat in target path?

For example, I want to specify a target path as:

/home/user/*/test1/*/local

I don't know what the pattern will be under folder /home/user, so I need to 
use /home/user/*

But it doesn't work

Any clue how to achieve this function?

Thanks,
Stacey

-- 
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/67af788e-7365-484a-9ac5-e9c4a4286f0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to get tag email for specific notice while overall tag level set to err?

2015-09-01 Thread staceytian4321
Hi,

I made some progress.

1. Add the metaparameter tag => send_me_email (or any arbitrary set of tag 
values) to the resource you want to monitor via email.
2. Enable reports = tagmail in puppet.conf [master] section,
3. In tag.conf set tag and email address: send_me_email: us...@test.com

class javalinks {

file {   
"/usr/java/latest": 
ensure => link,
noop   => true,
tag => send_me_email,
  }
}

Now I get email for this class even if my overall tag log level is set to 
err and above, while this class is giving Notice log.

However, there is another Notice for this class which I don't want to get 
email notification:

Notice: /File[/usr/java/latest]/seluser: current_value unconfined_u, should 
be system_u (noop)

I only want to get email for this message in this class:


*Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure: 
current_value absent, should be link (noop)*So here is the quesetion:
How to tag a specify notice in a class?

Thanks,
Stacey

On Monday, August 31, 2015 at 2:59:21 PM UTC-4, staceyt...@gmail.com wrote:
>
> Hi all,
>
> I am using Puppet 3.7.3 and have a question about tagmail.
>
> My tagmail.conf is setup to send email only when there is err and above:
> *err, alert, emerg, crit: us...@test.com *
>
> I have a module to check javalinks:
>
> class javalinks {
>
> file {   
> "/usr/java/latest": 
> ensure => link,
> noop   => true,
>   }
> }
>
> I want the module to ensure /usr/java/latest is a link, but don't do 
> anything (noop => true). 
> I want to get an email notifcation if the link is missing.
>
> If I don't have such a link, run "puppet agent -t" on the machine will 
> display this on console:
>
> *  Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure: 
> current_value absent, should be link (noop)*
>
> Since it is "Notice" level log, I don't get any email notification. 
>
> So here is my question:
>
> *How could I get email notification for this specific Notice message, 
> without changing my tagmail.conf log level?* 
>
> Thanks,
> Stacey
>

-- 
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/f4f26b65-5765-4221-9a88-b081fe54fa29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to get tag email for specific notice while overall tag level set to err?

2015-09-01 Thread staceytian4321
Hi all,

I figured it out. 

class javalinks {

file {   
"/usr/java/latest": 
ensure => link,
noop   => true,
tag => send_me_email,

  selinux_ignore_defaults => true,

  }
}

Thanks,
Zaiwen 



On Tuesday, September 1, 2015 at 1:21:14 PM UTC-4, staceyt...@gmail.com 
wrote:
>
> Hi,
>
> I made some progress.
>
> 1. Add the metaparameter tag => send_me_email (or any arbitrary set of tag 
> values) to the resource you want to monitor via email.
> 2. Enable reports = tagmail in puppet.conf [master] section,
> 3. In tag.conf set tag and email address: send_me_email: us...@test.com
>
> class javalinks {
>
> file {   
> "/usr/java/latest": 
> ensure => link,
> noop   => true,
> tag => send_me_email,
>   }
> }
>
> Now I get email for this class even if my overall tag log level is set to 
> err and above, while this class is giving Notice log.
>
> However, there is another Notice for this class which I don't want to get 
> email notification:
>
> Notice: /File[/usr/java/latest]/seluser: current_value unconfined_u, 
> should be system_u (noop)
>
> I only want to get email for this message in this class:
>
>
> *Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure: 
> current_value absent, should be link (noop)*So here is the quesetion:
> How to tag a specify notice in a class?
>
> Thanks,
> Stacey
>
> On Monday, August 31, 2015 at 2:59:21 PM UTC-4, staceyt...@gmail.com 
> wrote:
>>
>> Hi all,
>>
>> I am using Puppet 3.7.3 and have a question about tagmail.
>>
>> My tagmail.conf is setup to send email only when there is err and above:
>> *err, alert, emerg, crit: us...@test.com *
>>
>> I have a module to check javalinks:
>>
>> class javalinks {
>>
>> file {   
>> "/usr/java/latest": 
>> ensure => link,
>> noop   => true,
>>   }
>> }
>>
>> I want the module to ensure /usr/java/latest is a link, but don't do 
>> anything (noop => true). 
>> I want to get an email notifcation if the link is missing.
>>
>> If I don't have such a link, run "puppet agent -t" on the machine will 
>> display this on console:
>>
>> *  Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure: 
>> current_value absent, should be link (noop)*
>>
>> Since it is "Notice" level log, I don't get any email notification. 
>>
>> So here is my question:
>>
>> *How could I get email notification for this specific Notice message, 
>> without changing my tagmail.conf log level?* 
>>
>> Thanks,
>> Stacey
>>
>

-- 
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/3a30a950-9020-4c89-b870-3560426ac361%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to get tag email for specific notice while overall tag level set to err?

2015-08-31 Thread staceytian4321
Hi all,

I am using Puppet 3.7.3 and have a question about tagmail.

My tagmail.conf is setup to send email only when there is err and above:
*err, alert, emerg, crit: us...@test.com*

I have a module to check javalinks:

class javalinks {

file {   
"/usr/java/latest": 
ensure => link,
noop   => true,
  }
}

I want the module to ensure /usr/java/latest is a link, but don't do 
anything (noop => true). 
I want to get an email notifcation if the link is missing.

If I don't have such a link, run "puppet agent -t" on the machine will 
display this on console:

*  Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure: 
current_value absent, should be link (noop)*

Since it is "Notice" level log, I don't get any email notification. 

So here is my question:

*How could I get email notification for this specific Notice message, 
without changing my tagmail.conf log level?* 

Thanks,
Stacey

-- 
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/3ba15882-3483-433f-ae5f-7ad287ec226a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to change not reports nodes from 30 days to 1 day?

2015-07-03 Thread staceytian4321
Hi guys,

I have a question about Puppet Dashboard report.

I am using open source Puppet 3.7.3 and Dashboard.

On puppet dashboard, I can check which nodes has not reported 
http://mypuppetmaster:3000/nodes/unreported

Daily run status 

Number and status of runs during the *last 30 days*:

— No runs found to report — 

Question: by default only nodes that have not reported in* last 30 days* 
will be listed there. 
Can I change this configuration to list nodes not reported in *1 day?*

Thanks,
Stacey


-- 
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/2ea1118e-3e16-47da-b9c2-756dffdd4d6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to ensure puppet agent run if cron is used and service disabled?

2015-07-02 Thread staceytian4321
Hi,

I have a question about how to manage puppet agent run.

I am using cron for Puppet agent to run at a specific time. 
Since I use cron to run puppet agent, I disable the puppet daemon service 
(chkconfig puppet off; service puppet stop)

It has been working fine. 
However, yesterday, I noticed that on one machine, someone accidentally 
removed the puppet cron. 

In  this case, this machine won't have puppet agent run, because puppet 
cron is gone and puppet agent is not running to receive cron creation from 
puppet master. 

How do you handle this situation? Periodically check report to see if which 
machine has not reported? 

Thanks,
Stacey

-- 
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/a4b8c160-6fb7-4c83-a6fc-dacc9c9579cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to ensure puppet agent run if cron is used and service disabled?

2015-07-02 Thread staceytian4321
Thank you LinuxDan! I will take a look.

Stacey

On Thursday, July 2, 2015 at 10:51:55 AM UTC-4, LinuxDan wrote:

 You can also check /var/lib/puppet/state on each agent for details of the 
 last run.

 If you use reporting, /var/lib/puppet/reports on the puppet master will 
 yield similar info

 On Jul 2, 2015, at 10:12 AM, staceyt...@gmail.com javascript: wrote:

 Hi,

 I have a question about how to manage puppet agent run.

 I am using cron for Puppet agent to run at a specific time. 
 Since I use cron to run puppet agent, I disable the puppet daemon service 
 (chkconfig puppet off; service puppet stop)

 It has been working fine. 
 However, yesterday, I noticed that on one machine, someone accidentally 
 removed the puppet cron. 

 In  this case, this machine won't have puppet agent run, because puppet 
 cron is gone and puppet agent is not running to receive cron creation from 
 puppet master. 

 How do you handle this situation? Periodically check report to see if 
 which machine has not reported? 

 Thanks,
 Stacey
  
 -- 
 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 javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/a4b8c160-6fb7-4c83-a6fc-dacc9c9579cb%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/a4b8c160-6fb7-4c83-a6fc-dacc9c9579cb%40googlegroups.com?utm_medium=emailutm_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/0f115ed9-0327-41da-9e6e-9a063ee53c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to ensure puppet agent run if cron is used and service disabled?

2015-07-02 Thread staceytian4321
Thank you Christopher! I will take a look.

Stacey

On Thursday, July 2, 2015 at 10:42:20 AM UTC-4, Christopher Wood wrote:

 Get yourself a reporting dashboard which lists hosts not checking in (late 
 catalogs or reports in puppetdb). This one is nice: 

 https://github.com/spotify/puppetexplorer 

 If they've also broken mcollective you'll actually have to ssh to the 
 host, otherwise just kick off an agent run remotely (with the mcollective 
 puppet plugin). 

 On Thu, Jul 02, 2015 at 07:12:29AM -0700, staceyt...@gmail.com 
 javascript: wrote: 
 Hi, 
  
 I have a question about how to manage puppet agent run. 
  
 I am using cron for Puppet agent to run at a specific time. 
 Since I use cron to run puppet agent, I disable the puppet daemon 
 service 
 (chkconfig puppet off; service puppet stop) 
  
 It has been working fine. 
 However, yesterday, I noticed that on one machine, someone 
 accidentally 
 removed the puppet cron. 
  
 In  this case, this machine won't have puppet agent run, because 
 puppet 
 cron is gone and puppet agent is not running to receive cron creation 
 from 
 puppet master. 
  
 How do you handle this situation? Periodically check report to see if 
 which machine has not reported? 
  
 Thanks, 
 Stacey 
  
 -- 
 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 [1]puppet-users...@googlegroups.com javascript:. 
 To view this discussion on the web visit 
 [2]
 https://groups.google.com/d/msgid/puppet-users/a4b8c160-6fb7-4c83-a6fc-dacc9c9579cb%40googlegroups.com.
  

 For more options, visit [3]https://groups.google.com/d/optout. 
  
  References 
  
 Visible links 
 1. mailto:puppet-users+unsubscr...@googlegroups.com javascript: 
 2. 
 https://groups.google.com/d/msgid/puppet-users/a4b8c160-6fb7-4c83-a6fc-dacc9c9579cb%40googlegroups.com?utm_medium=emailutm_source=footer
  
 3. 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/7e104cc6-643b-4a81-ba4a-c9406b477bf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to have puppet install package only if one file doesn't exist?

2015-06-10 Thread staceytian4321
Hi all,

I am trying to use puppet to push package flex-devel-2.5.35-9.el6.i686 
only if the file /usr/lib/libl.a doesn't exist.

I tried several ways, but still can't get it work.

Any suggestions?

Thanks,
Stacey

-- 
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/b71b5ef7-ce90-444c-8745-2160116ec8b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to have puppet install package only if one file doesn't exist?

2015-06-10 Thread staceytian4321
Hi Kaustubh,

Thank you very much! I will give it a try!

Thanks,
Stacey

On Wednesday, June 10, 2015 at 1:08:46 PM UTC-4, kaustubh chaudhari wrote:

 You can create a custom fact to check for that file if the file dose not 
 exist then install else do nothing.

 ==
 Facter.add(:bigfix) do
   confine :kernel = Linux
   setcode do
 if File.exist? /etc/init.d/besclient
 true
 else false
 end
   end
 end
 ==

 if this file exist i ignore it else i install bigfix.

 Hope this help.

 -Kaustubh

 On Wednesday, June 10, 2015 at 9:27:14 AM UTC-4, staceyt...@gmail.com 
 wrote:

 Hi all,

 I am trying to use puppet to push package flex-devel-2.5.35-9.el6.i686 
 only if the file /usr/lib/libl.a doesn't exist.

 I tried several ways, but still can't get it work.

 Any suggestions?

 Thanks,
 Stacey



-- 
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/20f67290-7b91-4391-a8d3-3afa8d3c9117%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Dependency problem for Puppet yum package

2015-04-08 Thread staceytian4321
Hi John and Alex,

Thank you for the detail reply. I appreciate it very much!

I will do more test and let you know how it is going.

Thanks,
Stacey

On Monday, April 6, 2015 at 1:05:09 PM UTC-4, staceyt...@gmail.com wrote:

 Hi all,

 I am trying to use puppet to downgrade my gdm package from 64 to 39, but 
 got package dependency problem:

 Here is my class:

 class gdmver39 {
   yumrepo { 'custom':
 baseurl = 'file:/home/admin/REPO/WS6.4',
 enabled = 1,
   }

   package { gdm-libs: ensure = '2.30.4-39.el6', require = 
 Yumrepo[custom] }   
   package { gdm-plugin-fingerprint: ensure = '2.30.4-39.el6', require 
 = Yumrepo[custom] }
   package { gdm: ensure = '2.30.4-39.el6', require = Yumrepo[custom] 
 } 
 }

 I think myabe i should add the parameter below to my 'gdm' line'?

   require Package['gdm-libs', 'gdm-plugin-fingerprint'] 

 How to tell puppet to handle the dependency automatically?

 Thanks,
 Stacey


-- 
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/cc991241-4fa9-41ed-8630-984de885266a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Dependency problem for Puppet yum package

2015-04-06 Thread staceytian4321
Hi all,

I am trying to use puppet to downgrade my gdm package from 64 to 39, but 
got package dependency problem:

Here is my class:

class gdmver39 {
  yumrepo { 'custom':
baseurl = 'file:/home/admin/REPO/WS6.4',
enabled = 1,
  }

  package { gdm-libs: ensure = '2.30.4-39.el6', require = 
Yumrepo[custom] }   
  package { gdm-plugin-fingerprint: ensure = '2.30.4-39.el6', require = 
Yumrepo[custom] }
  package { gdm: ensure = '2.30.4-39.el6', require = Yumrepo[custom] 
} 
}

I think myabe i should add the parameter below to my 'gdm' line'?

  require Package['gdm-libs', 'gdm-plugin-fingerprint'] 

How to tell puppet to handle the dependency automatically?

Thanks,
Stacey

-- 
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/4677198b-481d-4342-929a-d353df797645%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Help! Could not autoload puppet/provider/package/rpm

2015-03-26 Thread staceytian4321
Wil,

Thank you for the reply.

Yes, I checked and found that SELinux was enabled post-install.

Then I set SELinux to Permissive and reinstall everything, but still same 
error.

Can you explain more detail about `restorecon -n -v -r /`?

Thanks,
Stacey




On Monday, March 23, 2015 at 3:11:40 PM UTC-4, Wil Cooley wrote:

 On Mon, Mar 23, 2015 at 6:35 AM staceyt...@gmail.com javascript: 
 wrote:

 Hi all,

 I am using Puppet agent 3.7.3 on Red Hat Linux. On one of my machines, when 
 I run puppet agent --test, I received error:

 Puppet (err): Could not autoload puppet/provider/package/rpm: No such file 
 or directory - /tmp/puppet20150323-27791-6xy78b.lock
 Puppet (err): Could not autoload puppet/type/package: Could not autoload 
 puppet/provider/package/rpm: No such file or directory - 
 /tmp/puppet20150323-27791-6xy78b.lock
 Puppet (err): Could not retrieve catalog from remote server: Could not 
 intern from text/pson: Could not autoload puppet/type/package: Could not 
 autoload puppet/provider/package/rpm: No such file or directory - 
 /tmp/puppet20150323-27791-6xy78b.lock
 Puppet (err): Could not retrieve catalog; skipping run

 Any clue why this happens? 


 SELinux enabled post-install, so various bits don't have the right labels?

 It might take a while, but restorecon(8) might help? Maybe start with 
 `restorecon -n -v -r /`?

 Wil 


-- 
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/83f8cf17-1ab5-4c86-8472-85c5351d1858%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to setup Puppet agent run interval at a specific time?

2015-03-26 Thread staceytian4321
Hi all,

I am using puppet 3.7.3.

I want my puppet agent to run twice a day, so in puppet.conf, I set 
runinterval:

#  This setting can be a time interval in seconds (30 or 30s), minutes 
(30m), hours (6h), days(2d), or years (5y)
 runinterval = 12h

However, how could I setup the puppet agent run to happen at a specific 
time? 
For example, 2:00am and 2:00pm respectively?

Now it seems random. And whenever the machine is rebooted, it will run 
puppet agent.

Thanks,
Zaiwen

-- 
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/c97554da-5967-41d9-8943-50e5750f8ab5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to setup Puppet agent run interval at a specific time?

2015-03-26 Thread staceytian4321
Thanks a lot for the reply. I will implement a cron job for that.

On Thursday, March 26, 2015 at 10:09:43 AM UTC-4, Garrett Honeycutt wrote:

 On 3/26/15 2:06 PM, staceyt...@gmail.com javascript: wrote: 
  Hi all, 
  
  I am using puppet 3.7.3. 
  
  I want my puppet agent to run twice a day, so in puppet.conf, I set 
  runinterval: 
  
  #  This setting can be a time interval in seconds (30 or 30s), minutes 
  (30m), hours (6h), days(2d), or years (5y) 
   runinterval = 12h 
  
  However, how could I setup the puppet agent run to happen at a specific 
  time? 
  For example, 2:00am and 2:00pm respectively? 
  
  Now it seems random. And whenever the machine is rebooted, it will run 
  puppet agent. 
  
  Thanks, 
  Zaiwen 
  

 Hi Zaiwen, 

 The easiest way to manage when and how your agent runs is through cron. 
 Highly recommend running in that fashion. 

 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/5c94cd31-6798-4dab-9683-704ec06c7930%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Help! Could not autoload puppet/provider/package/rpm

2015-03-23 Thread staceytian4321


Hi all,

I am using Puppet agent 3.7.3 on Red Hat Linux. On one of my machines, when I 
run puppet agent --test, I received error:

Puppet (err): Could not autoload puppet/provider/package/rpm: No such file or 
directory - /tmp/puppet20150323-27791-6xy78b.lock
Puppet (err): Could not autoload puppet/type/package: Could not autoload 
puppet/provider/package/rpm: No such file or directory - 
/tmp/puppet20150323-27791-6xy78b.lock
Puppet (err): Could not retrieve catalog from remote server: Could not intern 
from text/pson: Could not autoload puppet/type/package: Could not autoload 
puppet/provider/package/rpm: No such file or directory - 
/tmp/puppet20150323-27791-6xy78b.lock
Puppet (err): Could not retrieve catalog; skipping run

Any clue why this happens? 

Thanks,
Stacey

-- 
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/b58774f5-14ad-43f3-8460-52d8a6c9add7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to force Puppet to use a specific yum repo?

2015-01-06 Thread staceytian4321
Hi, 

I am using open source Puppet 3.7.3. There are multiple yum repos on the 
puppet agent machines. So when I use Puppet to push a package, can I force 
Puppet to use a specific yum repo?

For example, here is my module for pushing Firefox:

class firefox::checkff inherits firefox {
  if ( ($operatingsystemrelease = 6.5) and ($hardwareisa == 'x86_64') ) {
 
file { /etc/yum.repos.d/firefox.31.2.x86_64.repo:
  ensure = present,
  source = /templates/Linux/yum.repos.d/firefox.31.2.x86_64.repo,
  mode = '0644',
  owner = 'root',
}

package { gtk2:
  ensure = '2.24.23-6.el6',
}

package { firefox:
  ensure = '31.2.0-3.el6_6',
  subscribe = [ Package['gtk2'] ],
}
  }
}

You can see that I make sure my firefox.31.2.x86_64.repo is copied to the 
local machine's /etc/yum.repos.d, but I found out that my puppet agent will 
still try to get the firefox package from my Satellite server instead of 
installing from the local firefox repo.

Is there any way to force Puppet to use a specific yum repo?

Thanks,
Stacey

-- 
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/30f4bbaa-360b-41b3-a660-9373cca31fa3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to preserve original timestamp when copying a file?

2015-01-02 Thread staceytian4321
Hi guys,

I am wondering if there was an option to preserve the original timestamp 
when copying a file? Right now the timestamp is updated every time the file 
is recopied. I don't want that. 

I am using open source Puppet 3.7.3.

Thanks
Stacey

-- 
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/e5129b8a-86f9-4b46-86a6-54e29a83b70a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.