[Puppet Users] Re: Install Puppet as Docker CLI image

2015-10-19 Thread Vikas Kumar
Hi Jackson,

Try to run it with '--debug' switch, may be it shows something useful.

Regards,
Vikas

On Tuesday, 20 October 2015 10:37:05 UTC+11, Justin Jackson wrote:
>
> Hi all, 
>
> I am trying to set up the standalone puppet as a docker image to be used 
> as a CLI. I am doing this so that my colleagues and I can share the same 
> "environment" for running puppet on our different platforms of choice. We 
> are using Mac, Linux (Ubuntu 14+) and Windows (8 and 10). We basically run 
> puppet apply .pp. My Dockerfile is pretty simple up till now:
>
> RUN \
>   sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
>   apt-get update && \
>   apt-get -y upgrade && \
>   apt-get install -y build-essential && \
>   apt-get install -y software-properties-common && \
>   apt-get install -y byobu curl git unzip wget && \
>   rm -rf /var/lib/apt/lists/*
>
> RUN apt-get -y install rubygems
> RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
> RUN gem install puppet librarian-puppet 
>
>
>  However, when we try to run puppet against our .pp files, we are seeing some 
> issues such as something to do with plist.. and we can't yet get our created 
> docker image to "apply" a simple test.pp. 
>
>
> Are there other libraries we would need to install perhaps? I would have 
> thought the librarian-puppet does the trick.. or maybe there is some 
> configuration we need to adjust?
>
>
> Thanks for any 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/03248177-6322-4da1-8c7e-0c100d2cd6ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Exclude an element from array

2015-10-12 Thread Vikas Kumar
Hi Dan,

Thanks for hint. I am already using hiera, yes the code looks much cleaner 
when using it.

Regards,
Vikas

On Monday, 12 October 2015 23:32:46 UTC+11, LinuxDan wrote:
>
> The puppet manifest would simplify to :
> class foo (
> $services_to_stop = [],
> ) {
>
> include 'stdlib'
>
> if size($services_to_stop) > 0 {
> service { $services_to_stop :
> ensure => stopped,
> enable => false,
> }
> }
> }
>
> You need to set up hiera (http://docs.puppetlabs.com/hiera/1/) to let you 
> choose settings using the "operatingsystem", "osfamily", and/or 
> "operatingsystemmajrelease" facts.
>
> Personally, I am a bit confused as to what services you want stopped under 
> what conditions, so I cannot offer more detail.
>
> The hiera data for your default case would be :
>
> ---
> foo::services_to_stop :
>   - ip6tables
>   - iptables
>   - auditd
>   - cups
>
>
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.”  (Bill Waterson: 
> Calvin & Hobbes)
>
>
> On Oct 10, 2015, at 10:46 PM, Vikas Kumar > 
> wrote:
>
> Hello Dan,
>
> Would it be possible for you to point me to an example (may be a link) ? 
> Thanks in advance.
>
> Regards,
> Vikas
>
> On Sunday, 11 October 2015 13:43:22 UTC+11, LinuxDan wrote:
>>
>> Has anyone considered taking the array of services out of the code and 
>> putting it into Hiera ? 
>> Much easier to vary the array from there. 
>>
>

-- 
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/9de84948-546f-4bfe-89d3-d84ee75e4b0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Use custom facts in erb templates

2015-10-11 Thread Vikas Kumar
Russel, 

I can see the hash on puppet master but not on agent. Can this be the 
reason ? Importantly, when I try to create a file for custom facts on 
agent, it gets deleted in the subsequent puppet run. 

SERVER
# facter --puppet box32.interfaces_ipv4.eth0.bootproto
static
#

AGENT
# facter --puppet box32.interfaces_ipv4.eth0.bootproto

#


-Vikas

On Monday, 12 October 2015 13:12:16 UTC+11, Russell Miller wrote:
>
>
> On Sunday, October 11, 2015 at 7:06:11 PM UTC-7, Vikas Kumar wrote:
>>
>> Hi Russel,
>>
>> I tried to use reference the variable as below, but got an error.
>>
>  
> Vikas, that means either it's not a hash or a requested hash element 
> doesn't exist.  I don't have a puppet instance in front of me so I'm not 
> 100% sure of this, but iirc, hostname is a default fact that is a standard 
> scalar variable.  I'd check to see exactly what it's returning.  If it's a 
> fact you built yourself, then you might be dealing with a namespace 
> conflict.
>
> The important thing to note here:  All ruby variables imported from puppet 
> are preceded by "@" (I know of no exceptions though there may be) and the 
> puppet scoping is also important.  I'm very confident that once you know 
> what your variable looks like, you'll be able to access it through a ruby 
> template.
>
> --Russell
>  
>

-- 
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/f69988ed-3088-4530-978e-99c12eb6591a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Use custom facts in erb templates

2015-10-11 Thread Vikas Kumar
Hi Russel,

I tried to use reference the variable as below, but got an error.
<%= @hostname["interfaces_ipv4"]["eth0"]["bootproto"] %>


Error
Oct 12 13:04:06 box32 puppet-agent[37813]: Could not retrieve catalog from 
remote server: Error 400 on SERVER: Evaluation Error: Error while 
evaluating a Function Call, Failed to parse template network/ifcfg-ethX.erb:
Oct 12 13:04:06 box32 puppet-agent[37813]: Filepath: /etc/puppetlabs/code/
environments/production/modules/network/templates/ifcfg-ethX.erb
Oct 12 13:04:06 box32 puppet-agent[37813]: Line: 4
Oct 12 13:04:06 box32 puppet-agent[37813]: Detail: undefined method `[]' 
for nil:NilClass

Regards,
Vikas



On Monday, 12 October 2015 12:23:24 UTC+11, Russell Miller wrote:
>
> Don't forget the "@".  Ruby scoping rules still apply.
>
> <%= @hostname["interfaces_ipv4"]["eth0"]["bootproto"] %> should work, 
> though I haven't tested it, obviously.
>
> Also don't forget that puppet scoping rules ALSO apply, so the variable 
> has to be accessible from the class from which the templating is done.  You 
> could do (I think) lookup_scopevar or some such to get around that.
>
> --Russell
>
> On Sunday, October 11, 2015 at 5:54:35 PM UTC-7, Vikas Kumar wrote:
>>
>> Hi Red,
>>
>> I did tried that, but it is not working for me.
>>
>> <%= hostname[interfaces_ipv4][eth0][bootproto] %>
>>
>> or even
>> <%= os[release][major] %>
>> Regards,
>> Vikas
>>
>>
>> On Monday, 12 October 2015 11:19:15 UTC+11, red wrote:
>>>
>>> I asked almost the same question on ask puppet
>>>
>>>
>>> https://ask.puppetlabs.com/question/1295/getting-hiera-data-into-my-erb-template/
>>>
>>>

-- 
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/eb2893f6-afb4-4652-a449-4239ad4a29b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Use custom facts in erb templates

2015-10-11 Thread Vikas Kumar
Hi Red,

I did tried that, but it is not working for me.

<%= hostname[interfaces_ipv4][eth0][bootproto] %>

or even
<%= os[release][major] %>
Regards,
Vikas


On Monday, 12 October 2015 11:19:15 UTC+11, red wrote:
>
> I asked almost the same question on ask puppet
>
>
> https://ask.puppetlabs.com/question/1295/getting-hiera-data-into-my-erb-template/
>
>

-- 
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/1240c73e-755d-4fd2-9ea7-eb596409f046%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Use custom facts in erb templates

2015-10-11 Thread Vikas Kumar
Hello Everyone,

I have a YAML file which I am using to generate facts for one of my puppet 
agents.

# facter -p box32.interfaces_ipv4.eth0.bootproto
static
#



This works fine, but I am not sure how to make this work in erb templates. 
I've tried few options in vain.

Forgive my ignorance on this. Thanks.

Regards,
Vikas

-- 
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/1a0698c9-b269-4381-aeae-ee4cd7c524e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Exclude an element from array

2015-10-10 Thread Vikas Kumar
Hello Dan,

Would it be possible for you to point me to an example (may be a link) ? 
Thanks in advance.

Regards,
Vikas

On Sunday, 11 October 2015 13:43:22 UTC+11, LinuxDan wrote:
>
> Has anyone considered taking the array of services out of the code and 
> putting it into Hiera ? 
> Much easier to vary the array from there. 
>
> > On Oct 10, 2015, at 9:56 PM, Henrik Lindberg  > wrote: 
> > 
> >> On 2015-10-10 4:47, Vikas Kumar wrote: 
> >> Hello Everyone, 
> >> 
> >> I have a very basic code to stop and disable few services which I am 
> >> running for CentOS/RHEL 6/7 servers. 
> >> 
> >> 
> >> | 
> >> $stop_services =["ip6tables","iptables","auditd","cups"] 
> >> 
> >> service {$stop_services 
> >> ensure=>stopped 
> >>enable =>false 
> >> } 
> >> | 
> >> 
> >> 
> >> Is it possible to not run this code when the OS is CentOS/RHEL 7 and 
> the 
> >> stop_services value is auditd. 
> > 
> > Here are a couple of ways to do this (all untested): 
> > 
> > If you are on 3.x and using the future parser, or using 4.x you can add 
> and remove from arrays directly in the language with '+' and '-'. If on 
> earlier versions you need to use the 'delete' function from stdlib. 
> > 
> >  # for 3.x (no future parser) 
> >  # 
> >  $stop_services = ["ip6tables","iptables","auditd","cups"] 
> >  if $::osfamily == 'RedHat { 
> >$excluded_services = ['auditd'] 
> >  } 
> >  else { 
> >$excluded_services = [] 
> >  } 
> >  $services_to_stop = delete($stop_services, $excluded_services) 
> > 
> >  service {  $services_to_stop: 
> >ensure=>stopped, 
> >enable =>false, 
> >  } 
> > 
> > With the 4.x (3.x future) parser you can also use a case expression to 
> produce a value (which may be more convenient if you will have more than a 
> single special case. 
> > 
> >  $stop_services = ["ip6tables","iptables","auditd","cups"] 
> >  $excluded_services = case $::osfamily { 
> >'RedHat': { 'auditd' } 
> > default: {  } 
> >  } 
> >  service { $stop_services - $excluded_services : 
> >ensure=>stopped, 
> >enable =>false, 
> >  } 
> > 
> > Or you can iterate: 
> > 
> > # using conditional logic 
> > # 
> > ["ip6tables","iptables","auditd","cups"].each |$service| { 
> >  unless $::osfamily == 'RedHat' and $service == 'auditd' { 
> >service { $service : 
> >  ensure => stopped, 
> >  enable => false, 
> >} 
> >  } 
> > } 
> > 
> > 
> > # using 'filter' 
> > # 
> > ["ip6tables", "iptables", "auditd", "cups"].filter |$service| { 
> >  $::osfamily != 'RedHat' and $service != 'auditd' 
> > }.each |$service| { 
> >  service { $service : 
> >ensure => stopped, 
> >enable => false, 
> >  } 
> > } 
> > 
> > Regards 
> > - henrik 
> > 
> > -- 
> > 
> > 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...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/mvcfki%248no%241%40ger.gmane.org.
>  
>
> > 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/9e21fc26-244f-4fd9-bde7-fc569fe9bd60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Exclude an element from array

2015-10-10 Thread Vikas Kumar
Hello Henrik,

Thanks for your time on this.This is my final code on puppet v4, hope it 
helps someone.

case $::operatingsystem {
  'RedHat', 'CentOS' : {
$stop_services = [ "ip6tables", "iptables", "auditd", "cups" ]


$exclude_services = $::osfamily ? {
  'RedHat' => [ 'auditd' ]
}


if ($::operatingsystemmajrelease == '6') {
  service { $stop_services:
ensure => stopped,
enable => false,
  }
}
if ($::operatingsystemmajrelease == '7') {
  service { $stop_services - $exclude_services:
ensure => stopped,
enable => false,
  }
}
  }
} 

Regards,
Vikas


On Sunday, 11 October 2015 12:57:14 UTC+11, Henrik Lindberg wrote:
>
> On 2015-10-10 4:47, Vikas Kumar wrote: 
> > Hello Everyone, 
> > 
> > I have a very basic code to stop and disable few services which I am 
> > running for CentOS/RHEL 6/7 servers. 
> > 
> > 
> > | 
> > $stop_services =["ip6tables","iptables","auditd","cups"] 
> > 
> > service {$stop_services 
> > ensure=>stopped 
> > enable =>false 
> > } 
> > | 
> > 
> > 
> > Is it possible to not run this code when the OS is CentOS/RHEL 7 and the 
> > stop_services value is auditd. 
> > 
> > 
>
> Here are a couple of ways to do this (all untested): 
>
> If you are on 3.x and using the future parser, or using 4.x you can add 
> and remove from arrays directly in the language with '+' and '-'. If on 
> earlier versions you need to use the 'delete' function from stdlib. 
>
># for 3.x (no future parser) 
># 
>$stop_services = ["ip6tables","iptables","auditd","cups"] 
>if $::osfamily == 'RedHat { 
>  $excluded_services = ['auditd'] 
>} 
>else { 
>  $excluded_services = [] 
>} 
>$services_to_stop = delete($stop_services, $excluded_services) 
>
>service {  $services_to_stop: 
>  ensure=>stopped, 
>  enable =>false, 
>} 
>
> With the 4.x (3.x future) parser you can also use a case expression to 
> produce a value (which may be more convenient if you will have more than 
> a single special case. 
>
>$stop_services = ["ip6tables","iptables","auditd","cups"] 
>$excluded_services = case $::osfamily { 
>  'RedHat': { 'auditd' } 
>   default: {  } 
>} 
>service { $stop_services - $excluded_services : 
>  ensure=>stopped, 
>  enable =>false, 
>} 
>
> Or you can iterate: 
>
> # using conditional logic 
> # 
> ["ip6tables","iptables","auditd","cups"].each |$service| { 
>unless $::osfamily == 'RedHat' and $service == 'auditd' { 
>  service { $service : 
>ensure => stopped, 
>enable => false, 
>  } 
>} 
> } 
>
>
> # using 'filter' 
> # 
> ["ip6tables", "iptables", "auditd", "cups"].filter |$service| { 
>$::osfamily != 'RedHat' and $service != 'auditd' 
> }.each |$service| { 
>service { $service : 
>  ensure => stopped, 
>  enable => false, 
>} 
> } 
>
> Regards 
> - henrik 
>
> -- 
>
> 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/86085c59-c5c2-40d2-908b-6f80312a7196%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Exclude an element from array

2015-10-10 Thread Vikas Kumar
Hello Everyone,

I have a very basic code to stop and disable few services which I am 
running for CentOS/RHEL 6/7 servers.


$stop_services = [ "ip6tables", "iptables", "auditd", "cups" ]

service { $stop_services
   ensure => stopped
   enable => false
}


Is it possible to not run this code when the OS is CentOS/RHEL 7 and the 
stop_services 
value is auditd.


Regards,

Vikas

-- 
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/8f5a3e93-6a4e-4875-a4dc-cda501d4e5ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How can we add multiple lines to a file ?

2015-01-28 Thread Vikas Kumar
Hi Laxmi,

I could not find a way out to add multiple lines. I did this, which served 
my purpose. May be it is not suitable for your requirement.

 file { "/etc/mytweaks":
  owner   => 'root',
  group   => 'root',
  mode=> '0755',
  source => "puppet:///modules/tweaks-history_shellprompt/mytweaks",
 }

 file_line { 'Adding-To-Bashrc':
  ensure => present,
  line => 'source /etc/mytweaks',
  path => "$bashrc_location",
 }

Regards,
Vikas

On Tuesday, 27 January 2015 17:40:49 UTC+11, Lakshmi Thampi wrote:
>
> Could you please tell me which of the solutions worked in this case
> As i am also trying to do the same
> I am trying to do it with concat like this for /etc/profile file editing
>
> class postgresql::profilechange{
>
> include concat::setup
>
> concat { '/etc/profile':
>
>   mode  => '0775',
>
>   owner => 'root',
>
>   group => 'root',
>
>   ensure => present,
>
>
> }
>
>
> concat::fragment { 'file04_fa':
>
>   target  => '/etc/profile',
>
>   content => "PATH=$PATH:/usr/local/pgsql/bin\n",
>
>   order => 01
>
> }
>
>
> }
> But it is giving me this error
> ---
>
> Info: Retrieving plugin
>
> Info: Loading facts in 
> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
>
> Info: Loading facts in 
> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
>
> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
>
> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
>
> Info: Loading facts in 
> /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could not find class concat::setup for sys-server on node sys-server
>
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> Any pointers are appreciated
>
>
>
>>

-- 
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/0012a833-5caf-485c-8304-0175d4099a9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Install puppetDB on already deployed environment

2014-08-18 Thread Vikas Kumar
Thanks Flamarion for the reply, my issue is resolved now.

Regards,
Vikas

On Tuesday, 19 August 2014 07:35:05 UTC+10, Flamarion Jorge wrote:
>
> Did you setup route.yml ?
>
> Flamarion Jorge
> Sent from my mobile
> Em 18/08/2014 02:05, "Vikas Kumar" > 
> escreveu:
>
>> Hello everyone,
>>
>> I have a puppetmaster v3.6.2-1 installed on Ubuntu 14.04 x86_64 server. I 
>> am using passenger (apache2) instead of Webrick.
>>
>> root@puppet:~# /etc/init.d/puppetmaster status
>>  * master is not running
>> root@puppet:~#
>> root@puppet:~# /etc/init.d/apache2 status
>>  * apache2 is running
>> root@puppet:~#
>>
>>
>> I am trying to install puppetdb via a module 
>> <https://docs.puppetlabs.com/puppetdb/2.1/install_via_module.html>, but 
>> after installing the module I ran 'puppet agent -t' command and encountered 
>> below errors. 
>>
>> root@puppet:~# puppet agent -t
>> Info: Retrieving pluginfacts
>> Info: Retrieving plugin
>> ...
>> ...
>> Info: Caching catalog for puppet.test.com
>> Info: Applying configuration version '1408337383'
>> Notice: Unable to connect to puppetdb server (puppet.test.com:8081): 
>> Connection refused - connect(2)
>> Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
>> Notice: Unable to connect to puppetdb server (puppet.test.com:8081): 
>> Connection refused - connect(2)
>> Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
>> Notice: Unable to connect to puppetdb server (puppet.test.com:8081): 
>> Connection refused - connect(2)
>> Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
>> ^CNotice: Caught INT; calling stop
>> root@puppet:~#
>>
>> I checked that port 8081 is not being used by any daemon.
>>
>> root@puppet:~# netstat -an | grep 8081
>> root@puppet:~# telnet 192.168.1.99 8081
>> Trying 192.168.1.99...
>> telnet: Unable to connect to remote host: Connection refused
>> root@puppet:~#
>>
>> Please help me out to troubleshoot this.
>>
>> Regards,
>> Vikas
>>
>>  -- 
>> 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/0fb35b85-6b24-47d5-a8a3-c632c0869956%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/0fb35b85-6b24-47d5-a8a3-c632c0869956%40googlegroups.com?utm_medium=email&utm_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/9339c2c6-adaa-4f9c-8d4c-e93f0f8ec2e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Install puppetDB on already deployed environment

2014-08-18 Thread Vikas Kumar
I just installed the puppetdbquery module from forge, and ran the below 
commands. I think I am good :)

root@puppet:~# puppet query nodes '(architecture=amd64)'
box30.test.com
puppet.test.com
root@puppet:~#

root@puppet:~# curl -s 'http://puppet.test.com:8080/v3/nodes' | jq -r 
'.[].name'
box30.test.com
puppet.test.com
root@puppet:~#

Regards,
Vikas

On Monday, 18 August 2014 21:41:05 UTC+10, Vikas Kumar wrote:
>
> Hi Juan,
>
> Thanks a ton, it did the magic. I was under an impression that puppetdb 
> forge module will install puppetdb too.
>
> Now, *puppet agent --test* command is working fine. But, I need to ensure 
> that is working as desired. I am new to puppetdb, will google out something 
> or write a small class to confirm it is working fine. 
>
> Regards,
> Vikas
>
> On Monday, 18 August 2014 20:40:22 UTC+10, Juan Sierra Pons wrote:
>>
>> Hi, 
>>
>> I am using puppetlabs-puppetdb module too. 
>> Can you install puppetdb manually using your os package tool (apt/yum)? 
>>
>> Regards 
>>
>> --
>>  
>>
>> Juan Sierra Pons ju...@elsotanillo.net 
>> Linux User Registered: #257202 
>> Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo 
>> GPG key = 0xA110F4FE 
>> Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE 
>> --
>>  
>>
>>
>

-- 
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/612214c0-9b34-4131-9993-617e8df9e8c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Install puppetDB on already deployed environment

2014-08-18 Thread Vikas Kumar
Hi Juan,

Thanks a ton, it did the magic. I was under an impression that puppetdb 
forge module will install puppetdb too.

Now, *puppet agent --test* command is working fine. But, I need to ensure 
that is working as desired. I am new to puppetdb, will google out something 
or write a small class to confirm it is working fine. 

Regards,
Vikas

On Monday, 18 August 2014 20:40:22 UTC+10, Juan Sierra Pons wrote:
>
> Hi, 
>
> I am using puppetlabs-puppetdb module too. 
> Can you install puppetdb manually using your os package tool (apt/yum)? 
>
> Regards 
>
> --
>  
>
> Juan Sierra Pons ju...@elsotanillo.net 
>  
> Linux User Registered: #257202 
> Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo 
> GPG key = 0xA110F4FE 
> Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE 
> --
>  
>
>

-- 
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/277b9eb6-3b58-4ac3-99d4-06b5097377c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Install puppetDB on already deployed environment

2014-08-18 Thread Vikas Kumar
Hi Juan,

Thanks for your help but I don't have these files. May be because I am 
using modules instead of binaries.

Regards,
Vikas

On Monday, 18 August 2014 19:42:25 UTC+10, Juan Sierra Pons wrote:
>
> Hi 
>
> Try removing (make a backup first just in case) 
> /etc/puppet/routes.yaml and /etc/puppet/puppetdb.conf and try again. 
>
> I had a similar problem time ago and starting from scratch fixed it 
>
> Best Regards 
> --
>  
>
> Juan Sierra Pons ju...@elsotanillo.net 
>  
> Linux User Registered: #257202 
> Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo 
> GPG key = 0xA110F4FE 
> Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE 
> --
>  
>
>

-- 
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/d397e2f6-3cd9-4768-8a15-8a8be9723a8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Install puppetDB on already deployed environment

2014-08-18 Thread Vikas Kumar
Hi Atom,

I tried that but its not working out. 

Below is the output of the command.
root@puppet:~# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
...
...
Notice: Failed to connect to puppetdb within timeout window of 120 seconds; 
giving up.
Error: Unable to connect to puppetdb server! (puppet.test.com:8081)
Error: /Stage[main]/Puppetdb::Master::Config/Puppetdb_conn_validator[
puppetdb_conn]/ensure: change from absent to present failed: Unable to 
connect to puppetdb server! (puppet.test.com:8081)
Notice: /Stage[main]/Puppetdb::Master::Storeconfigs/Ini_setting[puppet.conf/
master/storeconfigs]: Dependency Puppetdb_conn_validator[puppetdb_conn] has 
failures: true
Warning: /Stage[main]/Puppetdb::Master::Storeconfigs/Ini_setting[puppet.conf
/master/storeconfigs]: Skipping because of failed dependencies
Notice: /Stage[main]/Puppetdb::Master::Storeconfigs/Ini_setting[puppet.conf/
master/storeconfigs_backend]: Dependency Puppetdb_conn_validator[
puppetdb_conn] has failures: true
Warning: /Stage[main]/Puppetdb::Master::Storeconfigs/Ini_setting[puppet.conf
/master/storeconfigs_backend]: Skipping because of failed dependencies
Notice: /Stage[main]/Puppetdb::Master::Routes/File[/etc/puppet/routes.yaml]: 
Dependency Puppetdb_conn_validator[puppetdb_conn] has failures: true
Warning: /Stage[main]/Puppetdb::Master::Routes/File[/etc/puppet/routes.yaml
]: Skipping because of failed dependencies
Notice: /Stage[main]/Puppetdb::Master::Puppetdb_conf/Ini_setting[
puppetdbport]: Dependency Puppetdb_conn_validator[puppetdb_conn] has 
failures: true
Warning: /Stage[main]/Puppetdb::Master::Puppetdb_conf/Ini_setting[
puppetdbport]: Skipping because of failed dependencies
Notice: /Stage[main]/Puppetdb::Master::Puppetdb_conf/Ini_setting[
soft_write_failure]: Dependency Puppetdb_conn_validator[puppetdb_conn] has 
failures: true
Warning: /Stage[main]/Puppetdb::Master::Puppetdb_conf/Ini_setting[
soft_write_failure]: Skipping because of failed dependencies
Notice: /Stage[main]/Puppetdb::Master::Puppetdb_conf/Ini_setting[
puppetdbserver]: Dependency Puppetdb_conn_validator[puppetdb_conn] has 
failures: true
Warning: /Stage[main]/Puppetdb::Master::Puppetdb_conf/Ini_setting[
puppetdbserver]: Skipping because of failed dependencies
Notice: /Stage[main]/Puppetdb::Master::Config/Service[puppetmaster]: 
Dependency Puppetdb_conn_validator[puppetdb_conn] has failures: true
Warning: /Stage[main]/Puppetdb::Master::Config/Service[puppetmaster]: 
Skipping because of failed dependencies
Notice: Finished catalog run in 120.27 seconds
root@puppet:~#


Also, I do not have puppetdb binary since I have used puppetdb module.

root@puppet:~# ls -lrth /etc/init.d/puppet*
-rwxr-xr-x 1 root root 1.7K Jun 10 07:07 /etc/init.d/puppetqd
-rwxr-xr-x 1 root root 3.8K Jun 10 07:07 /etc/init.d/puppetmaster
root@puppet:~#

Any other suggestions to tackle this ?

Regards,
Vikas

On Monday, 18 August 2014 15:09:26 UTC+10, Atom Powers wrote:
>
> Don't cancel it. It will eventually timeout or start working.
> You may want to start puppetdb manually if it times-out; 'service puppetdb 
> start'
>
>

-- 
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/96579854-43be-4c4b-8af6-07aa1076788e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Install puppetDB on already deployed environment

2014-08-17 Thread Vikas Kumar
Hello everyone,

I have a puppetmaster v3.6.2-1 installed on Ubuntu 14.04 x86_64 server. I 
am using passenger (apache2) instead of Webrick.

root@puppet:~# /etc/init.d/puppetmaster status
 * master is not running
root@puppet:~#
root@puppet:~# /etc/init.d/apache2 status
 * apache2 is running
root@puppet:~#


I am trying to install puppetdb via a module 
, but 
after installing the module I ran 'puppet agent -t' command and encountered 
below errors. 

root@puppet:~# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
...
...
Info: Caching catalog for puppet.test.com
Info: Applying configuration version '1408337383'
Notice: Unable to connect to puppetdb server (puppet.test.com:8081): 
Connection refused - connect(2)
Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
Notice: Unable to connect to puppetdb server (puppet.test.com:8081): 
Connection refused - connect(2)
Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
Notice: Unable to connect to puppetdb server (puppet.test.com:8081): 
Connection refused - connect(2)
Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
^CNotice: Caught INT; calling stop
root@puppet:~#

I checked that port 8081 is not being used by any daemon.

root@puppet:~# netstat -an | grep 8081
root@puppet:~# telnet 192.168.1.99 8081
Trying 192.168.1.99...
telnet: Unable to connect to remote host: Connection refused
root@puppet:~#

Please help me out to troubleshoot this.

Regards,
Vikas

-- 
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/0fb35b85-6b24-47d5-a8a3-c632c0869956%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Restart ssh daemon when sshdconfig is modified

2014-08-16 Thread Vikas Kumar
Hi Christopher,

Thanks for the links and suggestion. I am not well versed with ERB as of 
now, just wanted to make things work (and understand them of course), will 
surely work on improving my code soon.

Regards,
Vikas

On Friday, 15 August 2014 23:54:28 UTC+10, Christopher Wood wrote:
>
> Could also go for: 
>
> File["/etc/ssh/sshd_config"] -> Augeas["my-ssh"] 
> File["/etc/ssh/sshd_config"] ~> Service["$ssh_service"] 
> Augeas["my-ssh"] ~> Service["$ssh_service"] 
>
> A bit wordier but it covers what happens when the file is changed but 
> augeas has nothing to change. 
>
> Vikas, perhaps you might use a template instead of augeas? That way you 
> could have the standard package->file->service set of relationships and a 
> single source for the content in your sshd_config. 
>
> https://docs.puppetlabs.com/learning/templates.html 
> https://docs.puppetlabs.com/guides/templating.html 
>
>

-- 
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/9eb7de30-ee35-47dd-ae72-d358235da64c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Restart ssh daemon when sshdconfig is modified

2014-08-16 Thread Vikas Kumar
Many thanks Jeffrey, working like a charm.

On Friday, 15 August 2014 22:52:22 UTC+10, Jeffrey Watts wrote:
>
> On Fri, Aug 15, 2014 at 7:31 AM, Vikas Kumar  > wrote:
>
>> Dear All,
>>
>> I am trying to restart SSH daemon whenever /etc/ssh/sshd_config is 
>> modified. This is my class, it modifies the file but does not restarts the 
>> daemon. I have tried to use both *notify* and *subscribe* in vain.
>>
>
> Change your subscribe line to Augeas["my-ssh"].
>
> Good luck,
> Jeffrey.
>
>

-- 
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/4cd4922f-9b63-4911-a568-3eff4f7b3c36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Restart ssh daemon when sshdconfig is modified

2014-08-15 Thread Vikas Kumar
Dear All,

I am trying to restart SSH daemon whenever /etc/ssh/sshd_config is 
modified. This is my class, it modifies the file but does not restarts the 
daemon. I have tried to use both *notify* and *subscribe* in vain.

class ssh ( $ssh_service = hiera("sshservicename") )  {

  package { "openssh-server": ensure => installed }

  file { "/etc/ssh/sshd_config":
owner   => "root",
group   => "root",
  #  notify  => Service["$ssh_service"],
  }

  augeas { "my-ssh":
context => "/files/etc/ssh/sshd_config",
changes => [
"set PermitRootLogin yes",
"set UsePAM yes",
"set AllowUsers root vikas"
   ],
  }

  service { "$ssh_service":
ensure=> running,
enable=> true,
hasrestart => true,
require   => Package["openssh-server"],
subscribe => File["/etc/ssh/sshd_config"],
  }

File["/etc/ssh/sshd_config"] -> Augeas["my-ssh"] -> Service["$ssh_service"]

}

Please help me out to identify what I am missing here.

Regards,
Vikas

-- 
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/2fb05fae-6896-4c8e-9dde-a6df9e6c4388%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Wild Card in Augeas

2014-08-14 Thread Vikas Kumar
Awesome David, many thanks for the explanation and the code as well, works 
like a charm.

Regards,
Vikas


On Friday, 15 August 2014 06:47:58 UTC+10, David Lutterkort wrote:
>
> Hi Vikas,
>
> On Thu, Aug 14, 2014 at 12:09 AM, Vikas Kumar  > wrote:
>  
>
>> But, this isn't. I tried few combinations of single and double quotes, 
>> but none of them are working :(
>> "setm *[label() =~ glob('ifcfg-eth*')] NM_CONTROLLED \'"no"\'",
>>
>>
> The problem is that the Puppet string is enclosed in double quotes, and so 
> the double quote before 'no' ends that string. If you want to quote the 
> 'no' in the file you'll have to escape the double quotes (and there's no 
> need to escape the single quotes):
>
> "setm *[label() =~ glob('ifcfg-eth*')] NM_CONTROLLED '\"no\"'"
>
> Though in this case, there's no need to quote the 'no'.
>
> David
>
>  

-- 
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/aabe1d6c-02b1-44bd-a72d-d6c42bc9f66b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Wild Card in Augeas

2014-08-14 Thread Vikas Kumar
Hi David,

Many thanks for the information, but still I am having some issues with 
puppet class when I am trying to use double quotes.

This is working good
"setm *[label() =~ glob('ifcfg-eth*')] NM_CONTROLLED no",

But, this isn't. I tried few combinations of single and double quotes, but 
none of them are working :(
"setm *[label() =~ glob('ifcfg-eth*')] NM_CONTROLLED \'"no"\'",

Regards,
Vikas


On Thursday, 14 August 2014 03:05:11 UTC+10, David Lutterkort wrote:
>
> Hi Vikas,
>
> to set multiple nodes, you need to use the 'setm' command; 'set' will only 
> change a single node. Also, the path expressions in Augeas are more like 
> XPath, and therefore don't have globbing built in. In augtool, you'd do 
> what you want with this command:
>
>setm /files/etc/sysconfig/network-scripts/*[label() =~ glob('ifcfg-*')] 
> NM_CONTROLLED no
>
> The corresponding Augeas resource would be something like
>
> augeas { "network-tweaks-RedHat":
> context => "/files/etc/sysconfig/network-scripts",
> changes => ["setm *[label() =~ glob('ifcfg-*')] NM_CONTROLLED no
> "],
> }
>
> David
>
> On Monday, August 11, 2014 10:28:26 PM UTC-7, Vikas Kumar wrote:
>>
>> Dear All,
>>
>> I am trying to use augeas to change the value of NM_CONTROLLED to "no" on 
>> all my RHEL 6.X machines. However, the number of ethernet cards differ on 
>> each server, thus I want to use expression or wild cards.
>>
>>   if $::operatingsystemmajrelease == '6' {
>> augeas { "network-tweaks-RedHat":
>> context => "/files/etc/sysconfig/network-scripts/ifcfg-eth[0-9]",
>> changes => [
>> 'set 
>> /files/etc/sysconfig/network-scripts/ifcfg-eth[0-9]/NM_CONTROLLED \'"no"\''
>> ,
>>],
>> }
>>   }
>>
>> I wrote the above code but it does't do the job. Please suggest.
>>
>> Regards,
>> Vikas
>>
>>
>>

-- 
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/98964bf3-b072-4930-b436-ef8453e948e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Augeas hates me!!!

2014-08-12 Thread Vikas Kumar
Hello,

I think double quotes in your set statement are the culprit.

Try to use set as below

'set /files/whatever/path \'"your text in quotes"\'',



Regards,
Vikas

-- 
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/8698f74d-b5cf-470f-983e-ca170861d468%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Verify whether the directory has files or not

2014-08-12 Thread Vikas Kumar
Hi Satish,

It depends on which resource are you trying to use.

Please elaborate your question.

Regards,
Vikas

On Tuesday, 12 August 2014 20:36:57 UTC+10, Satish Katuru wrote:
>
> Hi,
>
> I want to copy files into agent machine if the directory in Master server 
> has files?
> How to Check whether the directory has files or not?(need to add a 
> condition)
>
>
> Sathish.
>

-- 
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/3dfe180d-25a2-48dd-b7bf-6ceba36fbf39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to install GIT on puppet Server

2014-08-12 Thread Vikas Kumar
Hi Satish,

I was looking the flavor of Linux OS not the kernel.

Run the below command to check OS major and minor version.
facter | egrep 'operatingsystem|lsbdistid|lsbdistdescription'


Also, the output of the command states that you do not git in your 
repository. 

/usr/bin/yum -d 0 -e 0 -y list git


*Note* Red Hat Network repositories are not listed below. You must run this 
command as root to access RHN repositories.
Error: No matching Packages to list

I think *git* rpm is there by default in all RedHat based OS. Still can you 
run below commands and share the output.

yum clean all
yum repolist
yum list all | grep git


Regards,
Vikas

On Tuesday, 12 August 2014 20:52:39 UTC+10, Satish Katuru wrote:
>
> Hi Vikas,
>
> Please find the below information:
>
> Linux version: *Linux 2.6.32-358.6.2.el6.x86_64 x86_64*
>
>
> Below is the output for the command 
>
> /usr/bin/yum -d 0 -e 0 -y list git
>
>
>
> **Note* Red Hat Network repositories are not listed below. You must run 
> this command as root to access RHN repositories.Error: No matching Packages 
> to list*
>
>
> On Tuesday, August 12, 2014 12:42:10 PM UTC+5:30, Vikas Kumar wrote:
>>
>> Hi Satish,
>>
>> Which flavor or version of Linux are you using ?
>>
>> I can try creating the scenario on my test machine and check myself.
>>
>> In the meantime, can you please post output of this command - 
>> /usr/bin/yum -d 0 -e 0 -y list git
>>
>>  
>>
>> A small suggestion - Use code syntax for pasting logs, it makes a post 
>> much readable.
>>
>> Regards,
>> Vikas
>>
>

-- 
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/8f0d8e9c-28ed-4ffe-9e7f-d676a73dc844%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to install GIT on puppet Server

2014-08-12 Thread Vikas Kumar
Hi Satish,

Which flavor or version of Linux are you using ?

I can try creating the scenario on my test machine and check myself.

In the meantime, can you please post output of this command - 
/usr/bin/yum -d 0 -e 0 -y list git

 

A small suggestion - Use code syntax for pasting logs, it makes a post much 
readable.

Regards,
Vikas

-- 
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/a6ebd322-69b4-4035-ae7e-011062c5c4e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How can we add multiple lines to a file ?

2014-08-11 Thread Vikas Kumar
Hello,

I am looking for an option to add multiple lines to a */etc/bashrc* and 
*/etc/profile*. I can do this with *file_line*, but is there any other 
alternative. *file_line* does the job but for each line I will have to 
create a *file_line* resource, which does not sound good for multiple lines.

