summaryrefslogtreecommitdiffstats
path: root/playbooks/openstack/openshift-cluster/launch.yml
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/openstack/openshift-cluster/launch.yml')
-rw-r--r--playbooks/openstack/openshift-cluster/launch.yml33
1 files changed, 11 insertions, 22 deletions
diff --git a/playbooks/openstack/openshift-cluster/launch.yml b/playbooks/openstack/openshift-cluster/launch.yml
index d36bdbf26..651aef40b 100644
--- a/playbooks/openstack/openshift-cluster/launch.yml
+++ b/playbooks/openstack/openshift-cluster/launch.yml
@@ -19,30 +19,21 @@
changed_when: false
failed_when: stack_show_result.rc != 0 and 'Stack not found' not in stack_show_result.stderr
- - name: Create OpenStack Stack
- command: 'heat stack-create -f {{ openstack_infra_heat_stack }}
- -P cluster_id={{ cluster_id }}
- -P dns_nameservers={{ openstack_network_dns | join(",") }}
- -P cidr={{ openstack_network_cidr }}
- -P ssh_incoming={{ openstack_ssh_access_from }}
- -P num_masters={{ num_masters }}
- -P num_nodes={{ num_nodes }}
- -P num_infra={{ num_infra }}
- -P master_image={{ deployment_vars[deployment_type].image }}
- -P node_image={{ deployment_vars[deployment_type].image }}
- -P infra_image={{ deployment_vars[deployment_type].image }}
- -P master_flavor={{ openstack_flavor["master"] }}
- -P node_flavor={{ openstack_flavor["node"] }}
- -P infra_flavor={{ openstack_flavor["infra"] }}
- -P ssh_public_key="{{ openstack_ssh_public_key }}"
- openshift-ansible-{{ cluster_id }}-stack'
+ - set_fact:
+ heat_stack_action: 'stack-create'
when: stack_show_result.rc == 1
+ - set_fact:
+ heat_stack_action: 'stack-update'
+ when: stack_show_result.rc == 0
- - name: Update OpenStack Stack
- command: 'heat stack-update -f {{ openstack_infra_heat_stack }}
+ - name: Create or Update OpenStack Stack
+ command: 'heat {{ heat_stack_action }} -f {{ openstack_infra_heat_stack }}
-P cluster_id={{ cluster_id }}
- -P dns_nameservers={{ openstack_network_dns | join(",") }}
-P cidr={{ openstack_network_cidr }}
+ -P dns_nameservers={{ openstack_network_dns | join(",") }}
+ -P external_net={{ openstack_network_external_net }}
+ -P floating_ip_pool={{ openstack_floating_ip_pool }}
+ -P ssh_public_key="{{ openstack_ssh_public_key }}"
-P ssh_incoming={{ openstack_ssh_access_from }}
-P num_masters={{ num_masters }}
-P num_nodes={{ num_nodes }}
@@ -53,9 +44,7 @@
-P master_flavor={{ openstack_flavor["master"] }}
-P node_flavor={{ openstack_flavor["node"] }}
-P infra_flavor={{ openstack_flavor["infra"] }}
- -P ssh_public_key="{{ openstack_ssh_public_key }}"
openshift-ansible-{{ cluster_id }}-stack'
- when: stack_show_result.rc == 0
- name: Wait for OpenStack Stack readiness
shell: 'heat stack-show openshift-ansible-{{ cluster_id }}-stack | awk ''$2 == "stack_status" {print $4}'''