Create AWS EFS

27 views
Skip to first unread message

Sandy Hung

unread,
Mar 25, 2020, 3:07:30 AM3/25/20
to Ansible Project
Dear All:

I have create efs ansible , I have install boto3 
this is show error msg 

this is my ansible
---
 - hosts: localhost
   connection: local
   gather_facts: no

   vars_files:
      - ec2key.yml

   tasks:

       - name: Create EFS
         efs:
           state: present
           region: ap-southeast-1
           name: "xxxx_efs"
           tags:
             Name: “efs_test”
           targets:
             - subnet_id: subnet-xxxxx
               security_groups: sg-xxxxxxxxxxxxx


"The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_efs_payload_B4LtA0/ansible_efs_payload.zip/ansible/modules/cloud/amazon/efs.py", line 226, in <module>

fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "aws_access_key": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "ec2_url": null,
            "encrypt": false,
            "id": null,
            "kms_key_id": null,
            "name": "abagile_efs",
            "performance_mode": "general_purpose",
            "profile": null,
            "provisioned_throughput_in_mibps": null,
            "purge_tags": true,
            "region": "ap-southeast-1",
            "security_token": null,
            "state": "present",
            "tags": {
                "Name": "“efs_test”"
            },
            "targets": [
                {
                    "security_groups": "sg-073c16c36bea62794",
                    "subnet_id": "subnet-46817120"
                }
            ],
            "throughput_mode": null,
            "validate_certs": true,
            "wait": false,
            "wait_timeout": 0
        }
    },
    "msg": "boto3 required for this module"
} "

Dick Visser

unread,
Mar 25, 2020, 3:36:34 AM3/25/20
to ansible...@googlegroups.com
It means that your boto3 is not available to ansible. 
Wrong location? Different venv?

What does 'ansible --version' say?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/51cf9f5f-af7f-4688-8e59-f5d708595b8c%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Sandy Hung

unread,
Mar 25, 2020, 3:52:43 AM3/25/20
to Ansible Project
ansible 2.9.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ldap/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Nov  7 2019, 10:07:09) [GCC 7.4.0]

Dick Visser

unread,
Mar 25, 2020, 4:02:54 AM3/25/20
to ansible...@googlegroups.com
How exactly did you install boto3?
As what user etc


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

sandy...@abagile.com

unread,
Mar 25, 2020, 4:18:40 AM3/25/20
to ansible...@googlegroups.com

In user  ldap  should be use “root”

Use command line

sudo apt-get install pip3

sudo pip3 install boto3

 

 

BR

Sandy

Stefan Hornburg (Racke)

unread,
Mar 25, 2020, 4:22:54 AM3/25/20
to ansible...@googlegroups.com
On 3/25/20 9:18 AM, sandy...@abagile.com wrote:
> In user  ldap  should be use “root”
>
> Use command line
>
> sudo apt-get install pip3
>
> sudo pip3 install boto3
>

It is possible that Ansible uses Python 2 on the target.

To enforce Python 3 on the target, you can set the following variable:

ansible_python_interpreter: '/usr/bin/python3'

Regards
Racke

>  
>
>  
>
> BR
>
> Sandy
>
>  
>
> *From:*ansible...@googlegroups.com <ansible...@googlegroups.com> *On Behalf Of *Dick Visser
> *Sent:* Wednesday, March 25, 2020 4:02 PM
> *To:* ansible...@googlegroups.com
> *Subject:* Re: [ansible-project] Re: Create AWS EFS
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ansible-project/1567c59f-5255-46fa-a6e2-85082e3425d9%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
>
> Sent from a mobile device - please excuse the brevity, spelling and punctuation.
>
> --
> 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 <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwMgBA_TB5%2BKRnpLMrjnP20%2BPp0D0gRTfeRCZgnLCA9eMA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwMgBA_TB5%2BKRnpLMrjnP20%2BPp0D0gRTfeRCZgnLCA9eMA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/00b001d6027e%2404e09410%240ea1bc30%24%40abagile.com
> <https://groups.google.com/d/msgid/ansible-project/00b001d6027e%2404e09410%240ea1bc30%24%40abagile.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

sandy...@abagile.com

unread,
Mar 25, 2020, 5:12:56 AM3/25/20
to ansible...@googlegroups.com

 

I check this pip3 and python is installed, but still same error

I don’t know how to solved it.

 

 

 

BR

Sandy

image001.png

sandy...@abagile.com

unread,
Mar 26, 2020, 11:59:15 PM3/26/20
to ansible...@googlegroups.com
EFS tags is error?


- hosts: localhost
>
> connection: local
>
> gather_facts: no
>
>
>
> vars_files:
>
> - ec2key.yml
>
>
>
> tasks:
>
>
>
> - name: Create EFS
>
> efs:
>
> state: present
>
> region: ap-southeast-1
>
> name: "xxxx_efs"
>
> tags:
>
> Name: “efs_test”
>
> targets:
>
> - subnet_id: subnet-xxxxx
>
> security_groups: sg-xxxxxxxxxxxxx
>
>
>
>
>


The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_efs_payload_jPntT1/ansible_efs_payload.zip/ansible/modules/cloud/amazon/efs.py", line 506, in converge_file_system
File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 324, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 622, in _make_api_call
raise error_class(parsed_response, operation_name)
BadRequest: An error occurred (BadRequest) when calling the CreateTags operation: invalid tag value: \u201cefs\u201d

fatal: [localhost]: FAILED! => {
"changed": false,
"error": {
"code": "BadRequest",
"message": "invalid tag value: “efs”"
},
"invocation": {
"module_args": {
"aws_access_key": null,
"aws_secret_key": null,
"debug_botocore_endpoint_logs": false,
"ec2_url": null,
"encrypt": true,
"id": null,
"kms_key_id": null,
"name": "efs test",
"performance_mode": "general_purpose",
"profile": null,
"provisioned_throughput_in_mibps": null,
"purge_tags": true,
"region": "ap-southeast-1",
"security_token": null,
"state": "present",
"tags": {
"Name": "“efs”"
},
"targets": [
{
"security_groups": "sg-073c16c36bea62794",
"subnet_id": "subnet-46817120"
}
],
"throughput_mode": null,
"validate_certs": true,
"wait": false,
"wait_timeout": 0
}
},
"msg": "Unable to create tags: BadRequest(u'An error occurred (BadRequest) when calling the CreateTags operation: invalid tag value: \\u201cefs\\u201d',)",
"response_metadata": {
"http_headers": {
"connection": "close",
"content-_length": "67",
"content-_type": "application/json",
"date": "Fri, 27 Mar 2020 03:24:27 GMT",
"x-amzn-_error_type": "BadRequest:",
"x-amzn-_request_id": "2a0db0e0-1743-4552-bc91-32c00955fff1"
},
"http_status_code": 400,
"request_id": "2a0db0e0-1743-4552-bc91-32c00955fff1",
"retry_attempts": 0
}

BR
Sandy
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/90d590e2-f88c-cbfb-b030-df6402b295fe%40linuxia.de.

Reply all
Reply to author
Forward
0 new messages