Re: [Puppet Users] Implement custom resource parent/child relationship

2016-01-13 Thread Quaternaire
This way it's not possible to have *inherit B => true*, and *inherit C => 
false*. It's none or all, where we should be able to choose inheritance per 
project. 

On Tuesday, January 12, 2016 at 6:37:55 PM UTC+1, Peter Kristolaitis wrote:
>
> Why not just use arrays for the parent attribute?
>
> project { 'Z':
>   ensure   => present,
>   parent   => [ 'B', 'C' ],
>   inherit  => false,
> }
>
>
> On 01/12/2016 12:17 PM, Quaternaire wrote:
>
> Hi,
>
> I am creating a Module for Mantis Bug Tracker (an issue tracker, 
> https://www.mantisbt.org/), and I need to create new resource types for 
> Project and User.
>
> The idea is to have Projects which can inherit from other Projects. Each 
> Project can have multiple parent and/or childs, such as:
>
> Project A
> > Project B
> >> Project Z
> > Project C
> >> Project Z
>
>
>
> Where B an C are child of A, and Z is child of both B and C.
> Also, project inheritance is parameterized (such a whether a child inherit 
> parent properties).
>
> I have no issue implementing the types and providers themselves, it is 
> more with the end-user usage. Lets say I want to write a manifest 
> representing the example above. The first soluton that comes in mind could 
> be:
>
> project { 'A':
>   ensure => present,
> }
>
> project { 'B':
>   ensure   => present,
>   parent   => 'A',
>   inherit  => true,
> }
>
> project { 'C':
>   ensure   => present,
>   parent   => 'A',
>   inherit  => false,
> }
>
> project { 'Z':
>   ensure   => present,
>   parent   => 'B',
>   inherit  => false,
> }
> # Crap, how can Z have multiple parents?
> # Same problem if we use something like "child => 'B'" on A, how could A 
> have multiple children?
>
>
> ... which is not viable.
>
> Another solution could be:
> project { 'A':
>   ensure => present,
> }
>
> project { 'B':
>   ensure   => present,
> }
>
> project { 'C':
>   ensure   => present,
> }
>
> hierarchy { 'A>B':
>   child => 'B',
>   parent=> 'A',
>   inherit   => true,
> }
>
> hierarchy { 'B>Z':
>   child => 'Z',
>   parent=> 'B',
>   inherit   => false,
> }
>
> hierarchy { 'C>Z':
>   child => 'Z',
>   parent=> 'C',
>   inherit   => true,
> }
>
>
>
> This way it works fine, but it is quite cumbersome to write and maintain.
>
> So another way would be using hashes to define children (of parents):
>
> project { 'A':
>   ensure => present,
>   child  => {
> name => 'B',
> inherit  => true,
>   }
> }
>
> project { 'B':
>   ensure   => present,
>   child=> {
> name   => 'Z',
> inherit=> false,
>   } # We may add more child in this hash... 
> }
>
> project { 'C':
>   ensure   => present,
>   child=> {
> name   => 'Z',
> inherit=> true,
>   } # We may add more child in this hash...
> }
>
>
>
> Which also works fine, is easier to read, but does it respects Puppet 
> conventions? Users will be able to define whatever they want in these 
> hashes, and the Puppet mechanism of param/property linked to methods would 
> be broken.
>
> What do you think would be the best possibility? Having a Project type and 
> using a Hierarchy type to link it together, granting the possibility to use 
> hashes, or another solution?
>
> A final note: a similar problem is posed for users. How can we define a 
> user resource, and manage user specific parameters for each projects? I 
> think answering for projects will solve it for users.
>
> Thanks by advance for your ideas or advices!
> -- 
> 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/c0de16c7-4e56-4dae-a123-058651acc22e%40googlegroups.com
> .
> 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/631ee4a4-4507-4286-bb6a-75b0d30a4508%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Facter - custom fact regex

2016-01-13 Thread Hristo Mohamed
Try :
setcode { network }

>From puppett docs:


   1. A call to Facter.add('fact_name'), which determines the name of the
   fact
   2. A setcode statement for simple resolutions, which is evaluated to
   determine the fact’s value.


On Wed, Jan 13, 2016 at 12:42 AM, Mike Reed  wrote:

> Hello all,
>
> I'm having some trouble with a custom fact and I was hoping somebody could
> tell me what I'm doing wrong.
>
> Here is an example of the code:
>
> require 'facter'
> Facter.add('network') do
>   setcode do
> hostname = Facter.value(:hostname)
> ipaddress = Facter.value(:ipaddress)
> case
>   when
> ipaddres.match(/^(\d[10]\.)(\d[10]\.)([1][2][7]\.)([1-9][1-9][1-9])?/)
> network = 'net1'
>   when hostname.match(/^nettwo/)
> network = 'net2'
>   when hostname.match(/^netthree/)
> network = 'net3'
>   when hostname.match(/^netfour/)
> network = 'net4'
>   else
> network = 'nonet'
>   end
> network
> end
> end
>
> I've gotten myself into a pickle in that most hosts have a hostname prefix
> to designate what network they are on.  In this case, I don't have a prefix
> but the physical ip is different and my thoughts were to regex match the ip
> address and bingo...but no luck.
>
> Puppet runs and pluginsync does pull down the fact but I never get the
> value of network back.   No errors are displayed or logged when running
> 'facter -p' but again, I never get the value of network back.  I've done
> quite a bit of reading and can't figure out why this one doesn't work.
>
> Does anybody perhaps have any suggestions as to how I might accomplish
> this?
>
> Thank you in advance for your assistance.
>
> Cheers,
>
> Mike
>
> --
> 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/cbf9ea68-fffd-4e14-a467-486d8832bc0e%40googlegroups.com
> 
> .
> 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/CALuoJ65V%2B5xzYgtBEWu-HPffkV_rhVT17LDJS%2BUtSXfz1RhbAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to manage half file.

2016-01-13 Thread Hunter Haugen
Does the application have an "include" syntax that would allow you do have
one file that is one line that the application manages, and the file that
puppet manages includes it where appropriate?

Or a stupid workaround would be to have a fact that is that one line, and a
puppet template that adds the line. So puppet would manage the whole file
but the line would not be affected by a puppet run.



-Hunter

On Wed, Jan 13, 2016 at 12:25 PM, Albert Shih  wrote:

> Hi everybody.
>
> I want to manage through puppet a config file for a php web application.
>
> But I just want manage all of it's content except one line, because this
> line is manage by the application himself.
>
> I can't change the application behavior.
>
> I don't think I can manage through augeas because this file is not in any
> « standard » format.
>
> I prefer not to manage it through file_line because this config file is
> large.
>
> What kind of solution do I have ?
>
> Regards.
>
> JAS
> --
> Albert SHIH
> DIO bâtiment 15
> Observatoire de Paris
> 5 Place Jules Janssen
> 92195 Meudon Cedex
> France
> Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
> xmpp: j...@obspm.fr
> Heure local/Local time:
> mer 13 jan 2016 21:17:48 CET
>
> --
> 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/20160113202546.GB83097%40pcjas.obspm.fr
> .
> 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/CAJaQvGBx527Ji8AAGf8Ldx9dnPNzX1fEEOUW6nx5%2Bxnr9e5-ig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: ensure => file, creating directories

2016-01-13 Thread Clay Stuckey
I know this is ancient history but I just had the same thing happen. I have 
not been able to reproduce it. Do you remember any resolution?




On Tuesday, November 29, 2011 at 9:06:25 AM UTC-5, jasper.h...@m-w.co.uk 
wrote:
>
> Hi all,
>
> Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and
> we're noticing some rather odd behaviour.
> What's always traditionally worked for creating ini files and the
> like, is now creating directories instead of files (indeed, replacing
> my existing files with directories, which had some rather catastrophic
> consequences for the poor poor test systems).
>
> Even when hard coding ensure => file, instead of a passing a
> parameter... it creates a directory.
> The type parameter just doesn't seem to be doing as it's told.  Roll
> back to previous version of puppet server, it's all happy again
> (though it can't convert the directory back to a file, but that'll be
> a separate issue entirely).
>
> Anybody have any clues as where else would be worth looking in trying
> to resolve this?
>
>
> relevant section of files:
>
> file { $name:
> name => "${path}${name}",
> mode => $mode,
> owner => $owner,
> group => $group,
> backup => $backup,
> recurse => $recurse,
> ensure => $ensure,
> source => [
>
> 
> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
> $fqdn",
>
> 
> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
> $operatingsystem",
>
> 
> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
> $default",
>
> 
> "puppet://puppet/modules/standalone-configs/$folder/$name-$fqdn",
>
> 
> "puppet://puppet/modules/standalone-configs/$folder/$name-
> $operatingsystem",
>
> 
> "puppet://puppet/modules/standalone-configs/$folder/$name-default"
> ],
> notify => $notify
>
>
> 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/f39c2e0c-a7e4-44ae-9454-4f492640cb8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Serving files from custom mount point in Puppet 4

2016-01-13 Thread Eric Sorenson

On Jan 12, 2016, at 6:21 AM, kashif  wrote:

> Hi Eric
> 
> rpm -qa | grep puppet
> puppet-agent-1.3.2-1.el6.x86_64
> puppetlabs-release-pc1-1.0.0-1.el6.noarch
> puppetserver-2.2.1-1.el6.noarch
> 
> cat /etc/puppetlabs/puppet/fileserver.conf
> 
> [site_files]
>path /etc/puppetlabs/codes/files
>allow *


This should be /etc/puppetlabs/code/files ...

> 
> I haven't changed auth.conf file 
> cat /etc/puppetlabs/puppetserver/conf.d/auth.conf
> 
>  [ ... ]
> Test manifest
> 
> file { '/root/puppet_test':
>source => "puppet:///site_files/puppet-test",
>ensure => present,
>  }
> 
> Error
> Puppet Not authorized to call find on /file_metadata/site_files/puppet-test 
> with {:links=>"manage", :checksum_type=>"md5", :source_permissions=>"ignore", 
> :rest=>"site_files/puppet-test"
> 

This message is on the agent, there should be a corresponding message in the 
server logs -- can you include that if you still have trouble after fixing the 
'codes' -> 'code' path in fileserver.conf?

Eric Sorenson - eric.soren...@puppetlabs.com 
 - freenode #puppet: eric0
puppet platform // coffee // techno // bicycles

-- 
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/4589B455-3D30-4210-93D8-8E47BEE13BC7%40puppetlabs.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to manage half file.

2016-01-13 Thread Albert Shih
Hi everybody.

I want to manage through puppet a config file for a php web application.

But I just want manage all of it's content except one line, because this
line is manage by the application himself.

I can't change the application behavior.

I don't think I can manage through augeas because this file is not in any
« standard » format.

I prefer not to manage it through file_line because this config file is
large.

What kind of solution do I have ?

Regards.

JAS
--
Albert SHIH
DIO bâtiment 15
Observatoire de Paris
5 Place Jules Janssen
92195 Meudon Cedex
France
Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
xmpp: j...@obspm.fr
Heure local/Local time:
mer 13 jan 2016 21:17:48 CET

-- 
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/20160113202546.GB83097%40pcjas.obspm.fr.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: ensure => file, creating directories

2016-01-13 Thread linux script
Even I faced the issue some time ago and the error is gone after quoting
each and every variable with curly braces. Please check if something like
below works for you.

file { ${name}:
On 14 Jan 2016 00:28, "Clay Stuckey"  wrote:

> I know this is ancient history but I just had the same thing happen. I
> have not been able to reproduce it. Do you remember any resolution?
>
>
>
>
> On Tuesday, November 29, 2011 at 9:06:25 AM UTC-5, jasper.h...@m-w.co.uk
> wrote:
>>
>> Hi all,
>>
>> Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and
>> we're noticing some rather odd behaviour.
>> What's always traditionally worked for creating ini files and the
>> like, is now creating directories instead of files (indeed, replacing
>> my existing files with directories, which had some rather catastrophic
>> consequences for the poor poor test systems).
>>
>> Even when hard coding ensure => file, instead of a passing a
>> parameter... it creates a directory.
>> The type parameter just doesn't seem to be doing as it's told.  Roll
>> back to previous version of puppet server, it's all happy again
>> (though it can't convert the directory back to a file, but that'll be
>> a separate issue entirely).
>>
>> Anybody have any clues as where else would be worth looking in trying
>> to resolve this?
>>
>>
>> relevant section of files:
>>
>> file { $name:
>> name => "${path}${name}",
>> mode => $mode,
>> owner => $owner,
>> group => $group,
>> backup => $backup,
>> recurse => $recurse,
>> ensure => $ensure,
>> source => [
>>
>> 
>> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
>> $fqdn",
>>
>> 
>> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
>> $operatingsystem",
>>
>> 
>> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
>> $default",
>>
>> 
>> "puppet://puppet/modules/standalone-configs/$folder/$name-$fqdn",
>>
>> 
>> "puppet://puppet/modules/standalone-configs/$folder/$name-
>> $operatingsystem",
>>
>> 
>> "puppet://puppet/modules/standalone-configs/$folder/$name-default"
>> ],
>> notify => $notify
>>
>>
>> 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/f39c2e0c-a7e4-44ae-9454-4f492640cb8a%40googlegroups.com
> 
> .
> 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/CAPLcSAAtdiVvroWfG3UeaT0hxanz_4X9k4%2BVAxsgjwsPajOVfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Implement custom resource parent/child relationship

2016-01-13 Thread jcbollinger


On Wednesday, January 13, 2016 at 2:08:52 AM UTC-6, Quaternaire wrote:
>
> This way it's not possible to have *inherit B => true*, and *inherit C => 
> false*. It's none or all, where we should be able to choose inheritance 
> per project. 
>
> On Tuesday, January 12, 2016 at 6:37:55 PM UTC+1, Peter Kristolaitis wrote:
>>
>> Why not just use arrays for the parent attribute?
>>
>> project { 'Z':
>>   ensure   => present,
>>   parent   => [ 'B', 'C' ],
>>   inherit  => false,
>> }
>>
>>

It's not entirely clear to me why you want to manage the contents of a 
Mantis database as system *configuration*, but Puppet is flexible enough to 
do it.

Your problem springs largely from the fact that your parent / child 
relationships have more state than just their presence or absence.  You 
need a way to convey that state.  You already know that you can do it via 
separate resources.  If you want to do it all within the Project resource, 
then you'll need to use one or more attributes with complex data type.  
There are all manner of specific ways you could go here, including the one 
you proposed, but I would advise you to have children declare who their 
parents are, instead of having parents declare who their children are.  For 
example, you might support a form like this:

project { 'C':
  ensure => present,
  parent => { 'A' => { 'inherit' => true }, 'B' => { 'inherit' => false } }
}


As for validating the contents of the hash-valued attributes, that's just 
par for the course.  With more complex data comes more complex requirements 
for validation.  Use the validation hook in your custom type to engage 
whatever validation is appropriate.


John

-- 
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/aa92f34e-aa4b-4981-8385-67a84d99bf84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] package_updates module face doesn't load?

2016-01-13 Thread Matthew Nicholson
So i just submitted an issue but I'm not sure if the github page for this
new module is really watched, so, I wanted to post here as well:

https://github.com/puppetlabs/puppetlabs-package_updates/issues/6

It basically boils down to : I installed the module, gave a client the
class, cron job was created, but the face doesn't seem to be
loaded/available (it was sync'd to the client). Not sure if this is this
module itself, or an issue with puppet 4.3.1 and face loading..?

-- 
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/CA%2BnEbkYjDdGcNHttN85B70k17g3LvFZ1%3DdqPD8v_gyqfZW-GKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: class level notify

2016-01-13 Thread jcbollinger


On Tuesday, January 12, 2016 at 3:46:42 PM UTC-6, Johan Martinez wrote:
>
>
> I want to notify a service whenever certain config files change. Rather 
> than putting notify function in every resource, can class level notify with 
> chaining arrow/tilda work here?
>
> I am referring to 
> https://docs.puppetlabs.com/puppet/latest/reference/lang_relationships.html#syntax-chaining-arrows
>  
> . 
>
> I have defined multiple file resources inside config class. Will something 
> like below notify service class if any of the resources in config class are 
> applied/changed?
>
> Class['site::config'] ~> Class['site::service']
>
>
TL;DR: yes.

In more detail, the Language Reference describes how containment interacts 
with event broadcast and reception 

 
(the mechanism underlying resource notification and refreshing).  In 
particular,

If Puppet changes (or refreshes) any resource in a class or defined 
> resource, that class or defined resource will send a refresh event to any 
> subscribed resources.
>

and

If a class or defined resource gets a refresh event, every resource it 
> contains will also get a refresh event.
>

Those both apply to the example you presented.

One thing to watch out for, however, is that the event broadcasting 
produced by a declaration such as you presented may be more than you 
actually want.  That is, there must not be any resources in 
Class['site::config'] from which you do not want to receive events, nor any 
in Class['site::service'] to which the events should not be directed.


John

-- 
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/dec4c676-6be7-4914-a9e4-31465c929d38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Facter - custom fact regex

2016-01-13 Thread jcbollinger


On Tuesday, January 12, 2016 at 5:42:45 PM UTC-6, Mike Reed wrote:
>
> Hello all,
>
> I'm having some trouble with a custom fact and I was hoping somebody could 
> tell me what I'm doing wrong.  
>
> Here is an example of the code:
>
> require 'facter'
> Facter.add('network') do
>   setcode do
> hostname = Facter.value(:hostname)
> ipaddress = Facter.value(:ipaddress)
> case 
>   when 
> ipaddres.match(/^(\d[10]\.)(\d[10]\.)([1][2][7]\.)([1-9][1-9][1-9])?/)
> network = 'net1'  
>   when hostname.match(/^nettwo/)
> network = 'net2'
>   when hostname.match(/^netthree/)
> network = 'net3'
>   when hostname.match(/^netfour/)
> network = 'net4'
>   else
> network = 'nonet'
>   end
> network
> end
> end
>
> I've gotten myself into a pickle in that most hosts have a hostname prefix 
> to designate what network they are on.  In this case, I don't have a prefix 
> but the physical ip is different and my thoughts were to regex match the ip 
> address and bingo...but no luck.
>
> Puppet runs and pluginsync does pull down the fact but I never get the 
> value of network back.   No errors are displayed or logged when running 
> 'facter -p' but again, I never get the value of network back.  I've done 
> quite a bit of reading and can't figure out why this one doesn't work.
>


You misspell "ipaddress" in the first "when" clause.  I wouldn't have 
expected that to cause the fact to be silently ignored, and maybe it 
doesn't, but you should fix it regardless.

Otherwise, I don't see anything inherently wrong with your fact code.  If 
after you fix the misspelling, the fact is not submitted to the master, and 
'facter -p' neither prints it nor emits any error message, then my first 
guess would be that it has not properly been synced, your assertion to the 
contrary notwithstanding.  In that case, look into where the synced file 
actually went (if anywhere).  If it is indeed in a subdirectory "facter" of 
some directory in the Ruby load path, then verify that the file and every 
directory in the path to it is accessible to puppet and facter.  Even with 
the agent running with privilege, as normally it must do, it is possible 
for it to be denied access to some files and directories.


John

-- 
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/a162f4f4-7bd6-4f7f-9a71-9c99d0e76207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Implement custom resource parent/child relationship

2016-01-13 Thread Quaternaire


> It's not entirely clear to me why you want to manage the contents of a 
> Mantis database as system *configuration*, but Puppet is flexible enough to 
> do it.
>
> Managing database content this way seems in Puppet range (such as with 
*macauthorization)*. 
We also need MantisBT to be ready with pre-defined projects and users as 
some external components may have to generate issues, it thus become part 
of our environment configuration requirements. 

Your problem springs largely from the fact that your parent / child 
> relationships have more state than just their presence or absence.  You 
> need a way to convey that state.  You already know that you can do it via 
> separate resources.  If you want to do it all within the Project resource, 
> then you'll need to use one or more attributes with complex data type.  
> There are all manner of specific ways you could go here, including the one 
> you proposed, but I would advise you to have children declare who their 
> parents are, instead of having parents declare who their children are.  For 
> example, you might support a form like this:
>
> project { 'C':
>   ensure => present,
>   parent => { 'A' => { 'inherit' => true }, 'B' => { 'inherit' => false } 
> }
> }
>
>
> As for validating the contents of the hash-valued attributes, that's just 
> par for the course.  With more complex data comes more complex requirements 
> for validation.  Use the validation hook in your custom type to engage 
> whatever validation is appropriate.
>

Your explanation is quite clear, I'll probably use something like this. 
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/5064d3d1-8a26-4eca-b5ab-9ee53b30ade6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetserver 2.2.1-1puppetlabs1 r10k gem jruby not found

2016-01-13 Thread Kevin Corcoran
On Tue, Jan 12, 2016 at 10:20 PM, Rudy Gevaert 
wrote:

> Hi,
>
> I'm trying to set up puppetserver for the first time.  I
> installed puppetserver 2.2.1-1puppetlabs1 on a trusty server with the
> Debian package.  I then installed r10k with 'puppetserver gem install r10k
> --no-ri --no-rdoc'.
>
> However the r10k binary is not in my path. It's
> in /opt/puppetlabs/server/data/puppetserver/jruby-gems/bin/r10k.  So the
> gem got installed.
>
> Running that binary gives me:
>
> root@puppet:/opt/puppetlabs#
> /opt/puppetlabs/server/data/puppetserver/jruby-gems/bin/r10k
> /usr/bin/env: jruby: No such file or directory
>
> Installing jruby from the ubuntu repos doesn't get it working.
> /usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems.rb:777:in
> `report_activate_error': Could not find RubyGem r10k (>= 0) (Gem::LoadError)
>
> I can't find any information about setting up jruby regarding Puppetserver.
>
> How can I fix this issue?
>



Hi Rudy,

I think that what you want to do is install r10k via the *system* `gem
install ...` command and not `puppetserver gem install `.

Even though r10k runs on the master, it runs as a separate process (not
inside of Puppet Server) and uses the system ruby (likely MRI).

-- 
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/CAF-bMBd%3D8H70tScEV2Cp_UQxJ-sZWU%3DOJh-mMBhvgegH4ZpeEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetserver 2.2.1-1puppetlabs1 r10k gem jruby not found

2016-01-13 Thread Kevin Corcoran
On Wed, Jan 13, 2016 at 9:04 AM, Kevin Corcoran <
kevin.corco...@puppetlabs.com> wrote:
>
> Even though r10k runs on the master, it runs as a separate process (not
> inside of Puppet Server) and uses the system ruby (likely MRI).
>

... unless we're talking about the r10k used by the new Code Manager
feature in Puppet Enterprise 2015.3, which *does* run inside Puppet Server
... although it still doesn't use JRuby ... for now, although it likely
will in the future.  I don't how this could possibly confuse anyone!  ;)

Snark aside ... Rudy, I think you just want to use the system ruby.

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