Re: [mcollective-users] mco query with nested facts filter

2017-03-20 Thread rakare2015
in facter 1.6.7,

we are getting facts output as below,

uptime => 135 days
uptime_days => 135
uptime_hours => 3259
uptime_seconds => 11735064

so we can use this as facts filter in mco query.

On Tuesday, March 21, 2017 at 10:31:08 AM UTC+5:30, michael.smith wrote:
>
>
>
> On Mon, Mar 20, 2017 at 9:07 PM  wrote:
>
>> yes please.
>>
>> Michael,
>>
>> By downgrading I can get facts in non nested structure and can be used to 
>> with mco query facts filter.
>>
>>
> $ facter --version
> 2.4.6
> $ facter
> ...
> system_uptime => {"seconds"=>3672217, "hours"=>1020, "days"=>42, 
> "uptime"=>"42 days"}
> timezone => PDT
> uptime => 42 days
> uptime_days => 42
> uptime_hours => 1020
> uptime_seconds => 3672217
> virtual => physical
>
> How is that not what you want already? The uptime facts are still there in 
> the output. I might be missing something about how the mco facts query 
> works, but it should still be queryable.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-20 Thread Michael Smith
On Mon, Mar 20, 2017 at 9:07 PM  wrote:

> yes please.
>
> Michael,
>
> By downgrading I can get facts in non nested structure and can be used to
> with mco query facts filter.
>
>
$ facter --version
2.4.6
$ facter
...
system_uptime => {"seconds"=>3672217, "hours"=>1020, "days"=>42,
"uptime"=>"42 days"}
timezone => PDT
uptime => 42 days
uptime_days => 42
uptime_hours => 1020
uptime_seconds => 3672217
virtual => physical

How is that not what you want already? The uptime facts are still there in
the output. I might be missing something about how the mco facts query
works, but it should still be queryable.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-20 Thread rakare2015
yes please.

Michael,

By downgrading I can get facts in non nested structure and can be used to 
with mco query facts filter.



On Wednesday, March 15, 2017 at 11:58:37 PM UTC+5:30, R.I.Pienaar wrote:
>
>
>
> On Wed, Mar 15, 2017, at 18:48, Michael Smith wrote: 
> > PUP-6040  was talking 
> > about 
> > using this for 'puppet facts'. 
> > 
>
> #puppet-dev gave some .pp code to do it, easy to port 
> https://puppetcommunity.slack.com/files/thrnio/F4JCD81L2/-.pp 
>
> I'll consider doing something along this line :) 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-15 Thread R.I.Pienaar


On Wed, Mar 15, 2017, at 18:48, Michael Smith wrote:
> PUP-6040  was talking
> about
> using this for 'puppet facts'.
> 

#puppet-dev gave some .pp code to do it, easy to port
https://puppetcommunity.slack.com/files/thrnio/F4JCD81L2/-.pp

I'll consider doing something along this line :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-15 Thread Michael Smith
PUP-6040  was talking about
using this for 'puppet facts'.

On Tue, Mar 14, 2017 at 11:11 AM Michael Smith 
wrote:

> On Tue, Mar 14, 2017 at 11:07 AM R.I.Pienaar  wrote:
>
>
>
> On Tue, Mar 14, 2017, at 18:59, Michael Smith wrote:
> > That flattened view matches approaches we've discussed using elsewhere.
> > That certainly seems reasonable.
>
> yeah and facter.soon will have a flattened output of its own too
>
> with all the tools more or less supporting this I wonder if there's
> already somewhere in puppet some ruby code to flatten a hash this way?
> Do you know of any?
>
> Seems tedious to write :) especial with array handling and all
>
>
> I'm not aware of anything yet. Might be worth a quick ask in a Slack
> channel.
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mcollective-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-14 Thread R.I.Pienaar


On Tue, Mar 14, 2017, at 18:59, Michael Smith wrote:
> That flattened view matches approaches we've discussed using elsewhere.
> That certainly seems reasonable.

yeah and facter.soon will have a flattened output of its own too

with all the tools more or less supporting this I wonder if there's
already somewhere in puppet some ruby code to flatten a hash this way?
Do you know of any?

Seems tedious to write :) especial with array handling and all

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-14 Thread Michael Smith
That flattened view matches approaches we've discussed using elsewhere.
That certainly seems reasonable.

On Tue, Mar 14, 2017 at 10:57 AM R.I.Pienaar  wrote:

>
>
> On Tue, Mar 14, 2017, at 18:49, Michael Smith wrote:
> > I'm not sure how downgrading addresses your issue. Downgrading Facter
> > version will just remove the new structured facts, but none of the old
> > facts are missing in Facter 2.4.6. You can still query uptime_days,
> > uptime_hours, uptime_seconds.
>
> I've considered suporting a flattened view of nested facts so the
> facts.yaml
> would hold:
>
> os.architecture: x86_64
> os.distro.codename: Core
> os.distro.id: CentOS
>
> etc
>
> and then all the current CLI stuff will just work, this certainly seems
> a lot
> less crazy than current way of using these
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mcollective-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-14 Thread Michael Smith
I'm not sure how downgrading addresses your issue. Downgrading Facter
version will just remove the new structured facts, but none of the old
facts are missing in Facter 2.4.6. You can still query uptime_days,
uptime_hours, uptime_seconds.

