Help on ansible tasks

99 views
Skip to first unread message

Shyam Yenna

unread,
Jan 8, 2017, 2:08:07 PM1/8/17
to Ansible Project
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

 

Shyam Yenna

unread,
Jan 20, 2017, 1:10:20 PM1/20/17
to Ansible Project
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.


Shyam Yenna

unread,
Jan 20, 2017, 5:38:13 PM1/20/17
to Ansible Project
I have found my defect.....

Thanks for help and Enjoy coding...

Johannes Kastl

unread,
Jan 21, 2017, 6:32:20 AM1/21/17
to ansible...@googlegroups.com
On 20.01.17 23:38 Shyam Yenna wrote:
> I have found my defect.....
>
> Thanks for help and Enjoy coding...

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

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages