minor tweaks to roles
[awsible] / roles / common / tasks / main.yml
index b92b5174c4aec46dd83c560563221b396dbacd2f..c65548d7bc1118671d3576bf0659235ab94c6f37 100644 (file)
@@ -1,28 +1,24 @@
 ---
-- include: volumes.yml
-
-- name: Create local asset directory
-  when: ASSET_PATH is defined
-  file:
-    state: directory
-    path: "{{ ASSET_PATH }}"
-    mode: "0755"
-    owner: root
-    group: root
+- name: Uninstall outdated python packages
+  with_items:
+  - aws-cli
+  - python27-botocore
+  - python27-boto
+  yum:
+    package: "{{ item }}"
+    state: absent
 
-- name: PIP prerequisites
+- name: Install new python packages
   with_items:
+  - awscli
   - boto
   - boto3
-  - httplib2
-  - requests
   pip:
     name: "{{ item }}"
     state: latest
 
 - name: Common packages
   with_items:
-  - aws-cli
   - cowsay
   - figlet
   - ipsec-tools
@@ -46,7 +42,7 @@
     group: root
 
 - name: Install any facts.
-  with_items: "{{ fact_scripts|default(None) }}"
+  with_items: "{{ fact_scripts|default([]) }}"
   copy:
     dest: /etc/ansible/facts.d/{{ item }}.fact
     src: "{{ item }}.fact"
@@ -67,6 +63,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
@@ -90,9 +87,9 @@
   command: /usr/sbin/update-motd
 
 - name: profile stuff
-  copy:
+  template:
     dest: /etc/profile.d/awsible.sh
-    src: awsible.sh
+    src: awsible.sh.j2
     mode: "0644"
     owner: root
     group: root