Options:
–order ORDER sort results
–page PAGE paginate results
–per-page PER_PAGE number of entries per request
–search SEARCH filter results
-h, --help print help
$>hammer fact list --search 'fact = operatingsystem' --order 'host asc'
Regards,
Martin
···
On 03/28/2014 03:18 PM, Oleg Mcnoleg wrote:
> Hi,
>
> How do I sort the output when listing facts in hammer?
>
> hammer -u admin -p admin fact list --search "host.hostgroup =
> MYGROUP and fact = operatingsystem" --per-page 100
>
> ------------------------------------------------------
> HOST | FACT | VALUE
> ------------------------------------------------------
> host22.mydomain.com | operatingsystem | RedHat
> host20.mydomain.com | operatingsystem | RedHat
> host18.mydomain.com | operatingsystem | RedHat
> host13.mydomain.com | operatingsystem | RedHat
>
> I would like to sort by hostname so expected output would be:
>
> ------------------------------------------------------
> HOST | FACT | VALUE
> ------------------------------------------------------
> host13.mydomain.com | operatingsystem | RedHat
> host18.mydomain.com | operatingsystem | RedHat
> host20.mydomain.com | operatingsystem | RedHat
> host22.mydomain.com | operatingsystem | RedHat
>
> Is this possible? I'm looking to export facts and hammer fits the
> bill, I just need to be able to sort the output!
>
> Version details are:
>
> foreman-1.4.2-1.el6.noarchrubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
> rubygem-hammer_cli-0.0.18-1.el6.noarch
>
> Thanks,
>
>
> Same for me.
> hammer fact list --search 'fact = operatingsystem' --order 'host asc'
> gives random order.
>
>
Hi Alex,
on my Foreman 1.5 and hammer 0.1.1 it worked as expected. What version
of Foreman and Hammer do you use?
Martin
···
On 06/30/2014 02:58 PM, Alex B wrote:
пятница, 28 марта 2014 г., 18:18:59 UTC+4 пользователь Oleg Mcnoleg > написал:
Hi,
How do I sort the output when listing facts in hammer?
hammer -u admin -p admin fact list --search "host.hostgroup =
MYGROUP and fact = operatingsystem" --per-page 100
------------------------------------------------------
HOST | FACT | VALUE
------------------------------------------------------
host22.mydomain.com <http://host22.mydomain.com> |
operatingsystem | RedHat
host20.mydomain.com <http://host20.mydomain.com> |
operatingsystem | RedHat
host18.mydomain.com <http://host18.mydomain.com> |
operatingsystem | RedHat
host13.mydomain.com <http://host13.mydomain.com> |
operatingsystem | RedHat
I would like to sort by hostname so expected output would be:
------------------------------------------------------
HOST | FACT | VALUE
------------------------------------------------------
host13.mydomain.com <http://host13.mydomain.com> |
operatingsystem | RedHat
host18.mydomain.com <http://host18.mydomain.com> |
operatingsystem | RedHat
host20.mydomain.com <http://host20.mydomain.com> |
operatingsystem | RedHat
host22.mydomain.com <http://host22.mydomain.com> |
operatingsystem | RedHat
Is this possible? I'm looking to export facts and hammer fits the
bill, I just need to be able to sort the output!
Version details are:
foreman-1.4.2-1.el6.noarchrubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
rubygem-hammer_cli-0.0.18-1.el6.noarch
Thanks,
···
понедельник, 30 июня 2014 г., 17:27:09 UTC+4 пользователь Martin Bačovský написал:
>
> On 06/30/2014 02:58 PM, Alex B wrote:
>
> Same for me.
> hammer fact list --search 'fact = operatingsystem' --order 'host asc'
> gives random order.
>
>
> Hi Alex,
>
> on my Foreman 1.5 and hammer 0.1.1 it worked as expected. What version of
> Foreman and Hammer do you use?
>
> Martin
>
> пятница, 28 марта 2014 г., 18:18:59 UTC+4 пользователь Oleg Mcnoleg > написал:
>>
>> Hi,
>>
>> How do I sort the output when listing facts in hammer?
>>
>> hammer -u admin -p admin fact list --search "host.hostgroup = MYGROUP
>> and fact = operatingsystem" --per-page 100
>>
>> ------------------------------------------------------
>> HOST | FACT | VALUE
>> ------------------------------------------------------
>> host22.mydomain.com | operatingsystem | RedHat
>> host20.mydomain.com | operatingsystem | RedHat
>> host18.mydomain.com | operatingsystem | RedHat
>> host13.mydomain.com | operatingsystem | RedHat
>>
>> I would like to sort by hostname so expected output would be:
>>
>> ------------------------------------------------------
>> HOST | FACT | VALUE
>> ------------------------------------------------------
>> host13.mydomain.com | operatingsystem | RedHat
>> host18.mydomain.com | operatingsystem | RedHat
>> host20.mydomain.com | operatingsystem | RedHat
>> host22.mydomain.com | operatingsystem | RedHat
>>
>> Is this possible? I'm looking to export facts and hammer fits the bill,
>> I just need to be able to sort the output!
>>
>> Version details are:
>>
>> foreman-1.4.2-1.el6.noarchrubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
>> rubygem-hammer_cli-0.0.18-1.el6.noarch
>>
>> Thanks,
>>
>>
>> --
> 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-user...@googlegroups.com .
> To post to this group, send email to forema...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>
>
>