Re: [ansible-project] ActiveState of a systemd service

2021-12-28 Thread Dick Visser
I meant: - debug: var=hello|json_query('results[].status.ActiveState') On Tue, 28 Dec 2021 at 03:31, Thomas Stephen Lee wrote: > > Hi @Dick Visser, > > That gives the below output. > > -%<- > > TASK [debug] > *

Re: [ansible-project] ActiveState of a systemd service

2021-12-28 Thread Thomas Stephen Lee
Hi @Dick Visser, That gives the below output. -%<- TASK [debug] *** ok: [localhost] => { "hello|json_query('results[].status.ActiveState')": [ "active", "active", "active"

Re: [ansible-project] ActiveState of a systemd service

2021-12-28 Thread Dick Visser
I believe this is what you wanted - right? On Tue, 28 Dec 2021 at 12:58, Thomas Stephen Lee wrote: > > Hi @Dick Visser, > > That gives the below output. > > -%<- > > TASK [debug] > *** > ok: [localhos

Re: [ansible-project] Need to understand how I can write a ansible role so that it compares input / output value.

2021-12-28 Thread Mauricio Tavares
var On Mon, Dec 27, 2021 at 11:58 PM Marian Saldhana wrote: > > Hi All, > > This is my code: > > --- > # tasks file for uname > > - name: Kernel version number > register: uname_a > command: "uname -a" > > - debug: > var: uname_a.stdout_lines > > +++ > > TAS

Re: [ansible-project] ActiveState of a systemd service

2021-12-28 Thread Thomas Stephen Lee
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_q

[ansible-project] Extract nmon

2021-12-28 Thread Kannappan M
Hi all, >From my ansible user I was trying to fetch the nmon files (root owned) but throwed me error even though I have mentioned as become: yes. Now if I run the same playbook using root user ,my task is getting completed but I need to perform this task using ansible user not as root user. On Tue

Re: [ansible-project] Extract nmon

2021-12-28 Thread Dick Visser
Then your privilege escalation is not set up correctly. You should fix that. But since you just mention the opaque "throwed me error" it's mostly a guess. On Wed, 29 Dec 2021 at 07:26, Kannappan M wrote: > Hi all, > From my ansible user I was trying to fetch the nmon files (root owned) but > t