Regards,
Vikas

-- 
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/e56de655-943c-46d3-95db-3365ea4d34ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Wild Card in Augeas

2014-08-11 Thread Vikas Kumar
Dear All,

I am trying to use augeas to change the value of NM_CONTROLLED to "no" on 
all my RHEL 6.X machines. However, the number of ethernet cards differ on 
each server, thus I want to use expression or wild cards.

  if $::operatingsystemmajrelease == '6' {
augeas { "network-tweaks-RedHat":
context => "/files/etc/sysconfig/network-scripts/ifcfg-eth[0-9]",
changes => [
'set 
/files/etc/sysconfig/network-scripts/ifcfg-eth[0-9]/NM_CONTROLLED \'"no"\'',
   ],
}
  }

I wrote the above code but it does't do the job. Please suggest.

Regards,
Vikas


-- 
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/f7d2a54b-e0fc-4238-8063-9a2d1dcd9521%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to install GIT on puppet Server

2014-08-11 Thread Vikas Kumar
Hi Satish,

I would make a local repo and install it from there, just in case my server 
isn't connected to internet. If it is, you need not worry about it.

Just install the package, and tweak the configuration files for your setup.

Regards,
Vikas 

On Monday, 11 August 2014 19:50:45 UTC+10, Satish Katuru wrote:
>
> Correct me If I am wrong.This means puppet automatically takes the latest 
> version of GIT from the Repository and deploy it on the Master Server.
> What about other softwares like java...etc ?
> What is the procedure for other software installation which puppet wont 
> take from the repository?
>
>>
>>

