Hi,
I am new to ansible playbbok and I am trying to create AWS EC2 instance
using a playbook based in some examples found in internet.
But when I run the play-book I got the following error ! but I when
execute a script python using boto3 it works !?
*An exception occurred during task execution. The full traceback is:*
*Traceback (most recent call last):*
* File "/tmp/ansible_f0EA27/ansible_module_ec2.py", line 1434, in <module>*
* main()*
* File "/tmp/ansible_f0EA27/ansible_module_ec2.py", line 1424, in main*
* .....*
* .....*
*socket.timeout: timed out*
*fatal: [localhost]: FAILED! => {"changed": false, "failed": true,
"invocation": {"module_name": "ec2"}, "module_stderr": "Traceback (most
recent call last):\n File \"/tmp/ansible_f0EA27/ansible_module_ec2.py\",
line 1434, in <module>\n main()\n File
\"/tmp/ansible_f0EA27/ansible_module_ec2.py\", line 1424, in main\n
(instance_dict_array, new_instance_ids, changed) =
create_instances(module, ec2, vpc)\n File
\"/tmp/ansible_f0EA27/ansible_module_ec2.py\", line 895, in
create_instances\n vpc_id =
vpc.get_all_subnets(subnet_ids=[vpc_subnet_id])[0].vpc_id\n File
\"/usr/lib/python2.7/site-packages/boto/vpc/__init__.py\", line 1138, in
get_all_subnets\n return self.get_list('DescribeSubnets', params,
[('item', Subnet)])\n File
\"/usr/lib/python2.7/site-packages/boto/connection.py\", line 1127, in
get_list\n response = self.make_request(action, params, path, verb)\n
File \"/usr/lib/python2.7/site-packages/boto/connection.py\", line 1073,
in make_request\n return self._mexe(http_request)\n File
\"/usr/lib/python2.7/site-packages/boto/connection.py\", line 910, in
_mexe\n request.body, request.headers)\n File
\"/usr/lib64/python2.7/httplib.py\", line 979, in request\n
self._send_request(method, url, body, headers)\n File
\"/usr/lib64/python2.7/httplib.py\", line 1013, in _send_request\n
self.endheaders(body)\n File \"/usr/lib64/python2.7/httplib.py\", line
975, in endheaders\n self._send_output(message_body)\n File
\"/usr/lib64/python2.7/httplib.py\", line 835, in _send_output\n
self.send(msg)\n File \"/usr/lib64/python2.7/httplib.py\", line 797, in
send\n self.connect()\n File
\"/usr/lib/python2.7/site-packages/boto/https_connection.py\", line 111, in
connect\n sock.connect((self.host, self.port))\n File
\"/usr/lib64/python2.7/socket.py\", line 224, in meth\n return
getattr(self._sock,name)(*args)\nsocket.timeout: timed out\n",
"module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}*
Following is the shell environment variables and my playbook, :
*AWS_ACCESS_KEY_ID=AKIAxxxxxxxxxxxx*
*AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxx*
*- hosts: localhost*
* connection: local*
* gather_facts: False*
* vars:*
* proxy_env:*
* https_proxy: "https://172.20.xx.xx:3128"*
* tasks:*
* - name: Create EC2 instance*
* environment: "{{proxy_env}}"*
* #always_run: true*
* ec2:*
* key_name: Robby*
* group_id: sg-2f8xxx*
* instance_type: t2.small*
* ec2_region: eu-west-1*
* image: "ami-0b23xxx"*
* wait: true*
* count: 1*
* vpc_subnet_id: subnet-7xxxxxx*
* count_tag:*
* Name: Demo*
* instance_tags:*
* Name: Demo*
* volumes:*
* - device_name: /dev/xvdb*
* device_type: standard*
* volume_size: 10*
* delete_on_termination: true*
* register: ec2*
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e03f3fc7-6862-49de-ab6d-5496cc7c51de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.