host_key_checking = False
inventory = inventory
remote_user = ec2-user
-private_key_file = keys/awskey.pem
+private_key_file = keys/management.pem
launch_config_name: "{{ mgmt_lc.name }}"
notification_topic: "{{ management_topic.sns_arn }}"
notification_types:
- - autoscaling:EC2_INSTANCE_LAUNCH
+ - autoscaling:EC2_INSTANCE_LAUNCH
load_balancers:
- management-int-elb
tags:
---
+- name: bootstrap /data
+ stat:
+ path: /data
+ register: datadir
- include: volumes.yml
+ when: not datadir.stat.exists
- name: Create local asset directory
when: ASSET_PATH is defined
owner: root
group: root
-- name: PIP prerequisites
+- name: Uninstall outdated python packages
with_items:
+ - aws-cli
+ - python27-botocore
+ - python27-boto
+ yum:
+ package: "{{ item }}"
+ state: absent
+
+- name: Install new python packages
+ with_items:
+ - awscli
- boto
- boto3
- - httplib2
- - requests
pip:
name: "{{ item }}"
- state: latest
+ state: present
- name: Common packages
with_items:
- - aws-cli
- cowsay
- figlet
- ipsec-tools
state: list
region: "{{ ansible_ec2_placement_region }}"
resource: "{{ ansible_ec2_instance_id }}"
+ register: my_tags
- name: Name instance from ID and ASG module
when: my_tags['tags']['aws:autoscaling:groupName'] is defined