[Puppet Users] getvar and case

2017-06-22 Thread Ugo Bellavance
Hi,

I'm fetching some data in facts using getvar, but as soon as there is a 
capital letter in the result, the result doesn't go in the variable.

For example, this never returns anything:

  $directive_value_fact   = getvar("::zend_directive_fileValue_${name}")

The generated fact that I'm looking for contains "fileValue" so I don't 
really have the choice, except to maybe edit the fact-gathering script to 
do replace, but it may cause other problems.

I'm on stdlib 4.16 and I don't see any bugfixes for that in the changelog 
of more recent versions.

Another example... This works, as long as "name" doesn't contain a capital 
letter. And some extensions start with a capital letter (like Phar).

  $extension_status_fact   = getvar("::zend_extension_status_${name}")

Final example.  This works, as long as ${user_app_name} doesn't contain a 
capital letter.

  $app_name_fact   = getvar("::zend_application_name_${user_app_name}")

Actually, from my testing I found that that if ${user_app_name} is all 
caps, it would work.

Any ideas welcome.  For ${user_app_name}, the workaround would be to only 
use all-lowercase application names, but since we don't decide the exact 
name of PHP extensions, the workaround doesn't work.

As you can see in the facts, the only way to get the data that we need is 
to get the zend_directive_fileValue to the the current value of the 
directive.

zend_directive_name_upload_max_filesize=upload_max_filesize
zend_directive_section_upload_max_filesize=
zend_directive_fileValue_upload_max_filesize=32M
zend_directive_defaultValue_upload_max_filesize=32M
zend_directive_isMemoryOnly_upload_max_filesize=0
zend_directive_previousValue_upload_max_filesize=
zend_directive_description_upload_max_filesize=The maximum size of an 
uploaded file
zend_directive_type_upload_max_filesize=shorthand
zend_directive_listValues_upload_max_filesize=
zend_directive_context_upload_max_filesize=Extension
zend_directive_contextName_upload_max_filesize=Filesystem and Streams
zend_directive_units_upload_max_filesize=


Thanks,

Ugo

-- 
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/ae0fd784-fb27-486b-b770-bace0970e58d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet works on 41 times out of 43. Help?

2017-06-22 Thread Rob Nelson
There might be a bug, but again, you're on an EOL version of puppet. It's
entirely possible that any issue you're observing has been fixed already.

On Thu, Jun 22, 2017 at 11:56 AM Robert Inder 
wrote:

> On 22 June 2017 at 14:42, jcbollinger  wrote:
>
>>
>>
>> On Thursday, June 22, 2017 at 5:26:41 AM UTC-5, Robert Inder wrote:
>>
>> I don't understand why the behavior you describe occurs, but I also don't
>> understand why you are trying to set the owner of the link in the first
>> place, especially if the directory containing it belongs to root.
>>
>
> ​I was creating a number of files, mostly in the user's own directory,
> and I simply I used the same "pattern" for each of them...
>
>
>>
>>>If I change the manifest to not specify ownership of the link,
>>>  it creates a "swindon" link link owned by root.
>>>
>>
>> So why not go with that?
>>
>
> ​Now that, thanks to Rob Nelson's ​suggestion (for which many thanks, Rob),
> I realise that this will work, that is indeed the route I will go down.
>
> Though there does still seem to be a bug in there somewhere...
>
>
>
>> The link owner is relevant only to modifying or removing the link itself,
>> and since you're managing it via Puppet, I don't see what purpose it serves
>> to relax the permissions for that.  The link owner and permissions have no
>> relevance to *traversing* the link (see symlink(7)).
>>
>>
>> John
>>
>>
>
> --
> Robert Inder,0131 229 1052 / 07808 492
> 213
> Interactive Information Ltd,   3, Lauriston Gardens, Edinburgh EH3 9HH
> Registered in Scotland, Company no. SC 150689
>Interactions speak louder than
> words
>
> --
> 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/CAKqjJm-vLb-%3D%2BGo4%2BbwNM13JOVipDf0nsoZnk3xmFsUbrs6q6Q%40mail.gmail.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/CAC76iT8Vf-QGBb-L_wysnPiBSYsBGCrdZFqyN%3DydQD78gb%2BTpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: Puppet Enterprise 2016.4.6 and 2017.2.2 are now available!

2017-06-22 Thread Molly Waggett
Dear Puppet Enterprise Users,

