0

I have used ansible for mounting EC2 instances, I have done an update to 1.8, so it can have the timeout parameter for get_url, and now it is not working anymore.

I have the following securitygroups.yml:

---
# Check security group existence, create them if not existing 

- name: Create security group for ssh
  local_action:
    module: ec2_group
    name: {{ group_name }}
    vpc_id: "{{ vpc_id }}"
    description: Security group for ssh 
    region: "{{ ec2_region }}"
    # inbound rules
    rules:
      - proto: tcp
        from_port: xxx
        to_port: xxx
        cidr_ip: xxx
      - proto: tcp
        from_port: xxx
        to_port: xxx
        cidr_ip: xxx
      - proto: tcp
        from_port: xxx
        to_port: xxx
        cidr_ip: xxx
    # outbound rules
    rules_egress:
      - proto: all
        from_port: xxx
        to_port: xxx
        cidr_ip: xxx


- name: Authorize the members of this group to push logs to the syslog instance. See the syslog group
  local_action:
    module: ec2_group
    name: logstash-shipper
    vpc_id: "{{ vpc_id }}"
    description: Authorize the members of this group to push logs to the syslog instance. See the syslog group
    region: "{{ ec2_region }}"
    # outbound rules
    rules_egress:
      - proto: tcp
        from_port: xxx
        to_port: xxx
        cidr_ip: xxx
      - proto: udp
        from_port: xxx
        to_port: xxx
        cidr_ip: xxx

and in main.yml:

---
# Check security group existence, create them if not existing 

- include: securitygroups.yml
  tags: securitygroups

that is in roles/ec2-security-groups/tasks; ofcourse there is a main.yml in vars

The start.yml is:

- hosts: local
  connection: local
  gather_facts: False
  vars:
    ec2_instance_type: XXX
    instance_tag_name: XXX
    instance_tag_environnement: XXX
    instance_tag_applicatif: XXX
    instance_tag_composant: XXX
    instance_tag_bloc: XXX
  roles:
    - ec2-security-groups

Before it worked, now I get the following error:

<x.x.x.x> REMOTE_MODULE ec2_group name=XXX vpc_id=XXX region=XXX description='Security group for ssh'
fatal: [localhost -> x.x.x.x] => module ec2_group not found in /usr/share/ansible/cloud:/usr/share/ansible/packaging:/usr/share/ansible/files:/usr/share/ansible/windows:/usr/share/ansible/net_infrastructure:/usr/share/ansible/monitoring:/usr/share/ansible/system:/usr/share/ansible/web_infrastructure:/usr/share/ansible/notification:/usr/share/ansible

FATAL: all hosts have already failed -- aborting

How to fix it? (I don't know what the ansible version before was...)

sop
  • 3,445
  • 8
  • 41
  • 84
  • How did you install/update Ansible? The "module not found" problem might meand the git repository has not been cloned recursively. – udondan Jul 28 '15 at 12:56
  • directly using sudo apt-get install ansible :s – sop Jul 28 '15 at 12:58
  • Now, I have removed it like [here](http://installion.co.uk/ubuntu/vivid/universe/a/ansible/uninstall/index.html) and reinstalled it like [here](http://docs.ansible.com/ansible/intro_installation.html#latest-releases-via-apt-ubuntu), but still the same error – sop Jul 28 '15 at 13:03

1 Answers1

0

Fixed it: It should be installed using pip and the version that works seems to be the 1.9.1.

sudo pip install ansible==1.9.0.1

I have solved this by reading this

sop
  • 3,445
  • 8
  • 41
  • 84