[Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
Thanks Gav, It's a good idea, though on the surface I don't think it will work for us (we're trying to spin stuff up from a gold image using an ENC, and I think having an extra magic step in between is a greater evil than explicit declarations), but you've got me thinking down some other lines

[Puppet Users] puppet module environment bug?

2016-01-29 Thread James Green
jamesg@puppet-master:/etc/puppet$ sudo puppet module list --environment tools_office /etc/puppet/environments/tools_office/modules └── garethr-docker (v4.1.1) /etc/puppet/modules ├── AlexCline-dirtree (v0.2.1) ├── AlexCline-fstab (v0.5.4) [ lots of others ] Why does puppet list the modules in the

Re: [Puppet Users] Error: Cannot start Windows Service. Access denied

2016-01-29 Thread Alex M
where i can read logs about certificate requests? четверг, 28 января 2016 г., 17:46:57 UTC+1 пользователь Alex M написал: > > but when run as Administrator i receive an error: > > C:\>puppet agent -t > Info: Caching certificate for test1.domain.company.com > Error: Could not request certificate:

Re: [Puppet Users] puppet module environment bug?

2016-01-29 Thread Lowe Schmidt
/etc/puppet/modules is available for all environments (if I am not mistaken). -- Lowe Schmidt | +46 723 867 157 On 29 January 2016 at 10:43, James Green wrote: > jamesg@puppet-master:/etc/puppet$ sudo puppet module list --environment > tools_office > /etc/puppet/environments/tools_office/modul

Re: [Puppet Users] Error: Cannot start Windows Service. Access denied

2016-01-29 Thread Alex M
so, i fixed it. by reinstalling Windows... but it isn't a good solution. пятница, 29 января 2016 г., 10:47:32 UTC+1 пользователь Alex M написал: > > where i can read logs about certificate requests? > > > > четверг, 28 января 2016 г., 17:46:57 UTC+1 пользователь Alex M написал: >> >> but when run

Re: [Puppet Users] puppet module environment bug?

2016-01-29 Thread James Green
So when I replace list with upgrade and specify which module within that environment to upgrade, am I expecting that module's dependencies to be upgraded / installed in the common modules? I ask as we got quite the fright what that happened... I just tested with --modulepath=environments/tools_off

[Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
I've made some good progress, and am agonisingly close. I have the below code which extracts the role into a variable (ugly, but it works). I had kinda assumed that Facter.Add would work server-side, but I've discovered that it doesn't. So now, my problem is simple how to make a string calcul

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Dirk Heinrichs
Am 29.01.2016 um 13:03 schrieb Gareth Humphries: > Any ideas? Can you derive the role from the hostname? I do something similar to determine the location of a machine based on IP address range. So I have lib/facter/location.rb in one of my modules, with the following content: # Set location of a

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
Hi Dirk, That's a good idea, thanks. In our case we have a lot of legacy hosts and no good naming convention - combined with an eye to a future of cloud-bases services (with undefined hostnames), and I think in our case that approach won't be maintainable. A good solution without those constra

Re: [Puppet Users] Error: Cannot start Windows Service. Access denied

2016-01-29 Thread jcbollinger
On Friday, January 29, 2016 at 4:25:36 AM UTC-6, Alex M wrote: > > so, i fixed it. by reinstalling Windows... but it isn't a good solution. > > No, that's not a good solution at all. Fortunately, it's also not a necessary one. The agent and master each identify themselves to the other via an

[Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread jcbollinger
On Friday, January 29, 2016 at 3:29:29 AM UTC-6, Gareth Humphries wrote: > > Thanks Gav, > > It's a good idea, though on the surface I don't think it will work for us > (we're trying to spin stuff up from a gold image using an ENC, and I think > having an extra magic step in between is a greate

[Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
ENC is the end game, but we have legacy hosts this has to work on. Right now I have site.pp which has a list of unpleasant regexes and an 'include role::' stanza for each. I could put '$role= ; include role::$role' in each of them instead, but I would have to do that in every single case, whi

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread R.I.Pienaar
- Original Message - > From: "Gareth Humphries" > To: "puppet-users" > Sent: Friday, January 29, 2016 4:50:50 PM > Subject: [Puppet Users] Re: Making a "role" fact work > ENC is the end game, but we have legacy hosts this has to work on. Right > now I have site.pp which has a list of

[Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Luke Bigum
This might be relevant: https://groups.google.com/forum/#!searchin/puppet-users/luke$20bigum|sort:date/puppet-users/XWAcm152cyQ/P_rpi50XBAAJ The ENC above inserts a top scope variable into a node's manifest, designed to be used as a "role" Fact. It reads from one of two YAML files, either expli

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
Normally, yes, but in this case it needs a class list locally to populate the fact, and it doesn't have that until after a run. Facts get sent to the master, where classes are allocated and a catalog compiled, then the catalog sent back to the client. Without the initial catalog, the client has

[Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
Thanks Luke, I'll give that a whirl. May prove helpful indeed! On Friday, January 29, 2016 at 4:07:42 PM UTC, Luke Bigum wrote: > > This might be relevant: > > > https://groups.google.com/forum/#!searchin/puppet-users/luke$20bigum|sort:date/puppet-users/XWAcm152cyQ/P_rpi50XBAAJ > > The ENC above

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Jason Slagle
On 1/29/16, 11:14 AM, "Gareth Humphries" wrote: Normally, yes, but in this case it needs a class list locally to populate the fact, and it doesn't have that until after a run. Facts get sent to the master, where classes are allocated and a catalog compiled, then the catalog sent back to the cl

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread R.I.Pienaar
- Original Message - > From: "Gareth Humphries" > To: "puppet-users" > Sent: Friday, January 29, 2016 5:14:12 PM > Subject: Re: [Puppet Users] Re: Making a "role" fact work > Normally, yes, but in this case it needs a class list locally to populate > the fact, and it doesn't have that

Re: [Puppet Users] Re: Making a "role" fact work

2016-01-29 Thread Gareth Humphries
Absolutely. I'm trying to do something weird, and that's why I'm failing. Let there be no doubt about that. On Friday, January 29, 2016 at 4:16:36 PM UTC, R.I. Pienaar wrote: > > > > - Original Message - > > From: "Gareth Humphries" > > > To: "puppet-users" > > > Sent: Friday, Janua

[Puppet Users] How to run shell command on puppet agent

2016-01-29 Thread Sans
Hi all, Just trying to solve a little thing: I understand that inline_template() gets complied on the PM and return the result that is not native to puppet agent . i.e. $ls_users = inline_template("<%= `cat /etc/passwd|awk -F: '{print $1}'` %>") notify { "THE SITE NAME: ${ls_users}": } will p

Re: [Puppet Users] How to run shell command on puppet agent

2016-01-29 Thread Steve Traylen
Hi Santanu, Hope your well. This kind of thing is exactly what custom facts are for. Write a custom fact to report the users. Steve. --- Steve Traylen From: Sans Sent: 29 Jan 2016 7:16 pm To: Puppet Users Subject: [Puppet Users] How to run shell command on puppet agent Hi all, Just trying t

Re: [Puppet Users] How to run shell command on puppet agent

2016-01-29 Thread Sans
Steve, how you doing?? It's been very long time... The list-of-users was just an example. The command that I actually wanna run is: $site_id = inline_template("<%= `/usr/bin/mysql -h0 -u${db_user} -p${db_password} -s -r -N -e 'SELECT id FROM ${db_name}.${wp_table_prefix}domain_mapping;'`

[Puppet Users] Puppet::Type.newtype create_resource with notify

2016-01-29 Thread Bartosz Kupidura
Hello All! Im trying to write new type which will add resource to catalog, but i have problem with 'notify' property. New resources are added to catalog, but unfortunately notify is not working. parameters = {:name => 'test', :notify => 'Service[test-service]', :value => '10} res = catalog.crea

[Puppet Users] Using Future Parser on Puppet v3.8.2

2016-01-29 Thread Sans
Hi there, Need to iterate over an arry, so was trying the Future Parser. Using a very simple example: $alpha = ['a','b','c'] each($alpha) |String $value| { notice( "Hi there, ${value}" ) } but getting this error: *Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Coul

[Puppet Users] Overriding the file resource with class inheritance

2016-01-29 Thread Kyle Flavin
I'm creating a module, and I want to override the file resource for puppet.conf which is defined within a module called "puppet". The resource declaration looks like this: # modules/puppet/manifests/init.pp class puppet { ... file { '/etc/puppet/puppet.conf': content => template(

[Puppet Users] Overriding file resource with class inheritance

2016-01-29 Thread Kyle Flavin
I'm creating a module, and I want to override the file resource for puppet.conf which is defined within a module called "puppet". The resource declaration looks like this: # modules/puppet/manifests/init.pp class puppet { ... file { '/etc/puppet/puppet.conf': content => template(

Re: [Puppet Users] Overriding file resource with class inheritance

2016-01-29 Thread Garrett Honeycutt
On 1/29/16 6:05 PM, Kyle Flavin wrote: > I'm creating a module, and I want to override the file resource for > puppet.conf which is defined within a module called "puppet". The > resource declaration looks like this: > > | > # modules/puppet/manifests/init.pp > classpuppet { >... > file {

Re: [Puppet Users] Overriding file resource with class inheritance

2016-01-29 Thread Kyle Flavin
On Friday, January 29, 2016 at 3:44:24 PM UTC-8, Garrett Honeycutt wrote: > > Hi Kyle, > > I think you have a scoping issue, try using the double colons for the > puppet class, such as 'class foreman-proxy::puppet inherits ::puppet'. > > You seem to be using inheritance correctly to override a r