Hi,

My current status is attached.
Very hackish and not 100% Ansible.
It takes 1/2 hour to complete.
Any suggestions are welcome.

Thanks a lot.

---
Lee

On Wed, Dec 29, 2021 at 11:00 AM Thomas Stephen Lee <[email protected]> wrote:
>
> Hi @Dick Visser,
>
> In my code, I wrote only for the state value, but I also wanted the
> name value of the service.
> I thought I would figure out the name part once I get the state part working.
>
> My current status is
>
> -----------------%<-----------------
>     debug:
>       msg: "{{ hello.results |
> json_query('[?status.ActiveState!=`active`].{name: name, state:
> status.ActiveState}') | to_nice_json }}"
> -----------------%<-----------------
>
> Thanks a lot.
>
> ---
> Lee
>
> On Tue, Dec 28, 2021 at 6:00 PM Dick Visser <[email protected]> wrote:
> >
> > I believe this is what you wanted - right?
> >
> > On Tue, 28 Dec 2021 at 12:58, Thomas Stephen Lee <[email protected]> wrote:
> > >
> > > Hi @Dick Visser,
> > >
> > > That gives the below output.
> > >
> > > -----------------%<-----------------
> > >
> > > TASK [debug] 
> > > *******************************************************************
> > > ok: [localhost] => {
> > >     "hello|json_query('results[].status.ActiveState')": [
> > >         "active",
> > >         "active",
> > >         "active"
> > >     ]
> > > }
> > >
> > > -----------------%<-----------------
> > >
> > > I will explore more, thanks a lot.
> > >
> > > ---
> > > Lee
> > >
> > > On Tue, Dec 28, 2021 at 4:56 PM Dick Visser <[email protected]> wrote:
> > > >
> > > > I meant:
> > > >
> > > > - debug: var=hello|json_query('results[].status.ActiveState')
> > > >
> > > >
> > > > On Tue, 28 Dec 2021 at 03:31, Thomas Stephen Lee <[email protected]> 
> > > > wrote:
> > > > >
> > > > > Hi @Dick Visser,
> > > > >
> > > > > That gives the below output.
> > > > >
> > > > > -----------------%<-----------------
> > > > >
> > > > > TASK [debug] 
> > > > > *******************************************************************
> > > > > ok: [localhost] => {
> > > > >     "results|json_query('[].status.ActiveState')": ""
> > > > > }
> > > > >
> > > > > -----------------%<-----------------
> > > > >
> > > > >
> > > > > Thanks
> > > > >
> > > > > ---
> > > > > Lee
> > > > >
> > > > > On Tue, Dec 28, 2021 at 1:37 AM Dick Visser <[email protected]> 
> > > > > wrote:
> > > > > >
> > > > > > On Mon, 27 Dec 2021 at 07:32, Thomas Stephen Lee 
> > > > > > <[email protected]> wrote:
> > > > > >
> > > > > > >   - debug:
> > > > > > >       msg: "{{ hello.results | to_nice_json |
> > > > > > > json_query('status.ActiveState') }}"
> > > > > >
> > > > > > the result var is a list, so if you want a list of a specific key:
> > > > > >
> > > > > >
> > > > > > - debug: var=results|json_query('[].status.ActiveState')
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Dick Visser
> > > > > > Trust & Identity Service Operations Manager
> > > > > > GÉANT
> > > > > >
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google 
> > > > > > Groups "Ansible Project" group.
> > > > > > To unsubscribe from this group and stop receiving emails from it, 
> > > > > > send an email to [email protected].
> > > > > > To view this discussion on the web visit 
> > > > > > https://groups.google.com/d/msgid/ansible-project/CAL8fbwNzq_4RhS4rtsTxHhWbPq8SRBMM3_1hpV30mHMFyp6sFA%40mail.gmail.com.
> > > > >
> > > > > --
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups "Ansible Project" group.
> > > > > To unsubscribe from this group and stop receiving emails from it, 
> > > > > send an email to [email protected].
> > > > > To view this discussion on the web visit 
> > > > > https://groups.google.com/d/msgid/ansible-project/CAG7s96VGmsZ8OEhoNFtuEr4q1dmrK0pd6pKGpsspwCi4WQgjxg%40mail.gmail.com.
> > > > >
> > > >
> > > >
> > > > --
> > > > Dick Visser
> > > > Trust & Identity Service Operations Manager
> > > > GÉANT
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "Ansible Project" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send 
> > > > an email to [email protected].
> > > > To view this discussion on the web visit 
> > > > https://groups.google.com/d/msgid/ansible-project/CAL8fbwOQZTegyfbzNwr1gZY0i_6g_4femX91-k7uAsqx3R8qGA%40mail.gmail.com.
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Ansible Project" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to [email protected].
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/ansible-project/CAG7s96VmOhOVO7xMdFGnZ_WnfeDZV36LwZNn1OLwG%2BVp%3Duhcqw%40mail.gmail.com.
> > >
> >
> >
> > --
> > Dick Visser
> > Trust & Identity Service Operations Manager
> > GÉANT
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to [email protected].
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/ansible-project/CAL8fbwMn%2Bh%3D_f-aGUn9SmJCaYkKkjaKO6zN%2BJqN1gmWUcbAhWw%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG7s96URLx%2Bym_%3DnrNG-i7qH7g-8zRrWsSyPqE%3D6mqDoHDO4BA%40mail.gmail.com.

Attachment: get.services.list.yml
Description: application/yaml

Reply via email to