[Puppet Users] Help on puppet ERB template

2015-08-12 Thread b . goldi . cool
Hi Guys
I am new to puppet and ruby. I am working on some erb template for ldap. 

Following is sample code 


<%  if TCPSocket.new("host1", 636) and TCPSocket.new("host2", 636)  %>
host 
port 636
tls_checkpeer yes
<% else -%>
host 
port 389
tls_checkpeer no
<% end %>


Above works if 636 is open but if its not then  it never goes to else but 
raise exception of connection refused and eventually puppet fails.
I tried catching exception in erb template but it didnt work.

Possible to catch exceptions like below ? I want to exit it if  any 
exception is raised. 

 rescue Errno:: ECONNREFUSED => e



Thanks for 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/78410ff1-a123-4d02-bc6c-6afed211dd3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Unable to Serve the files for environments

2015-08-12 Thread yugandhar . devopsengg
Hi Techies,

i am unable to serve the the files for my environments. 

Here, 

i have environments like webmachines, hadoopmachines instead of production 
and development etc.,

By using environment setup, it is working fine for modules and site.pp. But 
the problem is i am getting error when i try to serve the file .

Please let me know how do i serve the files for different environments.

# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for puppetweb.bidstalk.com
Info: Applying configuration version '1439278094'
Error: /Stage[main]/S3cfg/File[/var/local/.s3cfgApplift]: Could not 
evaluate: Could not retrieve information from environment webmachines 
source(s) puppet:///modules/webmachines//s3cfgApplift
Notice: Finished catalog run in 2.67 seconds


I  would be happy, if someone help on this.
-
Thanks,
Yugandhar 

-

-- 
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/173604ac-4bbd-4898-be7c-e0bdfb7d4345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] [Style Guide] No recommendation about quoting or not element of an enumerable set of options

2015-08-12 Thread David Racodon
Hi,

The style guide 
 is stating 
that "Quoting is optional when the string is an enumerable set of options 
(such as present/absent)". But it doesn't make any recommendations. Should 
those strings be unquoted so that it's easier to spot that it is an element 
of a set of options for instance? Should those strings be quoted instead? 
For instance, for better compatibility to future versions of the language. 
Any pros and cons are more than welcome so that I can enforce one way or 
the other by providing some arguments to the development teams.

Thank you very much

Regards,

David RACODON
Freelance QA Consultant
LinkedIn  | Twitter 


-- 
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/29e0a79e-5b05-461d-a72e-a8d6f3eb7101%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] [Style Guide] No recommendation about quoting or not element of an enumerable set of options

2015-08-12 Thread Johan De Wit
Hi, 
For me, it has become a habit to NOT use qoutes with enumarable sets of
options.  puppet-lint does not complain if unquoted or single quoted.
All examples I see in the official docs dont use quotes.  Just checked
the forge also.  No quotes.
Hth
Johan
On Wed, 2015-08-12 at 10:06 -0700, David Racodon wrote:
> Hi,
> 
> The style guide is stating that "Quoting is optional when the string
> is an enumerable set of options (such as present/absent)". But it
> doesn't make any recommendations. Should those strings be unquoted so
> that it's easier to spot that it is an element of a set of options
> for instance? Should those strings be quoted instead? For instance,
> for better compatibility to future versions of the language. Any pros
> and cons are more than welcome so that I can enforce one way or the
> other by providing some arguments to the development teams.
> 
> Thank you very much
> 
> Regards,
> 
> David RACODON
> Freelance QA Consultant
> LinkedIn | Twitter
> -- 
> 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/29e0a79e-5b05-461d-a72e
> -a8d6f3eb7101%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
-- 
Johan De Wit

Open Source Consultant  -- Open-Future

Red Hat Certified Engineer  (805008667232363)
Puppet Certified Professional 2013/2014/2015 (PCP006)
Puppet Certified Instructor
blog : http://johan.koewacht.net/   gsm: +32 474 42 40 73
_
  
