From 7f60edeba48d78cd01669d20019e9bdacdf4e305 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 2 Jun 2017 14:06:52 +0200 Subject: Move the openstack provisioning playbooks They'll live in playbooks/provisioning/openstack from now on. --- .../provisioning/openstack/provision-openstack.yml | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 playbooks/provisioning/openstack/provision-openstack.yml (limited to 'playbooks/provisioning/openstack/provision-openstack.yml') diff --git a/playbooks/provisioning/openstack/provision-openstack.yml b/playbooks/provisioning/openstack/provision-openstack.yml new file mode 100644 index 000000000..8125548fd --- /dev/null +++ b/playbooks/provisioning/openstack/provision-openstack.yml @@ -0,0 +1,48 @@ +--- +- hosts: localhost + pre_tasks: + - include: roles/common/pre_tasks/pre_tasks.yml + roles: + - role: openstack-stack + stack_name: "{{ env_id }}.{{ public_dns_domain }}" + dns_domain: "{{ public_dns_domain }}" + dns_nameservers: "{{ public_dns_nameservers }}" + subnet_prefix: "{{ openstack_subnet_prefix }}" + ssh_public_key: "{{ openstack_ssh_public_key }}" + openstack_image: "{{ openstack_default_image_name }}" + lb_flavor: "{{ openstack_lb_flavor | default('m1.small') }}" + etcd_flavor: "{{ openstack_default_flavor }}" + master_flavor: "{{ openstack_default_flavor }}" + node_flavor: "{{ openstack_default_flavor }}" + infra_flavor: "{{ openstack_default_flavor }}" + dns_flavor: "{{ openstack_dns_flavor | default('m1.small') }}" + external_network: "{{ openstack_external_network_name }}" + num_etcd: 0 + num_masters: "{{ openstack_num_masters }}" + num_nodes: "{{ openstack_num_nodes }}" + num_infra: "{{ openstack_num_infra }}" + num_dns: "{{ openstack_num_dns | default(1) }}" + master_volume_size: "{{ docker_volume_size }}" + app_volume_size: "{{ docker_volume_size }}" + infra_volume_size: "{{ docker_volume_size }}" + + +- name: Refresh Server inventory + hosts: localhost + connection: local + gather_facts: False + tasks: + - meta: refresh_inventory + +- hosts: cluster_hosts + gather_facts: false + tasks: + - name: Debug hostvar + debug: + msg: "{{ hostvars[inventory_hostname] }}" + verbosity: 2 + - name: waiting for server to come back + local_action: wait_for host={{ hostvars[inventory_hostname]['ansible_ssh_host'] }} port=22 delay=30 timeout=300 + become: false + +- include: post-provision-openstack.yml -- cgit v1.2.3 From 079f58cb9d137fd35e58043f2b53a9b964f3d3d2 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 2 Jun 2017 14:41:29 +0200 Subject: Add default values to provision-openstack.yml --- playbooks/provisioning/openstack/provision-openstack.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'playbooks/provisioning/openstack/provision-openstack.yml') diff --git a/playbooks/provisioning/openstack/provision-openstack.yml b/playbooks/provisioning/openstack/provision-openstack.yml index 8125548fd..0505f1bda 100644 --- a/playbooks/provisioning/openstack/provision-openstack.yml +++ b/playbooks/provisioning/openstack/provision-openstack.yml @@ -1,7 +1,7 @@ --- - hosts: localhost pre_tasks: - - include: roles/common/pre_tasks/pre_tasks.yml + - include: pre_tasks.yml roles: - role: openstack-stack stack_name: "{{ env_id }}.{{ public_dns_domain }}" @@ -10,14 +10,14 @@ subnet_prefix: "{{ openstack_subnet_prefix }}" ssh_public_key: "{{ openstack_ssh_public_key }}" openstack_image: "{{ openstack_default_image_name }}" - lb_flavor: "{{ openstack_lb_flavor | default('m1.small') }}" - etcd_flavor: "{{ openstack_default_flavor }}" - master_flavor: "{{ openstack_default_flavor }}" - node_flavor: "{{ openstack_default_flavor }}" - infra_flavor: "{{ openstack_default_flavor }}" - dns_flavor: "{{ openstack_dns_flavor | default('m1.small') }}" + lb_flavor: "{{ openstack_default_flavor | default('m1.small') }}" + etcd_flavor: "{{ openstack_default_flavor | default('m1.small') }}" + master_flavor: "{{ openstack_default_flavor | default('m1.medium') }}" + node_flavor: "{{ openstack_default_flavor | default('m1.medium') }}" + infra_flavor: "{{ openstack_default_flavor | default('m1.medium') }}" + dns_flavor: "{{ openstack_default_flavor | default('m1.small') }}" external_network: "{{ openstack_external_network_name }}" - num_etcd: 0 + num_etcd: "{{ openstack_num_etcd | default(0) }}" num_masters: "{{ openstack_num_masters }}" num_nodes: "{{ openstack_num_nodes }}" num_infra: "{{ openstack_num_infra }}" -- cgit v1.2.3 From c12c972e8c1180cebf24ddd0eb43b26657fdaec6 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 14 Jun 2017 09:33:18 +0200 Subject: Gather facts for provision playbook Provision tasks use facts like ansible_hostname and few others. W/o gathering facts, those expire, and the provision playbook cannot be reapplied in order to update the existing heat stack. Refresh the facts cache by specifying gather_facts: true. Signed-off-by: Bogdan Dobrelya --- playbooks/provisioning/openstack/provision-openstack.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'playbooks/provisioning/openstack/provision-openstack.yml') diff --git a/playbooks/provisioning/openstack/provision-openstack.yml b/playbooks/provisioning/openstack/provision-openstack.yml index 0505f1bda..c7ad782c9 100644 --- a/playbooks/provisioning/openstack/provision-openstack.yml +++ b/playbooks/provisioning/openstack/provision-openstack.yml @@ -1,5 +1,6 @@ --- - hosts: localhost + gather_facts: True pre_tasks: - include: pre_tasks.yml roles: -- cgit v1.2.3