User filters - Wildcard against facts

Hi All,

Im fairly new to foreman and I'm sure this should be possible but can't
figure it out. I am setting multiple foreman users and need to filter the
hosts available to them based on hostname. The hostname naming convention
in my company is a bit backwards - hostnames are prefixed with the team
responsible for it, eg test-server1, dev-server1 etc. What i mean is that a
user needs to be restricted to machines called test-* or dev-*, etc.

I'm pretty sure I need to be able to create a filter with wildcards (or
even full on regex) but the only operators available are standard numeric
ones (no 'like' or ~) and I cant find any wildcard characters (ive tried %
and *).

Are wildcards supported? This seems quite a basic feature - Im sure I'm
missing something.

Thanks
Jeff

You are correct, regexs do not seem to be available for fact filters. Feel
free to open a feature request for it.

In the meantime, I'd probably solve this with usergroups - add all the
"test" staff to a "Test" usergroup, and then assign hosts to the "Test"
usergroup - then when you tick "Owned Hosts" they should be able to see the
hosts in the Test group.

HTH,
Greg

··· On 20 August 2013 10:50, Jeff wrote:

Hi All,

Im fairly new to foreman and I’m sure this should be possible but can’t
figure it out. I am setting multiple foreman users and need to filter the
hosts available to them based on hostname. The hostname naming convention
in my company is a bit backwards - hostnames are prefixed with the team
responsible for it, eg test-server1, dev-server1 etc. What i mean is that a
user needs to be restricted to machines called test-* or dev-*, etc.

I’m pretty sure I need to be able to create a filter with wildcards (or
even full on regex) but the only operators available are standard numeric
ones (no ‘like’ or ~) and I cant find any wildcard characters (ive tried %
and *).

Are wildcards supported? This seems quite a basic feature - Im sure I’m
missing something.

Hey,

I think there might be better filter, but this should work too:

name ~ "dev-"

I don't think we support regexp, but this is like LIKE operator.

LZ

··· On Tue, Aug 20, 2013 at 02:50:48AM -0700, Jeff wrote: > Hi All, > > Im fairly new to foreman and I'm sure this should be possible but can't > figure it out. I am setting multiple foreman users and need to filter the > hosts available to them based on hostname. The hostname naming convention > in my company is a bit backwards - hostnames are prefixed with the team > responsible for it, eg test-server1, dev-server1 etc. What i mean is that a > user needs to be restricted to machines called test-* or dev-*, etc. > > I'm pretty sure I need to be able to create a filter with wildcards (or > even full on regex) but the only operators available are standard numeric > ones (no 'like' or ~) and I cant find any wildcard characters (ive tried % > and *). > > Are wildcards supported? This seems quite a basic feature - Im sure I'm > missing something. > > Thanks > Jeff > > -- > 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.


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Done - Feature #2950: User filters - Wildcard against facts - Foreman

Thanks all.
Jeff

··· On Tuesday, 20 August 2013 12:24:31 UTC+1, Greg Sutcliffe wrote: > > On 20 August 2013 10:50, Jeff <je...@potchin.co.uk > wrote: > >> Hi All, >> >> Im fairly new to foreman and I'm sure this should be possible but can't >> figure it out. I am setting multiple foreman users and need to filter the >> hosts available to them based on hostname. The hostname naming convention >> in my company is a bit backwards - hostnames are prefixed with the team >> responsible for it, eg test-server1, dev-server1 etc. What i mean is that a >> user needs to be restricted to machines called test-* or dev-*, etc. >> >> I'm pretty sure I need to be able to create a filter with wildcards (or >> even full on regex) but the only operators available are standard numeric >> ones (no 'like' or ~) and I cant find any wildcard characters (ive tried % >> and *). >> >> Are wildcards supported? This seems quite a basic feature - Im sure I'm >> missing something. >> > > You are correct, regexs do not seem to be available for fact filters. Feel > free to open a feature request for it. >

The User Fact Filters cannot select "~" as a matcher, try it yourself :wink:

··· On 20 August 2013 12:27, Lukas Zapletal wrote:

Hey,

I think there might be better filter, but this should work too:

name ~ “dev-”

Right :slight_smile: I thought - filters - scoped-search - done :slight_smile:

Okay, what Greg says. Also, you may want to enable
Organizations/Locations and use Location for that. I should use "abuse"
word instead Location, but maybe you separate those groups physically as
well.

··· On Tue, Aug 20, 2013 at 12:29:29PM +0100, Greg Sutcliffe wrote: > > name ~ "dev-" > > The User Fact Filters cannot select "~" as a matcher, try it yourself ;)


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Sorry, I must be missing something here. Where is the organisations
configuration? Any documentation?

··· On Tuesday, 20 August 2013 13:17:17 UTC+1, Greg Sutcliffe wrote: > > Actually Organisations is a very good fit here, as users won't see hosts > outside their own Org. Give that a try :) > > Greg >

Actually Organisations is a very good fit here, as users won't see hosts
outside their own Org. Give that a try :slight_smile:

Greg

Best thing is to watch our video tutorial on our videos page. There is
an organization/location video describing everything.

LZ

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

Specifically: http://www.youtube.com/watch?v=aB0Ek-aKmZw

There's nothing in the manual, which is an oversight - Pull Requests are
welcome! (once you've had chance to play with it :P)

··· On 20 August 2013 15:19, Lukas Zapletal wrote:

Best thing is to watch our video tutorial on our videos page. There is
an organization/location video describing everything.

Great stuff. Thanks,

··· On Tue, Aug 20, 2013 at 3:21 PM, Greg Sutcliffe wrote:

On 20 August 2013 15:19, Lukas Zapletal lzap@redhat.com wrote:

Best thing is to watch our video tutorial on our videos page. There is
an organization/location video describing everything.

Specifically: http://www.youtube.com/watch?v=aB0Ek-aKmZw

There’s nothing in the manual, which is an oversight - Pull Requests are
welcome! (once you’ve had chance to play with it :P)


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/XyvIhN9vaXo/unsubscribe.
To unsubscribe from this group and all its topics, 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.