-- 
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/ee608bfa-58d5-4899-ae07-0c3754f2fb9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: How to use variables in a puppet class

2014-07-25 Thread Vikas Kumar
Super Johan !!

Thanks a ton. You made my day.

Now, these statements are working fine.

baseurl  => 
"http://192.168.1.100/centos/rhel-${::lsbdistrelease}_64.repo";,
and
source => "puppet:///modules/repo/rhel-${::lsbdistrelease}_64.repo",

Regards,
Vikas

On Friday, 25 July 2014 17:56:37 UTC+10, Johan De Wit wrote:
>
>  use double quotes in your source attribute :
>
> source => "puppet:///modules/repo/rhel-${::lsbdistrelease}_64.repo",
>
>
>
> On 25/07/14 09:22, Vikas Kumar wrote:
>  
>
> Hi Jose, 
>
>  I tried this, didn't worked for me :(
>
> '6': {
> file {'/etc/yum.repos.d/RHEL-6.4.repo':
> ensure => present,
> mode   => '0644',
> owner  => 'root',
> group  => 'root',
> source => 
> 'puppet:///modules/repo/rhel-${::lsbdistrelease}_64.repo',
> }
>  
>  Got this message in the log file.
>
>   Fri Jul 25 12:51:12 +0530 2014 /Stage[main]/Repo::Rhel/File[/etc/yum.
> repos.d/RHEL-6.4.repo] (err): Could not evaluate: Could not retrieve 
> information from environment production source(s) puppet:
> ///modules/repo/rhel-${::lsbdistrelease}_64.repo
>  
> This is the file on the server.
>
>   # ls -l /etc/puppet/modules/repo/files/rhel-6.4_64.repo
> -rw-r--r-- 1 root root 205 Jul 24 12:09 /etc/puppet/modules/repo/files/
> rhel-6.4_64.repo
> #
>  
>  Have I made a mistake anywhere ? 
>
>  Thanks in advance.
>
>  
>  Regards,
> Vikas
> On Friday, 25 July 2014 17:03:34 UTC+10, Jose Luis Ledesma wrote: 
>>
>> If you interpolate variable you have to use " instead of '.
>> So it should be
>> source => "puppet:///modules/repo/rhel-${::lsbdistrelease}_64.repo",
>>
>> 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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/f23af645-db50-4f84-bd42-544cd1e4dec4%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/f23af645-db50-4f84-bd42-544cd1e4dec4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> Johan De Wit
>
> Open Source Consultant
>
> Red Hat Certified Engineer  (805008667232363)
> Puppet Certified Professional 2013/2014 (PCP006)
> _
>  
> Open-Future Phone +32 (0)2/255 70 70
> Zavelstraat 72  Fax   +32 (0)2/255 70 71
> 3071 KORTENBERG Mobile+32 (0)474/42 40 73
> BELGIUM http://www.open-future.be
> _
>  
>
>
> Upcoming Events:
>
> Linux Training | 
> https://www.open-future.be/linux-training-8-till-12th-september
>
> Puppet Introduction Course | 
> https://www.open-future.be/puppet-introduction-course-15th-september
>
> Puppet Fundamentals Training | 
> https://www.open-future.be/puppet-fundamentals-training-16-till-18th-september
>
> Zabbix Certified Specialist | 
> https://www.open-future.be/zabbix-certified-specialisttraining-22-till-24th-september
>
> Zabbix Certified Professional | 
> https://www.open-future.be/zabbix-certified-professional-training-25-till-26th-september
>
> 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/2982eeeb-b924-4103-b0ef-ceb74a8d1e8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: How to use variables in a puppet class

2014-07-25 Thread Vikas Kumar

Hi Jose,

I tried this, didn't worked for me :(

  '6': {
file {'/etc/yum.repos.d/RHEL-6.4.repo':
ensure => present,
mode   => '0644',
owner  => 'root',
group  => 'root',
source => 'puppet:///modules/repo/rhel-${::lsbdistrelease}_64.repo',
}

Got this message in the log file.

Fri Jul 25 12:51:12 +0530 2014 /Stage[main]/Repo::Rhel/File[/etc/yum.repos.d
/RHEL-6.4.repo] (err): Could not evaluate: Could not retrieve information 
from environment production source(s) puppet:
///modules/repo/rhel-${::lsbdistrelease}_64.repo

This is the file on the server.

# ls -l /etc/puppet/modules/repo/files/rhel-6.4_64.repo
-rw-r--r-- 1 root root 205 Jul 24 12:09 /etc/puppet/modules/repo/files/rhel-
6.4_64.repo
#

Have I made a mistake anywhere ? 

Thanks in advance.


Regards,
Vikas
On Friday, 25 July 2014 17:03:34 UTC+10, Jose Luis Ledesma wrote:
>
> If you interpolate variable you have to use " instead of '.
> So it should be
> source => "puppet:///modules/repo/rhel-${::lsbdistrelease}_64.repo",
>
> 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/f23af645-db50-4f84-bd42-544cd1e4dec4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to use variables in a puppet class

2014-07-24 Thread Vikas Kumar
Hi CD,

Just tried these too, but somehow puppet is not honoring any variables in 
the resources. 

baseurl => http://192.168.1.100/centos/$releasever/os/$basearch,
and
baseurl => "http://192.168.1.100/centos/$releasever/os/$basearch";,

Somehow, notify is working fine.

notify {'FYI': message => "Setting up Repo for a $operatingsystem 
$lsbdistrelease system", }


Regards,
Vikas


On Friday, 25 July 2014 09:37:17 UTC+10, CD wrote:
>
> Hi Vikas,
>
> This is not the solution to your question but possibly alternative option.
>
> It seems you want to generate a yum repo url for specific OS version so 
> that it picks-up correct version arch etc.
>
> How about if you use following and set up repos to match. 
> baseurl=http:///centos/$releasever/os/$basearch/
>
> Regards,
> CD
>
>

-- 
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/c6a8075c-7596-4d16-bae5-21fa0d99a520%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to use variables in a puppet class

2014-07-24 Thread Vikas Kumar
Hi Sean/Juan,

Yes, the redhat-lsb package is installed on my RedHat 6.4 machine which is 
my Puppet Client server. Puppet server is Ubuntu 14.04.

root@box27:~# rpm -qa | grep redhat-lsb
redhat-lsb-graphics-4.0-7.el6.x86_64
redhat-lsb-compat-4.0-7.el6.x86_64
redhat-lsb-core-4.0-7.el6.x86_64
redhat-lsb-4.0-7.el6.x86_64
redhat-lsb-printing-4.0-7.el6.x86_64
root@box27:~#


Also, facter is also displaying desired values.

root@box27:~# facter | egrep 'lsbdistrelease|operatingsystemrelease'
lsbdistrelease => 6.4

operatingsystemrelease => 6.4
root@box27:~#

And, I am using puppet v3.6.2-1 (installed through RPMs).

Not sure what I am missing. I have also tried to use file resource with 
various combinations to make the variables work as below in vain.

file {'/etc/yum.repos.d/RHEL-6.4.repo':
ensure => present,
mode   => '0644',
owner  => 'root',
group  => 'root',
source => 'puppet:///modules/repo/rhel-${lsbdistrelease}_64.repo',
or
source => 'puppet:///modules/repo/rhel-$lsbdistrelease_64.repo',
or
source 
=> 'puppet:///modules/repo/rhel-'$lsbdistrelease'_64.repo',
or
source 
=> 'puppet:///modules/repo/rhel-"$lsbdistrelease"_64.repo',
}

Any other ideas. 

Regards,
Vikas

-- 
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/3f42cef1-c4ff-400d-aaee-c530028c82c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to use variables in a puppet class

2014-07-24 Thread Vikas Kumar
Hello All,

I have a kickstart server which I use to deploy many minor versions of 
CentOS/RHEL 5 and 6 for both 32 and 64 Bit OS.

I have lots of yum repository files. For. e.g. - RHEL_5.5_64.repo, 
RHEL_5.6_64.repo, RHEL_6.2_32, RHEL_6.5_64, etc. I am looking to use Puppet 
to automatically deploy the required kickstart repos. I tried to follow this 
 
link in vain.

The problem is that I am unable to use facter variables *$lsbdistrelease* 
with something like below.

baseurl=> "http://our-reposrv:8080/dev/RHEL_$lsbdistrelease_64";

Here, the variable does not converts to is value.

Please help me to get this sorted. Am I missing anything ?

Regards,
Vikas

-- 
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/59aa2148-3133-48fc-9731-412d8687c4f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.