# Help on ansible tasks

**URL:** <https://forum.ansible.com/t/help-on-ansible-tasks/23405>\
**Category:** Ansible Project\
**Created:** [January 8, 2017, 12:25am UTC](https://forum.ansible.com/t/help-on-ansible-tasks/23405 "2017-01-08T00:25:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shyam\_Yenna](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Shyam\_Yenna](https://forum.ansible.com/u/Shyam_Yenna)\
**Post date:** [January 8, 2017, 12:25am UTC](https://forum.ansible.com/t/help-on-ansible-tasks/23405/1 "2017-01-08T00:25:49Z")

</div>

Please can someone help as i am having hard time to debug or troubleshoot below ansible module tasks.

I am trying to format an ebs volume attached to an ec2 instance.i am getting below error.

{  
“changed”: false,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“dev”: “/dev/xvdf”,  
“force”: false,  
“fstype”: “ext4”,  
“opts”: “-t”,  
“resizefs”: false  
},  
“module\_name”: “filesystem”  
},  
“msg”: “Device /dev/xvdf not found.”  
}

when i logged into ec2 instance and typed lsblk i can verify xvdf volume attached.

sudo mkfs -t ext4 /dev/xvdf

above is successfully.

Similarly i am encountering unchanged modules  
apt\_key and apt\_repository

- name: PostgreSQL | Add PostgreSQL repository apt-key  
apt\_key:  
id: “{{ postgresql\_apt\_key\_id }}”  
url: “{{ postgresql\_apt\_key\_url }}”  
state: present  
register: apt\_result

- name: PostgreSQL | Add PostgreSQL repository  
apt\_repository:  
repo: “{{ postgresql\_apt\_repository }}”  
state: present  
update\_cache: true  
filename: “postgres”  
when: apt\_result|succeeded  
register: repoadd

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![Shyam\_Yenna](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Shyam\_Yenna](https://forum.ansible.com/u/Shyam_Yenna)\
**Post date:** [January 20, 2017, 4:40pm UTC](https://forum.ansible.com/t/help-on-ansible-tasks/23405/2 "2017-01-20T16:40:28Z")

</div>

I am unsuccessful debugging above things. I appreciate if someone can shed some light into the issue and bring me into light.

I am currently using Ansible 2.2.0 Version installed on ubuntu 16.04 LTS. I am repeatedly running playbook multiple times during entire infrastructure playbook development.which is causing below modules changed flag to false.

apt\_key and apt\_repository

- name: PostgreSQL | Add PostgreSQL repository apt-key  
apt\_key:  
id: “{{ postgresql\_apt\_key\_id }}”  
url: “{{ postgresql\_apt\_key\_url }}”  
state: present  
register: apt\_result

- name: PostgreSQL | Add PostgreSQL repository  
apt\_repository:  
repo: “{{ postgresql\_apt\_repository }}”  
state: present  
update\_cache: true  
filename: “postgres”  
when: apt\_result|succeeded  
register: repoadd

I am successfully when i stand new instance and run first time but no luck after that one.I am suspecting something to do with ansible cache so i have flushed busted cache also.

ansible-playbook playbook.yml --flush-cache

Can someone help me out here as i am stuck in middle of ocean.

---

<div class="post-metadata">

**Author:** ![Shyam\_Yenna](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Shyam\_Yenna](https://forum.ansible.com/u/Shyam_Yenna)\
**Post date:** [January 20, 2017, 10:38pm UTC](https://forum.ansible.com/t/help-on-ansible-tasks/23405/3 "2017-01-20T22:38:12Z")

</div>

I have found my defect…

Thanks for help and Enjoy coding…

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [January 21, 2017, 11:32am UTC](https://forum.ansible.com/t/help-on-ansible-tasks/23405/4 "2017-01-21T11:32:09Z")

</div>

Then why don't you tell us what the problem was? The next one looking  
will be glad...

Johannes
