finish fixing common
authorJustin Wind <j.wind@partner.samsung.com>
Fri, 10 Mar 2017 00:38:37 +0000 (16:38 -0800)
committerJustin Wind <j.wind@partner.samsung.com>
Fri, 10 Mar 2017 00:38:37 +0000 (16:38 -0800)
ansible.cfg
management.yml
roles/aws-infrastructure/tasks/main.yml
roles/common/tasks/main.yml

index c6ee886c3e0a371a8d3c3625165208608a52e4c4..de5f2b3f67680b5792d72ff36ec71e7255dfc01f 100644 (file)
@@ -3,4 +3,4 @@ retry_files_enabled = False
 host_key_checking = False
 inventory = inventory
 remote_user = ec2-user
-private_key_file = keys/awskey.pem
+private_key_file = keys/management.pem
index b308c43d6bddb39c939fe43f1a31774ba6962223..912a6738bdeb6eb371ae6400ff07fd2685d29b3c 100644 (file)
@@ -1,11 +1,6 @@
 ---
-- hosts: localhost
-  connection: local
-  roles:
-  - aws-infrastructure
-
 - hosts: management
   become: true
   roles:
   - common
-  - management
+#  - management
index 83085db12097b4cc945dff3ab20aca5476385265..8aa65bf0601db1c59d00626734cca7418583e64b 100644 (file)
     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:
index 1cbf04470d9807b6e5eec5be32c12b3018455672..12c6ff1637fda0e0082a4a2d514c512c70923675 100644 (file)
@@ -1,5 +1,10 @@
 ---
+- 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
@@ -67,6 +79,7 @@
     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