Question related to ignored_environments.yml

I've currently got my ignored_environments.yml configured as follows:

:filters:

  • !ruby/regexp '/install$/'
  • !ruby/regexp '/params$/'
  • !ruby/regexp '/config$/'
  • !ruby/regexp '/package$/'
  • !ruby/regexp '/service$/'

This is working great, except I ran into an edge case where I'm trying to
use the puppetdb module provided by puppetlabs. I need to assign the class
puppetdb::master::config to my puppet master, but since I'm filtering out
'/config$/' that class doesn't get imported into foreman. Is there any way
to have foreman NOT filter out that one specific class?

I tried several different things and looked
at /usr/share/foreman/app/models/puppet_class_importer.rb, but nothing
stuck out as the solution.

Could just be that it's Friday afternoon :slight_smile:

Anyone have a suggestion/solution?

It's just a standard ruby regular expression, so this s untested but
something like:

/(?!puppetdb::master::)config/

might work?

Thanks for the suggestion Greg. Unfortunately it didn't work.

After playing around with it a bit more, it seems like I need a lookbehind.

The following regex works:

(?<!puppetdb::master::)config$

Unfortunately, it appears that lookbehinds weren't introduced until ruby
1.9, and since I'm running RHEL 6, I only have ruby 1.8.7.

Any other suggestions?

I've sort of worked around it for now by using the following regex:

/^(?:\w*::)config$/

But this has an undesired effect of only matching classname::config exactly.

··· On Friday, June 14, 2013 4:39:28 PM UTC-4, Greg Sutcliffe wrote: > > It's just a standard ruby regular expression, so this s untested but > something like: > > /(?!puppetdb::master::)config/ > > might work? >

I realise this doesn't immediately help, but for 1.2 we're using
software collections (SCL) to provide Ruby 1.9, so hopefully that regex
technique will work then.

··· On 17/06/13 22:10, Andy Bohne wrote: > Thanks for the suggestion Greg. Unfortunately it didn't work. > > After playing around with it a bit more, it seems like I need a lookbehind. > > The following regex works: > > (? > Unfortunately, it appears that lookbehinds weren't introduced until ruby > 1.9, and since I'm running RHEL 6, I only have ruby 1.8.7.


Dominic Cleal
Red Hat Engineering

Thanks Dominic, I can probably live with this limitation until 1.2 is
released. I assume this is not too far off?

··· On Tuesday, June 18, 2013 3:20:04 AM UTC-4, Dominic Cleal wrote: > > On 17/06/13 22:10, Andy Bohne wrote: > > Thanks for the suggestion Greg. Unfortunately it didn't work. > > > > After playing around with it a bit more, it seems like I need a > lookbehind. > > > > The following regex works: > > > > (? > > > Unfortunately, it appears that lookbehinds weren't introduced until ruby > > 1.9, and since I'm running RHEL 6, I only have ruby 1.8.7. > > I realise this doesn't immediately help, but for 1.2 we're using > software collections (SCL) to provide Ruby 1.9, so hopefully that regex > technique will work then. > > -- > Dominic Cleal > Red Hat Engineering >

Indeed, we're trying to get a few issues sorted for RC3, so that should
be this week. I don't think there's a need for another RC, so if that's
good, we'll release the final version soon after.

··· -- Dominic Cleal Red Hat Engineering

On 18/06/13 16:57, Andy Bohne wrote:

Thanks Dominic, I can probably live with this limitation until 1.2 is
released. I assume this is not too far off?

On Tuesday, June 18, 2013 3:20:04 AM UTC-4, Dominic Cleal wrote:

On 17/06/13 22:10, Andy Bohne wrote:
> Thanks for the suggestion Greg.  Unfortunately it didn't work.
>
> After playing around with it a bit more, it seems like I need a
lookbehind.
>
> The following regex works:
>
> (?<!puppetdb::master::)config$
>
> Unfortunately, it appears that lookbehinds weren't introduced
until ruby
> 1.9, and since I'm running RHEL 6, I only have ruby 1.8.7.

I realise this doesn't immediately help, but for 1.2 we're using
software collections (SCL) to provide Ruby 1.9, so hopefully that regex
technique will work then.

-- 
Dominic Cleal
Red Hat Engineering


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.