Issues in creating AWS EFS via Ansible

124 views
Skip to first unread message

Pravin Patil

unread,
Sep 7, 2018, 1:05:26 AM9/7/18
to Ansible Project
I am creating a playbook to create a EFS in AWS, using Ansible, but running into errors.
Please suggest how to resolve this error.

Below is my ansible script:
---
- hosts: localhost
  vars:
    efs_name: "{{efs_name}}"
    efs_tagname: "{{efs_tagname}}"
    efs_purpose: "{{efs_purpose}}"
    subnet_id: "{{subnet_id}}"
    security_groups: "{{security_groups}}"
  tasks:
  - name: create new EFS instance, named "{{efs_name}}"
    efs:
      state: present
      name: "{{efs_name}}"
      tags:
         name: "{{efs_tagname}}"
         purpose: "{{efs_purpose}}"
      targets:
         - subnet_id: "{{subnet_id}}"
           security_groups: [ "{{security_groups}}" ]

Below is the error:
PLAY [localhost] ***************************************************************
10:12:12
15
16
TASK [Gathering Facts] *********************************************************
10:12:12
17
task path: /home/centos/Playbooks/create_efs.yml:2
10:12:12
18
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
19
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: awx
20
<127.0.0.1> EXEC /bin/bash -c 'sudo -H -S -n -u root /bin/bash -c '"'"'echo BECOME-SUCCESS-vakpgtumskvfocaolgincjmyyehhkfaq; /usr/bin/python2'"'"' && sleep 0'
21
fatal: [localhost]: FAILED! => {
22
"changed": false,
23
"module_stderr": "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?\n",
24
"module_stdout": "",
25
"msg": "MODULE FAILURE",
26
"rc": 1
27
}
28
29
PLAY RECAP *********************************************************************
10:12:12
30
localhost : ok=0 changed=0 unreachable=0 failed=1

Karl Auer

unread,
Sep 8, 2018, 10:44:27 AM9/8/18
to ansible-project
This looks as if you are trying to connect to your own host using ssh in order to run your playbook. This is almost certainly not necessary - add these lines after your "hosts" line,making sure to get the indentation right:

  become: false
  gather_facts: false

The first line says not to try to become root, the second line just saves some time because you are not interested in your local system. If you need to use environment variables or anything else on your local system, remove that line.

By the way, this problem has nothing to do with EFS!

Regards, K


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c6bcbcf2-731b-450b-aba6-4a756fb1eb37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Karl Auer

Email  : ka...@2pisoftware.com
Website: 
http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

Jonathan Lozada De La Matta

unread,
Sep 8, 2018, 11:11:44 AM9/8/18
to ansible...@googlegroups.com
you might also need to add connection: local

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.




--
Karl Auer

Email  : ka...@2pisoftware.com
Website: 
http://2pisoftware.com

GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08SDmUJzuN%3DSTeTdwRW18GV7fY7QfE7rt5cpJbaJ_xumfg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
--

Jonathan lozada de la matta

AUTOMATION PRACTICE



 

Pravin Patil

unread,
Sep 12, 2018, 2:31:06 PM9/12/18
to Ansible Project
Thankyou Karl and Jonathan.
The issue is now resolved. It was issue with missing permissions of the role associated to perform these actions.
Reply all
Reply to author
Forward
0 new messages