Puppet Enterprise 2016.4.6 and 2017.2.2 are now available.

These are security and bugfix releases of Puppet Enterprise. All users of
Puppet Enterprise 2016.4.x and 2017.2.x are encouraged to upgrade when
possible to Puppet Enterprise 2016.4.6 and 2017.2.2, respectively.

These releases include fixes to address security vulnerabilities in the
Classifier, PostgreSQL, and libxslt, as well as a number of other bugfixes
and improvements.

For information on the bug fixes in these releases, see
https://docs.puppet.com/pe/2016.4/release_notes.html and
https://docs.puppet.com/pe/2017.2/release_notes.html.

As a current Puppet Enterprise user, you can upgrade to this new version as
part of your annual subscription. If upgrading, it is required to upgrade
your master, puppetdb, and console servers first.

As always, we want to hear about your experiences with Puppet Enterprise.
If you have any questions about upgrading, be sure to get in touch with
Puppet Support.

-- 
*Molly Waggett*
Assoc. Release Engineer
--
Register now:
PuppetConf 2017 , 10-12 October
San Francisco, California
Save $328, register by 30 June w/ early adopter discount


-- 
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/CAFOE68Au%2B86g0JZYOBgFdTuoY-orDmbOw7-M%2BP0-RPFLTQQHLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Service set to stopped causes error when the service doesn't exist on Windows

2017-06-22 Thread jmp242
I want to make sure Firefox isn't automatically updating itself on our 
Windows computers. In most instances, if I have a service set to stopped, 
not having it installed should equal the same thing. How could I express 
either is OK in Puppet?

  service { 'FirefoxUpdateService':
name   => 'mozillamaintenance',
ensure => stopped,
  }

is throwing an error on my systems that don't seem to have that service 
What's the right solution here?

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/c6e6ac99-3918-44cb-a8a2-328239db86e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet works on 41 times out of 43. Help?

2017-06-22 Thread Robert Inder
On 22 June 2017 at 14:42, jcbollinger  wrote:

>
>
> On Thursday, June 22, 2017 at 5:26:41 AM UTC-5, Robert Inder wrote:
>
> I don't understand why the behavior you describe occurs, but I also don't
> understand why you are trying to set the owner of the link in the first
> place, especially if the directory containing it belongs to root.
>

​I was creating a number of files, mostly in the user's own directory,
and I simply I used the same "pattern" for each of them...


>
>>If I change the manifest to not specify ownership of the link,
>>  it creates a "swindon" link link owned by root.
>>
>
> So why not go with that?
>

​Now that, thanks to Rob Nelson's ​suggestion (for which many thanks, Rob),
I realise that this will work, that is indeed the route I will go down.

Though there does still seem to be a bug in there somewhere...



> The link owner is relevant only to modifying or removing the link itself,
> and since you're managing it via Puppet, I don't see what purpose it serves
> to relax the permissions for that.  The link owner and permissions have no
> relevance to *traversing* the link (see symlink(7)).
>
>
> John
>
>

-- 
Robert Inder,0131 229 1052 / 07808 492
213
Interactive Information Ltd,   3, Lauriston Gardens, Edinburgh EH3 9HH
Registered in Scotland, Company no. SC 150689
   Interactions speak louder than
words

-- 
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/CAKqjJm-vLb-%3D%2BGo4%2BbwNM13JOVipDf0nsoZnk3xmFsUbrs6q6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Henrik Lindberg

On 22/06/17 17:14, Henrik Lindberg wrote:

On 22/06/17 15:06, Bill Sirinek wrote:


Here's the file causing the error. I highlighted line 34 of the code, 
the slash at the end is where the error is pointing. Running puppet 
parser validate on the file using the 4.10.x agent does not produce 
this error, but it happens with 4.9.4 (PE 2017.1.1)





See
https://tickets.puppetlabs.com/browse/PUP-7306

- henrik



There is a bug in puppet that was fixed. before 4.10.0 it was not 
possible to have newlines in a regular expression. That is why it works 
in 4.10


- henrik

root@puppetmaster # puppet parser validate 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp 

Error:Couldnotparse forenvironment production:Syntaxerror at '/'at 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp:34:37 



root@puppetmaster # cat 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp 


# This file was automatically generated on 2017-06-20 11:07:45 -0400.
# Use the 'puppet generate types' command to regenerate this file.


