Playbook executed fine but output not as expected

0 votes

I have the following yaml file:

---
- hosts: all
  gather_facts: yes
  connection: local
  tasks:
    - name: Check the date on the server.
      action: command touch /opt/b
    - name: cat the Content
      action: command cat /opt/b

It gets executed without any errors but it's supposed to create a file but it hasn't.

Feb 7, 2019 in Ansible by Nisha
478 views

1 answer to this question.

0 votes

Hey @Nisha, you've mentioned this line on your playbook:

connection: local

It means this is getting executed in your local system and hence the file created must be in your local system.

Remove that line and try again. 

answered Feb 7, 2019 by Pragya

Related Questions In Ansible

0 votes
1 answer

ignore_errors : true does not work as expected

Hey @Ali,  You can use the flag ignore_errors ...READ MORE

answered Jan 9, 2019 in Ansible by Lisa
1,585 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

style.css not getting executed while installing lamp stack using ansible

Hey @Kishore make sure, your folder directory ...READ MORE

answered Feb 9, 2019 in Ansible by Monish
740 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,936 views
+2 votes
1 answer
0 votes
1 answer

Ansible playbook with jenkins not working

When you execute the playbook under Jenkins, ...READ MORE

answered Jan 17, 2019 in Ansible by Sameer
3,012 views
0 votes
1 answer
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