On Mon, Mar 13, 2017 at 10:09 AM Ravi Kumar  wrote:

> np. Is there any way with this one without doing downgrade?
>
> On Mon, Mar 13, 2017 at 10:31 PM, Michael Smith 
> wrote:
>
>
>
> On Sat, Mar 11, 2017 at 11:36 PM  wrote:
>
> Am using facter version 2.4.6 and it says invalid option.
>
> [root@mco-console ~]# facter --show-legacy
> invalid option: --show-legacy
> [root@mco-console ~]# facter --version
> 2.4.6
> [root@mco-console ~]#
>
> Ah, I should've been specific that I meant Facter 3. uptime_hours,
> uptime_days, and uptime_seconds should exist for what you were asking about.
>
>
>
> Regards
> Ravi
>
>
> On Sunday, March 12, 2017 at 12:36:08 PM UTC+5:30, michael.smith wrote:
>
> The latest Facter includes all facts from Facter 2. You may need to use
> 'facter --show-legacy' to print them all.
>
> Michael
>
> > On Mar 11, 2017, at 22:59, R.I.Pienaar  wrote:
>
> >
> >
> >
> >> On Sun, Mar 12, 2017, at 07:50, rakar...@gmail.com wrote:
> >> ohh.. Then I may have to downgrade the facter to little lower version
> >> make
> >> use of all the facts through mcollective.
> >>
> >> Do you think any solution for this with the latest facts version with
> >> nested structure? If not then the only way to downgrade it.
> >
> > depends how you save facts, legacy facts are still there.
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google
> Groups "mcollective-users" group.
>
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to mcollective-us...@googlegroups.com.
>
> > For more options, visit https://groups.google.com/d/optout.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mcollective-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "mcollective-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mcollective-users/ka8KwB8BNyc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> mcollective-users+unsubscr...@googlegroups.com.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mcollective-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-13 Thread Ravi Kumar
np. Is there any way with this one without doing downgrade?

On Mon, Mar 13, 2017 at 10:31 PM, Michael Smith 
wrote:

>
>
> On Sat, Mar 11, 2017 at 11:36 PM  wrote:
>
>> Am using facter version 2.4.6 and it says invalid option.
>>
>> [root@mco-console ~]# facter --show-legacy
>> invalid option: --show-legacy
>> [root@mco-console ~]# facter --version
>> 2.4.6
>> [root@mco-console ~]#
>>
>> Ah, I should've been specific that I meant Facter 3. uptime_hours,
> uptime_days, and uptime_seconds should exist for what you were asking about.
>
>
>>
>> Regards
>> Ravi
>>
>>
>> On Sunday, March 12, 2017 at 12:36:08 PM UTC+5:30, michael.smith wrote:
>>
>> The latest Facter includes all facts from Facter 2. You may need to use
>> 'facter --show-legacy' to print them all.
>>
>> Michael
>>
>> > On Mar 11, 2017, at 22:59, R.I.Pienaar  wrote:
>>
>> >
>> >
>> >
>> >> On Sun, Mar 12, 2017, at 07:50, rakar...@gmail.com wrote:
>> >> ohh.. Then I may have to downgrade the facter to little lower version
>> >> make
>> >> use of all the facts through mcollective.
>> >>
>> >> Do you think any solution for this with the latest facts version with
>> >> nested structure? If not then the only way to downgrade it.
>> >
>> > depends how you save facts, legacy facts are still there.
>> >
>> > --
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups "mcollective-users" group.
>>
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to mcollective-us...@googlegroups.com.
>>
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "mcollective-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mcollective-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "mcollective-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/mcollective-users/ka8KwB8BNyc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mcollective-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-13 Thread Michael Smith
On Sat, Mar 11, 2017 at 11:36 PM  wrote:

> Am using facter version 2.4.6 and it says invalid option.
>
> [root@mco-console ~]# facter --show-legacy
> invalid option: --show-legacy
> [root@mco-console ~]# facter --version
> 2.4.6
> [root@mco-console ~]#
>
> Ah, I should've been specific that I meant Facter 3. uptime_hours,
uptime_days, and uptime_seconds should exist for what you were asking about.


>
> Regards
> Ravi
>
>
> On Sunday, March 12, 2017 at 12:36:08 PM UTC+5:30, michael.smith wrote:
>
> The latest Facter includes all facts from Facter 2. You may need to use
> 'facter --show-legacy' to print them all.
>
> Michael
>
> > On Mar 11, 2017, at 22:59, R.I.Pienaar  wrote:
>
> >
> >
> >
> >> On Sun, Mar 12, 2017, at 07:50, rakar...@gmail.com wrote:
> >> ohh.. Then I may have to downgrade the facter to little lower version
> >> make
> >> use of all the facts through mcollective.
> >>
> >> Do you think any solution for this with the latest facts version with
> >> nested structure? If not then the only way to downgrade it.
> >
> > depends how you save facts, legacy facts are still there.
> >
> > --
> >
> > ---
> > You received this message because you are subscribed to the Google
> Groups "mcollective-users" group.
>
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to mcollective-us...@googlegroups.com.
>
> > For more options, visit https://groups.google.com/d/optout.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mcollective-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-11 Thread rakare2015
Am using facter version 2.4.6 and it says invalid option.

[root@mco-console ~]# facter --show-legacy
invalid option: --show-legacy
[root@mco-console ~]# facter --version
2.4.6
[root@mco-console ~]#


Regards
Ravi


On Sunday, March 12, 2017 at 12:36:08 PM UTC+5:30, michael.smith wrote:
>
> The latest Facter includes all facts from Facter 2. You may need to use 
> 'facter --show-legacy' to print them all. 
>
> Michael 
>
> > On Mar 11, 2017, at 22:59, R.I.Pienaar  
> wrote: 
> > 
> > 
> > 
> >> On Sun, Mar 12, 2017, at 07:50, rakar...@gmail.com  
> wrote: 
> >> ohh.. Then I may have to downgrade the facter to little lower version 
> >> make 
> >> use of all the facts through mcollective. 
> >> 
> >> Do you think any solution for this with the latest facts version with 
> >> nested structure? If not then the only way to downgrade it. 
> > 
> > depends how you save facts, legacy facts are still there. 
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "mcollective-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to mcollective-us...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-11 Thread R.I.Pienaar


On Sun, Mar 12, 2017, at 07:50, rakare2...@gmail.com wrote:
> ohh.. Then I may have to downgrade the facter to little lower version
> make 
> use of all the facts through mcollective.
> 
> Do you think any solution for this with the latest facts version with 
> nested structure? If not then the only way to downgrade it. 

depends how you save facts, legacy facts are still there.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-11 Thread rakare2015
ohh.. Then I may have to downgrade the facter to little lower version make 
use of all the facts through mcollective.

Do you think any solution for this with the latest facts version with 
nested structure? If not then the only way to downgrade it. 


Regards
Ravi

On Sunday, March 12, 2017 at 11:42:13 AM UTC+5:30, R.I.Pienaar wrote:
>
>
>
> On 12 Mar 2017, at 02:27, rakar...@gmail.com  wrote:
>
> hmmm. so you meant to say there is no way to filter with nested facts 
> right? 
>
> But found something on https://tickets.puppetlabs.com/browse/MCO-363 and 
> not sure if this something what am expecting. 
>
>
>
> You can with some -S query. I don't think it's usable. 
>
>
>
>
> Thanks
> Ravi 
>
> On Saturday, March 11, 2017 at 11:25:24 PM UTC+5:30, R.I.Pienaar wrote:
>>
>>
>>
>> On 11 Mar 2017, at 18:39, rakar...@gmail.com wrote:
>>
>> Hi,
>>
>> In the latest facter version I see the facts value format is nested like 
>> below,
>>
>> system_uptime => {"uptime"=>"415 days", "days"=>415, "seconds"=>35903914, 
>> "hours"=>9973}
>>
>> But how can we do this facts based filter with mco query when we have 
>> nested format. For example if I want to perform facts filter with "days" in 
>> "system_uptime" facts how can we run mco query?
>>
>>
>> Puppet labs did not really implement these in a usable manner in 
>> mcollective. 
>>
>>
>>
>>
>> Thanks
>> Ravi
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "mcollective-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mcollective-us...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mcollective-us...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mcollective-users] mco query with nested facts filter

2017-03-11 Thread rakare2015
hmmm. so you meant to say there is no way to filter with nested facts 
right? 

But found something on https://tickets.puppetlabs.com/browse/MCO-363 and 
not sure if this something what am expecting. 


Thanks
Ravi 

On Saturday, March 11, 2017 at 11:25:24 PM UTC+5:30, R.I.Pienaar wrote:
>
>
>
> On 11 Mar 2017, at 18:39, rakar...@gmail.com  wrote:
>
> Hi,
>
> In the latest facter version I see the facts value format is nested like 
> below,
>
> system_uptime => {"uptime"=>"415 days", "days"=>415, "seconds"=>35903914, 
> "hours"=>9973}
>
> But how can we do this facts based filter with mco query when we have 
> nested format. For example if I want to perform facts filter with "days" in 
> "system_uptime" facts how can we run mco query?
>
>
> Puppet labs did not really implement these in a usable manner in 
> mcollective. 
>
>
>
>
> Thanks
> Ravi
>
> -- 
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "mcollective-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mcollective-us...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"mcollective-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mcollective-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.