[Puppet Users] parameters set with array

2014-07-18 Thread OS
Hello all,

I am newbie to puppet and sorry if it is a silly question. What is wrong 
with my manifest?

define webapp ($domain,$port){
  file { "/tmp/${name}": > This is working and 
creating the files as /tmp/test , /tmp/test1 etc
content => "Server:${port}",
  }
  notify { $domain: }
}

$websites = ['test','test1','test2']

webapp { $websites :
  domain => $websites,  -> Here, how  can iterate websites 
array? It gives error as duplicate definition.
  port => 80,
}

Thanks,
OS



-- 
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/afa8419e-d24c-4868-b774-3c348b6275ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Schedule for own resources?

2012-02-02 Thread Os
On Feb 2, 9:43 pm, jcbollinger  wrote:
>
> Hmm.  That statement may have been overly optimistic.  I think it's
> pretty clear clear cut that schedules *should* work for defined type
> instances, but perhaps Puppet is buggy in that regard.
>
> I don't see anything wrong with your manifest or your expectations.  I
> would submit a bug report / feature request.  This seems to be related
> to, but distinct from, open (and accepted) feature request 
> 5856:http://projects.puppetlabs.com/issues/5856.
>
> John

Many Thanks for the reply and the link. I will keep that in mind, For
now I will simply set the schedule in the cron-resource as a
workaround.

Regards,
Martin

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Schedule for own resources?

2012-02-02 Thread Os
On Feb 2, 3:34 pm, jcbollinger  wrote:
>
> You are missing something, I think.  The 'schedule' metaparameter can
> be used with any resource, including those of defined types.
>
> Could it be as simple as the fact that you name your schedule
> 'morning', but assign a different, possibly missing, schedule 'einmal'
> to the resource?
>
> Anyway, you didn't specify what "does not work" means.  What is the
> nature of the [mis]behavior you see?  Is it possible that you have the
> wrong expectations?  Schedules in Puppet limit when or how often
> resources are managed, but that's modulated by when and how often the
> node checks in to request a catalog.
>
> John

Ah, I am sorry. You are absolutly right! I have a typo in my example.
Actually I use the schedule "morning" in my resource.
Perhaps some background is useful: the define "my_crontab" is using a
"cron" type in the background.

When I did some tests, I inserted the schedule in the "cron" part and
it worked. But when I try to use the schedule directly in the call of
the define "my_crontab" (like in the example), it does not work.
I am expecting in the example above that the resource my_crontab{"user-
crontab"} is only activated during 8 and 9'o clock, assuming there is
a puppet run at this time.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Schedule for own resources?

2012-02-02 Thread Os
Hello,

I am testing some schedule configurations and was wondering if I can
use the schedule type in my own defines? As far as I can claim from my
own tests, this is not possible?

For example, the schedule "morning" does not work with my self-written
define "my_crontab":

#

class crontab {
schedule {"morning":
range => "8-9",
}

my_crontab{"user-crontab":
hostname => 'foobar001',
schedule => 'einmal',
}
}

#

Am I missing something or is it impossible to use the schedule type
with my own defines?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet and augeas - onlyif conditions; overwriting default values

2010-12-29 Thread Os
Hello,

I am still not getting warm with augeas and puppet, there are some
things I do not understand. At the moment I am trying the following:

- I want to set some kernel parameters in the /etc/sysctl.conf file
- in one puppet module, I have defined some default values for the
kernel parameters
- but for several servers I want to modify some of these values,
therefore I would like to overwrite the default value via the custom
module of these servers

Here is an fictitious example:

1. puppet module with the default value:

...
augeas {"default-sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.aio-max-nr 1048576",
"set fs.file-max 9000",
],
notify => Exec["load-sysctl"],
onlyif => "match #comment[1] != 'MODIFY_FLAG'",
}
exec { "load-sysctl":
command => "/sbin/sysctl -p",
refreshonly => true,
}
...

2. custom puppet module to adjust adjusted value:

augeas {"custom-sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set fs.file-max 3000",
],
notify => Exec["load-sysctl"],
}


My problem is now the "match"-constraint. I would like to set a
comment in the /etc/sysctl.conf file to tell augeas/puppet that the
file will be configured via an other module.
So I want to match if this comment is present or not. I have tried
several combinations, at the moment I wrote the MODIFY_FLAG comment on
top of the file. But none of these worked.
When I rebuild this in augtool, it works fine:
augtool> match /files/etc/sysctl.conf/#comment[1] MODIFY_FLAG

I am using the following software:
- puppet 0.25.5
- augeas 0.7.4
- augeas-libs 0.7.4
- ruby-augeas 0.3.0

But perhaps I am doing the whole thing wrong, is there an other way to
solve this default-custom thing?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Puppet replaces deleted files

2010-11-30 Thread Os
> As in using your operating systems package management.  If you're running
> Debian/Ubuntu that'll be a .deb, if you're using RedHat/CentOS/Fedora
> that'll be a .rpm.

Thanks for the advice, thats something I did not think about but
absolutly solves my problem!
Although I am a bit confused about the puppet command  mot working for
me.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet replaces deleted files

2010-11-29 Thread Os
Hi,

I am using puppet 2.6.2 and stepped over a situation, I cannot explain
to myself. So here is the deal:
- I want to source several directories and files one time to a client
- with the first puppet run, puppet should copy the files and
directories to the client to the specified location
- if files are changed in their content, puppet does not replace them

Up to this point everything works fine, but here comes the problem:
- if files are deleted, puppet "restores" them and copies them back
from the master

And thats what I do not want, I have tried several things but did not
get the trick how to prevent puppet from being so thoughtful. Can
anyone give me a hint how to stop puppet from replacing deleted files?

Here is my puppet construct:
file { "/oracle/files/":
source => "puppet:///modules/oracle_prereq/ORACLE_BASE",
ensure => "directory",
recurse => "true",
replace => "false",
checksum => "none",
}

I think one problem might be the checksums, I have no clue how to
prevent puppet from checkuming those files!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Provider Augeas not functional on Sles10?

2009-12-15 Thread Os
No, I have just installed the 4 packages. How do I compile these
bindings, I have not worked with ruby that much.
I have downloaded "ruby-augeas-0.3.0.tgz" from "http://augeas.net/
download/ruby/" but do not know how to go further.
I need rake to compile this Rakefile?

On 14 Dez., 22:52, Dan Bode  wrote:
> Did you compile the ruby augeas bindings?
>
> On Mon, Dec 14, 2009 at 8:24 AM, Os  wrote:
> > Hi,
> > I have a problem with augeas, puppet and Suse 10 SP2.
> > Augeas works when I use the augtool to edit files. But I would like to
> > use it in combination with puppet. My class looks something like this:
> >    augeas {"sysctl.conf":
> >            provider => "augeas",
> >            context => "/files/etc/sysctl.conf",
> >            changes => [
> >                "set net.core.wmem_default 262144",
> >                "set net.core.wmem_max 262144",
> >                "set kernel.sem 250        32000   100      128",
> >            ],
> >    }
>
> > When I do a 'puppetd -v -d --no-daemonize --onetime' on my node, I get
> > the following error:
> > "err: //Node...Failed to retrieve current state of resource: Provider
> > augeas is not functional on this platform"
>
> > I have installed the following packages:
> > # yum list | grep augeas
> > augeas.x86_64                     0.5.0-3.1                installed
> > augeas-devel.x86_64               0.5.0-3.1                installed
> > augeas-lenses.x86_64              0.5.0-3.1                installed
> > libaugeas0.x86_64                 0.5.0-3.1                installed
>
> > Is there something else I am missing or does augeas and puppet do not
> > work on Sles10 ?
>
> > Greetings,
> > Os
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.
> > To post to this group, send email to puppet-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > puppet-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/puppet-users?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.




[Puppet Users] Provider Augeas not functional on Sles10?

2009-12-14 Thread Os
Hi,
I have a problem with augeas, puppet and Suse 10 SP2.
Augeas works when I use the augtool to edit files. But I would like to
use it in combination with puppet. My class looks something like this:
augeas {"sysctl.conf":
provider => "augeas",
context => "/files/etc/sysctl.conf",
changes => [
"set net.core.wmem_default 262144",
"set net.core.wmem_max 262144",
"set kernel.sem 25032000   100  128",
],
}

When I do a 'puppetd -v -d --no-daemonize --onetime' on my node, I get
the following error:
"err: //Node...Failed to retrieve current state of resource: Provider
augeas is not functional on this platform"

I have installed the following packages:
# yum list | grep augeas
augeas.x86_64 0.5.0-3.1installed
augeas-devel.x86_64   0.5.0-3.1installed
augeas-lenses.x86_64  0.5.0-3.1installed
libaugeas0.x86_64 0.5.0-3.1installed

Is there something else I am missing or does augeas and puppet do not
work on Sles10 ?

Greetings,
Os

--

You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.