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
545 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

Set up the necessary tools such as git, chromedriver(selenium), chromium browser(selenium) on the slave node through Ansible

Going through the Devops project. There is ...READ MORE

Feb 9, 2020 in Ansible by anonymous
• 130 points

closed Feb 14, 2020 by Sirajul 1,286 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,458 views
+2 votes
1 answer
–1 vote
2 answers
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
415 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP