Re: [Puppet Users] Regex for case statements

2017-05-06 Thread Ramin K

On 5/6/2017 6:10 PM, tejat...@gmail.com wrote:

Hello,

I'm stuck at this point while adding a case statement regex for
hostname's macthing...
Here is my sample code I'm working on...

class clearlogs::components::idm {

 case $::hostname {
   'idm-wc-(\d+)p': {


https://docs.puppet.com/puppet/3.8/lang_conditional.html#syntax-2

needs to be between slashes, /idm-wc-(\d+)p/: {}

If you have regex problems, I find http://rubular.com/ fairly useful for 
testing.


Ramin

--
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/81c500c3-26e2-adde-e7e5-45cbb63bd6f3%40badapple.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Automation of OS install

2017-05-06 Thread Rob Nelson
You want to look at puppet razor for bare metal provisioning.

On Sat, May 6, 2017 at 9:31 PM  wrote:

> Hi,
>
> I need to automate installation of 50 bare metal servers, the OS of choice
> is a non official linux distor. that is only available as an .iso image,
> these servers are cisco ucs c m240 series.
>
> Is there a way to do that ?
>
> What we are doing today is using the server management plane (CIMC) to
> launch a console session that is booting from the .iso image and we walk
> through the install steps and give a new password at the end, everything
> else is done later.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/18ffbbb8-3549-4263-9bed-5c90a5877931%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/CAC76iT87FK3SWksPtsEgk5sxFKYCeWvw-LRYxuoEoXWCx69Q0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Regex for case statements

2017-05-06 Thread tejat148
Hello,

I'm stuck at this point while adding a case statement regex for hostname's 
macthing...
Here is my sample code I'm working on...

class clearlogs::components::idm {

case $::hostname {
*'idm-wc-(\d+)p'*: {

file { "/etc/cron.d/idm.sh":
ensure=> present,
mode  => '0755',
owner => 'root',
group => 'root',
content   => 
template('clearlogs/idm.erb'),
}

cron { 'clearinglogs':
command   => 'sh 
/etc/cron.d/idm.sh',
user  => 'root',
weekday   => [Monday, Wednesday, 
Saturday],
hour  => '01',
minute=> '00',
require   => 
File['/etc/cron.d/idm.sh'],
}
}
}

}

This code simply does copying of script and running cron job for my 
hostnames say idm-wc-1p, idm-wc-2p, idm-wc-3p, idm-wc-4p, idm-wc-5p.

So please correct me where i'm doing wrong. It's not working for meAnd 
I'm using puppet open source(3.7.8) without future parser.

Thanks for the help!

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


[Puppet Users] Automation of OS install

2017-05-06 Thread haksson81
Hi,

I need to automate installation of 50 bare metal servers, the OS of choice 
is a non official linux distor. that is only available as an .iso image, 
these servers are cisco ucs c m240 series.

Is there a way to do that ? 

What we are doing today is using the server management plane (CIMC) to 
launch a console session that is booting from the .iso image and we walk 
through the install steps and give a new password at the end, everything 
else is done later.

Thanks

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


[Puppet Users] delete line in file with substring xyz

2017-05-06 Thread Khalid J Hosein
This worked for me:

file_line { 'remove ':
ensure => absent,
path => '/path/to/file.conf',
match   => 'some (regexp) part of a given line',
match_for_absence  => true,
line => '',
 }

Note how the 'line' attribute is still there but null (nothing between 2
single quotes).
HTH!

 -- Khalid

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