User on the target VM - Ansible

0 votes
I want to check the user name/id of the target vm in my ansible set up. Is that possible?
Jan 28, 2019 in Ansible by Nisha
55 views

1 answer to this question.

0 votes

Yes @Nisha, You can run a shell command and the print the output. Use a yaml file like this:

  - name: "Run shell command"
    shell: /usr/bin/id
    register: result

  - name: Print the value of result
    debug: var=result
answered Jan 28, 2019 by Kavya

Related Questions In Ansible

0 votes
1 answer
+1 vote
3 answers
0 votes
1 answer
0 votes
0 answers
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
497 views
0 votes
1 answer
0 votes
1 answer

Install Ansible on centOS

Hey @Ali, Installing Ansible is a piece ...READ MORE

answered Jan 8, 2019 in Ansible by Kiara
70 views