summaryrefslogtreecommitdiffstats
path: root/playbooks/aws/openshift-cluster
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/aws/openshift-cluster')
-rw-r--r--playbooks/aws/openshift-cluster/config.yml1
-rw-r--r--playbooks/aws/openshift-cluster/launch.yml8
-rw-r--r--playbooks/aws/openshift-cluster/service.yml28
-rw-r--r--playbooks/aws/openshift-cluster/tasks/launch_instances.yml3
4 files changed, 39 insertions, 1 deletions
diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml
index b8961704e..7188312ed 100644
--- a/playbooks/aws/openshift-cluster/config.yml
+++ b/playbooks/aws/openshift-cluster/config.yml
@@ -32,5 +32,6 @@
openshift_cluster_id: "{{ cluster_id }}"
openshift_debug_level: 4
openshift_deployment_type: "{{ deployment_type }}"
+ openshift_first_master: "{{ groups.oo_first_master.0 }}"
openshift_hostname: "{{ ec2_private_ip_address }}"
openshift_public_hostname: "{{ ec2_ip_address }}"
diff --git a/playbooks/aws/openshift-cluster/launch.yml b/playbooks/aws/openshift-cluster/launch.yml
index 3eb5496e4..33e1ec25d 100644
--- a/playbooks/aws/openshift-cluster/launch.yml
+++ b/playbooks/aws/openshift-cluster/launch.yml
@@ -25,6 +25,14 @@
cluster: "{{ cluster_id }}"
type: "{{ k8s_type }}"
+ - set_fact:
+ a_master: "{{ master_names[0] }}"
+ - add_host: name={{ a_master }} groups=service_master
+
- include: update.yml
+- include: ../../common/openshift-cluster/create_services.yml
+ vars:
+ g_svc_master: "{{ service_master }}"
+
- include: list.yml
diff --git a/playbooks/aws/openshift-cluster/service.yml b/playbooks/aws/openshift-cluster/service.yml
new file mode 100644
index 000000000..25cf48505
--- /dev/null
+++ b/playbooks/aws/openshift-cluster/service.yml
@@ -0,0 +1,28 @@
+---
+- name: Call same systemctl command for openshift on all instance(s)
+ hosts: localhost
+ gather_facts: no
+ vars_files:
+ - vars.yml
+ tasks:
+ - fail: msg="cluster_id is required to be injected in this playbook"
+ when: cluster_id is not defined
+
+ - name: Evaluate g_service_masters
+ add_host:
+ name: "{{ item }}"
+ groups: g_service_masters
+ ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
+ ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
+ with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-master"] | default([])
+
+ - name: Evaluate g_service_nodes
+ add_host:
+ name: "{{ item }}"
+ groups: g_service_nodes
+ ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
+ ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
+ with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([])
+
+- include: ../../common/openshift-node/service.yml
+- include: ../../common/openshift-master/service.yml
diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
index 666a8d1fb..060147659 100644
--- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
@@ -79,13 +79,14 @@
group: "{{ ec2_security_groups }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ latest_ami }}"
- count: "{{ instances | oo_len }}"
+ count: "{{ instances | length }}"
vpc_subnet_id: "{{ ec2_vpc_subnet | default(omit, true) }}"
assign_public_ip: "{{ ec2_assign_public_ip | default(omit, true) }}"
user_data: "{{ user_data }}"
wait: yes
instance_tags:
created-by: "{{ created_by }}"
+ environment: "{{ env }}"
env: "{{ env }}"
host-type: "{{ host_type }}"
env-host-type: "{{ env_host_type }}"