From 866bab53db58352d56e33b8d97ce3b982a850cb9 Mon Sep 17 00:00:00 2001
From: Jason DeTiberus <jdetiber@redhat.com>
Date: Thu, 21 Apr 2016 00:45:28 -0400
Subject: aws provider fixes

- fix errors in userdata template
- update origin centos ami
- ensure ec2_tag_sub-host-type is set after launch
- disable openshift_use_dnsmasq for now
- Remove use of vars_files in includes
---
 playbooks/aws/openshift-cluster/config.yml           | 20 +++++++++++++++++---
 .../aws/openshift-cluster/tasks/launch_instances.yml |  1 +
 .../aws/openshift-cluster/templates/user_data.j2     |  5 +++--
 playbooks/aws/openshift-cluster/update.yml           | 19 ++++++++++++++++---
 playbooks/aws/openshift-cluster/vars.yml             |  2 +-
 5 files changed, 38 insertions(+), 9 deletions(-)

(limited to 'playbooks/aws')

diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml
index 8402b3579..c249f2963 100644
--- a/playbooks/aws/openshift-cluster/config.yml
+++ b/playbooks/aws/openshift-cluster/config.yml
@@ -1,7 +1,20 @@
+- hosts: localhost
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+
 - include: ../../common/openshift-cluster/config.yml
-  vars_files:
-  - ../../aws/openshift-cluster/vars.yml
-  - ../../aws/openshift-cluster/cluster_hosts.yml
   vars:
     g_ssh_user:     "{{ deployment_vars[deployment_type].ssh_user }}"
     g_sudo:         "{{ deployment_vars[deployment_type].become }}"
@@ -21,3 +34,4 @@
     os_sdn_network_plugin_name: "{{ lookup('oo_option', 'sdn_network_plugin_name') }}"
     openshift_use_flannel: "{{ lookup('oo_option', 'use_flannel') }}"
     openshift_use_fluentd: "{{ lookup('oo_option', 'use_fluentd') }}"
+    openshift_use_dnsmasq: false
diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
index 7d5776ae6..d22c86cda 100644
--- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
@@ -150,6 +150,7 @@
     groups: "{{ instance_groups }}"
     ec2_private_ip_address: "{{ item.1.private_ip }}"
     ec2_ip_address: "{{ item.1.public_ip }}"
+    ec2_tag_sub-host-type: "{{ sub_host_type }}"
     openshift_node_labels: "{{ node_label }}"
     logrotate_scripts: "{{ logrotate }}"
   with_together:
diff --git a/playbooks/aws/openshift-cluster/templates/user_data.j2 b/playbooks/aws/openshift-cluster/templates/user_data.j2
index 2a3974a8c..b1087f9c4 100644
--- a/playbooks/aws/openshift-cluster/templates/user_data.j2
+++ b/playbooks/aws/openshift-cluster/templates/user_data.j2
@@ -3,8 +3,10 @@
 mounts:
 - [ xvdb ]
 - [ ephemeral0 ]
+{% endif %}
 
 write_files:
+{% if type in ['node', 'master'] and 'docker' in volume_defs[type] %}
 - content: |
     DEVS=/dev/xvdb
     VG=docker_vg
@@ -12,8 +14,7 @@ write_files:
   owner: root:root
   permissions: '0644'
 {% endif %}
-
-{% if deployment_vars[deployment_type].become %}
+{% if deployment_vars[deployment_type].become | bool %}
 - path: /etc/sudoers.d/99-{{ deployment_vars[deployment_type].ssh_user }}-cloud-init-requiretty
   permissions: 440
   content: |
diff --git a/playbooks/aws/openshift-cluster/update.yml b/playbooks/aws/openshift-cluster/update.yml
index bd31c42dd..ed05d61ed 100644
--- a/playbooks/aws/openshift-cluster/update.yml
+++ b/playbooks/aws/openshift-cluster/update.yml
@@ -1,12 +1,25 @@
 ---
+- hosts: localhost
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+
 - name: Update - Populate oo_hosts_to_update group
   hosts: localhost
   connection: local
   become: no
   gather_facts: no
-  vars_files:
-  - vars.yml
-  - cluster_hosts.yml
   tasks:
   - name: Update - Evaluate oo_hosts_to_update
     add_host:
diff --git a/playbooks/aws/openshift-cluster/vars.yml b/playbooks/aws/openshift-cluster/vars.yml
index 8bda72ac2..d774187f0 100644
--- a/playbooks/aws/openshift-cluster/vars.yml
+++ b/playbooks/aws/openshift-cluster/vars.yml
@@ -17,7 +17,7 @@ deployment_rhel7_ent_base:
 deployment_vars:
   origin:
     # centos-7, requires marketplace
-    image: "{{ lookup('oo_option', 'ec2_image') | default('ami-61bbf104', True) }}"
+    image: "{{ lookup('oo_option', 'ec2_image') | default('ami-6d1c2007', True) }}"
     image_name: "{{ lookup('oo_option', 'ec2_image_name') | default(None, True) }}"
     region: "{{ lookup('oo_option', 'ec2_region') | default('us-east-1', True) }}"
     ssh_user: centos
-- 
cgit v1.2.3


From 432b3d970cbf22715b5f9349863ab5a396c64d2f Mon Sep 17 00:00:00 2001
From: Jason DeTiberus <jdetiber@redhat.com>
Date: Thu, 5 May 2016 21:29:04 -0400
Subject: g_all_hosts with templated with_items causes errors with ansible
 1.9.4 under some conditions

---
 playbooks/aws/openshift-cluster/config.yml | 2 +-
 playbooks/aws/openshift-cluster/update.yml | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'playbooks/aws')

diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml
index c249f2963..4839c100b 100644
--- a/playbooks/aws/openshift-cluster/config.yml
+++ b/playbooks/aws/openshift-cluster/config.yml
@@ -6,7 +6,7 @@
   - add_host:
       name: "{{ item }}"
       groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts }}"
+    with_items: g_all_hosts
 
 - hosts: l_oo_all_hosts
   gather_facts: no
diff --git a/playbooks/aws/openshift-cluster/update.yml b/playbooks/aws/openshift-cluster/update.yml
index ed05d61ed..d762203b2 100644
--- a/playbooks/aws/openshift-cluster/update.yml
+++ b/playbooks/aws/openshift-cluster/update.yml
@@ -7,7 +7,7 @@
   - add_host:
       name: "{{ item }}"
       groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts }}"
+    with_items: g_all_hosts
 
 - hosts: l_oo_all_hosts
   gather_facts: no
@@ -27,7 +27,7 @@
       groups: oo_hosts_to_update
       ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
       ansible_become: "{{ deployment_vars[deployment_type].become }}"
-    with_items: "{{ g_all_hosts | default([]) }}"
+    with_items: g_all_hosts | default([])
 
 - include: ../../common/openshift-cluster/update_repos_and_packages.yml
 
-- 
cgit v1.2.3