# foreman_smartproxy registers a smartproxy in foreman.
Puppet::Resource::ResourceType3.new(
'foreman_smartproxy',
[
# The basic property that the resource should be in.
#
# Valid values are `present`, `absent`.
Puppet::Resource::Param(Enum['present','absent'],'ensure'),


# The url of the smartproxy
#
# Values can match `/
# ([a-zA-Z][\-+.a-zA-Z\d]*):   (?# 1: 
scheme)

# (?:
#   
((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*)
(?# 2: opaque)

# |
#(?:(?:
#  \/\/(?:
#   (?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)?
(?# 3: userinfo)
#   
(?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))? 
(?# 4: host, 5: port)

#|
#  ((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+) 
   (?# 6: registry)

#)
#  |
#  (?!\/\/))   (?# XXX: '\/\/' is 
the mark for hostport)
#   
(\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)?
(?# 7: path)
#   )(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
 (?# 8: query)

# )
# (?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
  (?# 9: fragment)

#   /x`.
Puppet::Resource::Param(Pattern[/
 ([a-zA-Z][\-+.a-zA-Z\d]*):   (?# 1: 
scheme)

 (?:
  
((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*)
(?# 2: opaque)

 |
(?:(?:
  \/\/(?:
  (?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)?
(?# 3: userinfo)
  
(?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))? 
(?# 4: host, 5: port)

|
  ((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+) 
 (?# 6: registry)

)
  |
  (?!\/\/))   (?# XXX: '\/\/' is 
the mark for hostport)
  
(\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)?
(?# 7: path)
  )(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
 (?# 8: query)

 )
(?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
  (?# 9: fragment)

   /],'url')
],
[
# The name of the smartproxy.
Puppet::Resource::Param(Any,'name',true),


# Foreman's base url.
Puppet::Resource::Param(Any,'base_url'),


# Foreman's effective user for the registration (usually admin).
Puppet::Resource::Param(Any,'effective_user'),


# Foreman oauth consumer_key
Puppet::Resource::Param(Any,'consumer_key'),


# Foreman oauth consumer_secret
Puppet::Resource::Param(Any,'consumer_secret'),


# Foreman SSL CA (certificate authority) for verification
Puppet::Resource::Param(Any,'ssl_ca'),


# Timeout for HTTP(s) requests
Puppet::Resource::Param(Any,'timeout'),


# The specific backend to use for this `foreman_smartproxy`
# resource. You will seldom need to 

Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Henrik Lindberg

On 22/06/17 15:06, Bill Sirinek wrote:


Here's the file causing the error. I highlighted line 34 of the code, 
the slash at the end is where the error is pointing. Running puppet 
parser validate on the file using the 4.10.x agent does not produce this 
error, but it happens with 4.9.4 (PE 2017.1.1)


|



There is a bug in puppet that was fixed. before 4.10.0 it was not 
possible to have newlines in a regular expression. That is why it works 
in 4.10


- henrik

root@puppetmaster # puppet parser validate 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp
Error:Couldnotparse forenvironment production:Syntaxerror at '/'at 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp:34:37


root@puppetmaster # cat 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp

# This file was automatically generated on 2017-06-20 11:07:45 -0400.
# Use the 'puppet generate types' command to regenerate this file.


# foreman_smartproxy registers a smartproxy in foreman.
Puppet::Resource::ResourceType3.new(
'foreman_smartproxy',
[
# The basic property that the resource should be in.
#
# Valid values are `present`, `absent`.
Puppet::Resource::Param(Enum['present','absent'],'ensure'),


# The url of the smartproxy
#
# Values can match `/
# ([a-zA-Z][\-+.a-zA-Z\d]*):   (?# 1: 
scheme)

# (?:
#   
  ((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*)(?# 2: opaque)

# |
#(?:(?:
#  \/\/(?:
# 
  (?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)?(?# 
3: userinfo)
#   
  (?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))? (?# 4: host, 5: port)

#|
#  ((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+)   
   (?# 6: registry)

#)
#  |
#  (?!\/\/))   (?# XXX: '\/\/' is 
the mark for hostport)
# 
  (\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)?(?# 7: path)
#   
  )(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
 (?# 8: query)

# )
# 
(?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
  (?# 9: fragment)

#   /x`.
Puppet::Resource::Param(Pattern[/
 ([a-zA-Z][\-+.a-zA-Z\d]*):   (?# 1: scheme)
 (?:
   
  ((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*)(?# 2: opaque)

 |
(?:(?:
  \/\/(?:
 
  (?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)?(?# 
3: userinfo)
   
  (?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))? (?# 4: host, 5: port)

|
  ((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+) 
 (?# 6: registry)

)
  |
  (?!\/\/))   (?# XXX: '\/\/' is the 
mark for hostport)
 
  (\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)?(?# 7: path)
   
  )(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
 (?# 8: query)

 )
 
(?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
  (?# 9: fragment)

   /],'url')
],
[
# The name of the smartproxy.
Puppet::Resource::Param(Any,'name',true),


# Foreman's base url.
Puppet::Resource::Param(Any,'base_url'),


# Foreman's effective user for the registration (usually admin).
Puppet::Resource::Param(Any,'effective_user'),


# Foreman oauth consumer_key
Puppet::Resource::Param(Any,'consumer_key'),


# Foreman oauth consumer_secret
Puppet::Resource::Param(Any,'consumer_secret'),


# Foreman SSL CA (certificate authority) for verification
Puppet::Resource::Param(Any,'ssl_ca'),


# Timeout for HTTP(s) requests
Puppet::Resource::Param(Any,'timeout'),


# The specific backend to 

Re: [Puppet Users] Puppet works on 41 times out of 43. Help?

2017-06-22 Thread Martin Alfke

> On 22 Jun 2017, at 15:42, jcbollinger  wrote:
> 
> 
> So why not go with that?  The link owner is relevant only to modifying or 
> removing the link itself, and since you're managing it via Puppet, I don't 
> see what purpose it serves to relax the permissions for that.  The link owner 
> and permissions have no relevance to traversing the link (see symlink(7)).

E.g. postgres does not work when the data dir is a link not owned by the 
postgres user

Martin

-- 
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/CF40587E-8E3A-4234-9A5E-987B3D6D52E0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet works on 41 times out of 43. Help?

2017-06-22 Thread jcbollinger


On Thursday, June 22, 2017 at 5:26:41 AM UTC-5, Robert Inder wrote:

I don't understand why the behavior you describe occurs, but I also don't 
understand why you are trying to set the owner of the link in the first 
place, especially if the directory containing it belongs to root.
 

>If I change the manifest to not specify ownership of the link, 
>  it creates a "swindon" link link owned by root.
>

So why not go with that?  The link owner is relevant only to modifying or 
removing the link itself, and since you're managing it via Puppet, I don't 
see what purpose it serves to relax the permissions for that.  The link 
owner and permissions have no relevance to *traversing* the link (see 
symlink(7)).


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/75c11a3f-79b9-4996-b2b2-f5e5c402774a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Bill Sirinek

Here's the file causing the error. I highlighted line 34 of the code, the 
slash at the end is where the error is pointing. Running puppet parser 
validate on the file using the 4.10.x agent does not produce this error, 
but it happens with 4.9.4 (PE 2017.1.1)

root@puppetmaster # puppet parser validate 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp
Error: Could not parse for environment production: Syntax error at '/' at /
etc/puppetlabs/code/environments/foreman115/.resource_types/
foreman_smartproxy.pp:34:37

root@puppetmaster # cat 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp
# This file was automatically generated on 2017-06-20 11:07:45 -0400.
# Use the 'puppet generate types' command to regenerate this file.


# foreman_smartproxy registers a smartproxy in foreman.
Puppet::Resource::ResourceType3.new(
  'foreman_smartproxy',
  [
# The basic property that the resource should be in.
#
# Valid values are `present`, `absent`.
Puppet::Resource::Param(Enum['present', 'absent'], 'ensure'),


# The url of the smartproxy
#
# Values can match `/
# ([a-zA-Z][\-+.a-zA-Z\d]*):   (?# 1: 
scheme)
# (?:
#   
 
((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*)
 
   (?# 2: opaque)
# |
#(?:(?:
#  \/\/(?:
# 
 (?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)?(?# 3: 
userinfo)
#   
 
(?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))?
 
(?# 4: host, 5: port)
#|
#  ((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+)   
  (?# 6: registry)
#)
#  |
#  (?!\/\/))   (?# XXX: '\/\/' is 
the mark for hostport)
# 
 
(\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)?
 
   (?# 7: path)
#   
 )(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
(?# 8: query)
# )
# 
(?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))?   
   (?# 9: fragment)
#   /x`.
Puppet::Resource::Param(Pattern[/
([a-zA-Z][\-+.a-zA-Z\d]*):   (?# 1: scheme)
(?:
  
 
((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*)
 
   (?# 2: opaque)
|
   (?:(?:
 \/\/(?:
 (?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)? 
   (?# 3: userinfo)
  
 
(?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))?
 
(?# 4: host, 5: port)
   |
 ((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+) 
(?# 6: registry)
   )
 |
 (?!\/\/))   (?# XXX: '\/\/' is the 
mark for hostport)

 
(\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*)*)?
 
   (?# 7: path)
  
 )(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? 
(?# 8: query)
)
(?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))?   
   (?# 9: fragment)
  /], 'url')
  ],
  [
# The name of the smartproxy.
Puppet::Resource::Param(Any, 'name', true),


# Foreman's base url.
Puppet::Resource::Param(Any, 'base_url'),


# Foreman's effective user for the registration (usually admin).
Puppet::Resource::Param(Any, 'effective_user'),


# Foreman oauth consumer_key
Puppet::Resource::Param(Any, 'consumer_key'),


# Foreman oauth consumer_secret
Puppet::Resource::Param(Any, 'consumer_secret'),


# Foreman SSL CA (certificate authority) for verification
Puppet::Resource::Param(Any, 'ssl_ca'),


# Timeout for HTTP(s) requests
Puppet::Resource::Param(Any, 'timeout'),


# The specific backend to use for this `foreman_smartproxy`
# 

Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Henrik Lindberg

On 21/06/17 15:24, Bill Sirinek wrote:
I'm trying to set up the foreman_proxy module and getting a syntax error 
related to resource types.




There should be no syntax errors from generated code - unless possibly
using old generated code with a bug in the generator, or using generated 
code from a version that is using syntax not available in an older 
version of puppet.


Please show the content of the generated .pp file to make it possible to 
see what the problem is (it may have been fixed already as we have fixed 
some problems with faulty quoting).


The best is probably to log a ticket in Puppet's Jira with the contents 
of the generated file and the details from this post.


Best,
- henrik

Both the puppet master and the foreman server are running RHEL7.  The 
puppet server and agents are 4.9.4 (PE2017.1.1)


I removed the puppetserver that foreman installed (after foreman was 
done installing) since I had one already.
On the foreman server, I also downgraded puppet-agent from the 4.10.x 
agent to 4.9.4 so it would match all my other agents and puppet master. 
   Keeping the 4.10.x agent on the foreman server still produces this 
error though.


I'm running foreman 1.15.1

The foreman server also houses the smart proxy, dhcp service and tftp 
service.


Related modules and versions that I have installed since working on this:

mod 'puppet/extlib', '1.1.0'
mod 'theforeman/dhcp', '3.1.0'
mod 'theforeman/foreman', '7.2.0'
mod 'theforeman/foreman_proxy', '5.1.0'
mod 'theforeman/tftp', '2.0.0'

Here's some hopefully helpful data:

*Running Puppet:*
|root@foreman115 # puppet agent -tv
Info:Using configured environment 'foreman115'
Info:Retrieving pluginfacts
Info:Retrieving plugin
Info:Loading facts
Error:Couldnot retrieve catalog from remote server:Error500 on 
SERVER:ServerError:Syntaxerror at '/' at 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp:34:37 on 
node foreman115.domain.com 

Warning:Notusing cache on failed catalog
Error:Couldnot retrieve catalog; skipping run|


*Testing this code on the puppetmaster:*

|root@puppetmaster # puppet parser validate 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp 
--environment=foreman115
Error:Couldnot parse forenvironment foreman115:Syntax error at '/' at 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp:34:37|



*Error shown in puppetmaster logs:*

|2017-06-2013:38:17,250 ERROR 
[qtp1388916904-78514][puppetserver]PuppetSyntax error at '/' at 
/etc/puppetlabs/code/environments/foreman115/.resource_types/foreman_smartproxy.pp:34:37 on 
node foreman115.domain.com

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/parser_support.rb:127:in`on_error'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/racc/parser.rb:271:in 
`_racc_evalact'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/racc/parser.rb:189:in 
`_racc_yyparse_rb'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/lexer2.rb:712:in`scan'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/racc/parser.rb:174:in 
`_racc_yyparse_rb'

org/jruby/RubyKernel.java:1242:in `catch'
/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/racc/parser.rb:168:in`_racc_yyparse_rb'
(eval):3:in `yyparse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/parser_support.rb:240:in 
`_parse'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/parser_support.rb:134:in`parse_string'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/parser/evaluating_parser.rb:28:in 
`parse_string'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb:21:in 
`create'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/module_loaders.rb:156:in`find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:142:in 
`internal_load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:32:in 
`load_typed'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/runtime3_type_loader.rb:66:in`find_impl'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/runtime3_type_loader.rb:55:in 
`find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:142:in 
`internal_load'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:32:in`load_typed'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:141:in 
`internal_load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:32:in 
`load_typed'

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:141:in`internal_load'

Re: [Puppet Users] Puppet works on 41 times out of 43. Help?

2017-06-22 Thread Robert Inder


On Wednesday, 21 June 2017 19:17:09 UTC+1, Rob Nelson wrote:
>
> Have you tried to create the link manually to see what happens?
>

By design, the directory containing the link is owned by root, 
because we don't want anybody but root to be able create the link.

And root can use
 ln -s - /var/opt/installation-swindon/JobRequests 
/etc/JobRequests/swindon
to create one of the two links that Puppet is struggling with.

Except that the link it creates is owned by root, and I'm asking puppet to 
create
links owned by (in this case) "swindon".

So I did some tests: 

   If I run puppet with the root-owned "swindon" link in place, 
 puppet changes the ownership to "swindon".
   If I change the manifest to not specify ownership of the link, 
 it creates a "swindon" link link owned by root.
   If I restore the original manifest and remove the "swindon" link, 
 puppet still/again fails with the permissions message
BUT
   If I remove one of the links puppet previously created ("dorset")
 puppet puts it back, owned by "dorset".

So puppet can create links and leave them owned by root.
And it can make existing links owned by some (any?) other user.
But it can't do both at the same time for "swindon".  
Even though it can for "dorset".

Which looks to me like a puppet bug...
 

>
> Also you probably know but Puppet 3 is EOL.
>
If the issue is with puppet itself, rather than perms, it's going to 
> require an upgrade to fix. 
>

Well, an upgrade MIGHT fix it  
But I guess that upgrading is something I'm going to have to  think about 
some time...

Unlikely, but wanted to make sure you're aware. 
>

 

>
> On Wed, Jun 21, 2017 at 1:13 PM Robert Inder  > wrote:
>
>> I'm hoping someone can help me diagnose a problem with 
>> Puppet version 3.8.7 running on CentOS 6.4.
>>
>> I have a couple of servers with a total of 43 web-accessed software 
>> systems, each with its own unix user.
>>
>> These installations are all created from scratch by Puppet, and then 
>> the appropriate version of the software is installed and configured
>> by scripts running as the relevant user.
>>
>> I have just added a new feature, for running background jobs.
>> The feature is enabled for an installation if there is a symlink
>> from /etc/JobRequests to a JobRequests directory in that 
>> installation's home directory.
>>
>> These symlinks are managed by puppet via a "File" resource:
>>
>>   file { "${job_requests::service::dir}/${user}" :
>>   ensure =>  $status ? {
>> 'enabled' => link,
>> default   => absent
>>   },
>>   owner => $user,
>>   target => $queue_dir,
>>   require => [ File[ $job_requests::service::dir ] ]
>>   }
>>
>> For 41 of the 43 users/installations, this does what I expected, 
>> and creates links like these...
>>
>>lrwxrwxrwx 1 norfolk   root 35 May 19 16:03 norfolk -> 
>> /var/opt/installation-norfolk/JobRequests
>>
>> But for two of the thirty users on one of the servers, I get 
>> Error: Could not set 'link' on ensure: 
>> Permission denied - /var/opt/installation-swindon/JobRequests or 
>> /etc/JobRequests/swindon
>> at 60:/etc/puppet/modules/job_requests/manifests/user_files.pp
>>
>> I've tried a couple of the existing links.
>> Puppet puts them back.  
>>
>> But won't create the links for these two installations.
>>
>> Note that the source directory for the link (/etc/JobRequests) is common.
>> And the target directory for all installations is created by the same 
>> puppet manifests.
>> And they all have the same permissions.
>>
>> "WTF?", as they say.
>>
>> Any suggestions how to start tracking this down?
>>
>> Robert.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> 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/9aeb318b-a3be-492d-bc2e-ed7673b32c3e%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/fa808cc2-eb3e-45a1-828d-d044969f2224%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.