Next Trainings:
Puppet Fundamentals | 
https://www.open-future.be/content/puppet-fundamentals-training-0
Puppet Architect | 
https://www.open-future.be/content/puppet-architect-training-0
Zabbix Certified Specialist | 
https://www.open-future.be/content/zabbix-certified-specialist-training-0
Zabbix Certified Professional | 
https://www.open-future.be/content/zabbix-certified-professional-training-0
Linux Training | https://www.open-future.be/content/linux-training-0
Subscribe to our newsletter | http://eepurl.com/BUG8H

-- 
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/1439406654.3440.9.camel%40open-future.be.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2015-08-12 Thread robert keating
Can you help with this query?  I am trying to get 2 facts from all of our 
puppet clients in PuppetDB.  
I tried variations of the following, but no luck: ('["or", ["=", "name", 
"kernelversion"], ["=", "name", "instance_uuid"]]')

Thank you!

On Tuesday, September 3, 2013 at 11:09:19 AM UTC-7, Ken Barber wrote:
>
> Is it acceptable to do the search based on 'certname'? ie: 
>
> curl -G 'http://localhost:8080/v2/facts' --data-urlencode 
> 'query=["and",["~","certname","puppetdb?"],["or",["=","name","ipaddress"],["=","name","hostname"]]]'
>  
>
>
> ken. 
>
> On Mon, Sep 2, 2013 at 7:00 AM, Klavs Klavsen  > wrote: 
> > This gives me the ipaddress (and hostname).. now to figure out how to 
> filter 
> > on hostname regex.. 
> > 
> > 'query=["=", "name", "ipaddress"]' 
> > 
> > -- 
> > 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 post to this group, send email to puppet...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/puppet-users. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
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/0a5346a6-2668-42bd-ab1b-334089b17133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppetdb - getting a list of specific facts for specific hosts?

2015-08-12 Thread Ken Barber
> Can you help with this query?  I am trying to get 2 facts from all of our
> puppet clients in PuppetDB.
> I tried variations of the following, but no luck: ('["or", ["=", "name",
> "kernelversion"], ["=", "name", "instance_uuid"]]')

For me this query works. Here is the full curl example in the latest
PDB (I replaced instance_uuid with operatingsystem, since I don't have
that fact and I wanted to show it working with _something_):

# curl -G 'http://localhost:8080/pdb/query/v4/facts' --data-urlencode
'query=["or",["=","name","kernelversion"],["=","name","operatingsystem"]]'
[ {
  "certname" : "kb.local",
  "environment" : "production",
  "name" : "operatingsystem",
  "value" : "Darwin"
}, {
  "certname" : "kb.local",
  "environment" : "production",
  "name" : "kernelversion",
  "value" : "14.4.0"
} ]%

ken.

-- 
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/CAE4bNTm3wBtqEvcWnMjy63U7P3T5E4kOcv6%2BHQ8vMPLL41dQqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to add user in centos 6.6 from puppetserver to puppetAgent

2015-08-12 Thread Huynh Tran
Thank you! I have the code in ../manifestss/site.pp: 
user {'testuser':
ensure => 'present',
comment => 'testuser',
# gid => '500',
# home => '/home/testuser',
managehome => true, 
# password => 
'$6$L41Vuii1$MVPd0RAeVTopbm4sgFp1dwTvP3cyY//.8jQs3xvdUKtNbCthRcVCvxSHwhG0w.blW8V2KPaY7HhFkGApVcm1o0',
# password => '123456',
password_max_age => '9',
password_min_age => '0',
# shell=> '/bin/bash',
# uid  => '500',
}
 exec {'changepass':
   command => 'echo -e \"12345\n12345\" | sudo passwd testuser',
   command => 'echo -e "testuser ALL NOPASSWD: ALL" >> etc/sudoers',
   refreshonly => true,
   path => '/sbin:/bin:/usr/sbin:/usr/bin',
}

I want it change password for new user, after insert 'echo -e "testuser ALL 
NOPASSWD: ALL"', in file "/etc/sudoers". but, it's non-active for new user.
Help me please! Thank you very much!...

-- 
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/9a1059f6-ed37-4488-99b8-1be9ec647fd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.