From 4e8f6d1923782e7aef863441f7c1434ca1029164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Wed, 20 May 2015 13:26:04 +0200 Subject: =?UTF-8?q?[libvirt=20cluster]=20Use=20net-dhcp-leases=20to=20find?= =?UTF-8?q?=20VMs=E2=80=99=20IPs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Query libvirt’s DHCP leases rather than inspecting the host’s ARP cache to find the VMs’ IPs. --- .../libvirt/openshift-cluster/tasks/launch_instances.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'playbooks') diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index 359d0b2f3..8bf1e84ee 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml @@ -58,23 +58,17 @@ uri: '{{ libvirt_uri }}' with_items: instances -- name: Collect MAC addresses of the VMs - shell: 'virsh -c {{ libvirt_uri }} dumpxml {{ item }} | xmllint --xpath "string(//domain/devices/interface/mac/@address)" -' - register: scratch_mac - with_items: instances - - name: Wait for the VMs to get an IP - command: "egrep -c '{{ scratch_mac.results | oo_collect('stdout') | join('|') }}' /proc/net/arp" - ignore_errors: yes + shell: 'virsh net-dhcp-leases openshift-ansible | egrep -c ''{{ instances | join("|") }}''' register: nb_allocated_ips until: nb_allocated_ips.stdout == '{{ instances | length }}' retries: 30 delay: 1 - name: Collect IP addresses of the VMs - shell: "awk '/{{ item.stdout }}/ {print $1}' /proc/net/arp" + shell: 'virsh net-dhcp-leases openshift-ansible | awk ''$6 == "{{ item }}" {gsub(/\/.*/, "", $5); print $5}''' register: scratch_ip - with_items: scratch_mac.results + with_items: instances - set_fact: ips: "{{ scratch_ip.results | oo_collect('stdout') }}" -- cgit v1.2.3 From 09e41be0eb83e24f284b84015bb1abbd25f23dff Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Tue, 26 May 2015 11:58:50 -0400 Subject: removed references to atomic proxy. --- playbooks/aws/openshift-master/launch.yml | 8 +-- playbooks/aws/openshift-node/launch.yml | 8 +-- playbooks/aws/os2-atomic-proxy/config.yml | 20 ------ playbooks/aws/os2-atomic-proxy/filter_plugins | 1 - playbooks/aws/os2-atomic-proxy/launch.yml | 97 --------------------------- playbooks/aws/os2-atomic-proxy/roles | 1 - playbooks/aws/os2-atomic-proxy/user_data.txt | 6 -- playbooks/aws/os2-atomic-proxy/vars.int.yml | 3 - playbooks/aws/os2-atomic-proxy/vars.prod.yml | 3 - playbooks/aws/os2-atomic-proxy/vars.stg.yml | 10 --- playbooks/aws/os2-atomic-proxy/vars.yml | 1 - 11 files changed, 8 insertions(+), 150 deletions(-) delete mode 100644 playbooks/aws/os2-atomic-proxy/config.yml delete mode 120000 playbooks/aws/os2-atomic-proxy/filter_plugins delete mode 100644 playbooks/aws/os2-atomic-proxy/launch.yml delete mode 120000 playbooks/aws/os2-atomic-proxy/roles delete mode 100644 playbooks/aws/os2-atomic-proxy/user_data.txt delete mode 100644 playbooks/aws/os2-atomic-proxy/vars.int.yml delete mode 100644 playbooks/aws/os2-atomic-proxy/vars.prod.yml delete mode 100644 playbooks/aws/os2-atomic-proxy/vars.stg.yml delete mode 100644 playbooks/aws/os2-atomic-proxy/vars.yml (limited to 'playbooks') diff --git a/playbooks/aws/openshift-master/launch.yml b/playbooks/aws/openshift-master/launch.yml index 6b3751682..51a0258f0 100644 --- a/playbooks/aws/openshift-master/launch.yml +++ b/playbooks/aws/openshift-master/launch.yml @@ -4,10 +4,10 @@ connection: local gather_facts: no -# TODO: modify atomic_ami based on deployment_type +# TODO: modify g_ami based on deployment_type vars: inst_region: us-east-1 - atomic_ami: ami-86781fee + g_ami: ami-86781fee user_data_file: user_data.txt tasks: @@ -18,13 +18,13 @@ keypair: libra group: ['public'] instance_type: m3.large - image: "{{ atomic_ami }}" + image: "{{ g_ami }}" count: "{{ oo_new_inst_names | oo_len }}" user_data: "{{ lookup('file', user_data_file) }}" wait: yes register: ec2 - - name: Add new instances public IPs to the atomic proxy host group + - name: Add new instances public IPs to the host group add_host: "hostname={{ item.public_ip }} groupname=new_ec2_instances" with_items: ec2.instances diff --git a/playbooks/aws/openshift-node/launch.yml b/playbooks/aws/openshift-node/launch.yml index 36aee14ff..d6024a020 100644 --- a/playbooks/aws/openshift-node/launch.yml +++ b/playbooks/aws/openshift-node/launch.yml @@ -4,10 +4,10 @@ connection: local gather_facts: no -# TODO: modify atomic_ami based on deployment_type +# TODO: modify g_ami based on deployment_type vars: inst_region: us-east-1 - atomic_ami: ami-86781fee + g_ami: ami-86781fee user_data_file: user_data.txt tasks: @@ -18,13 +18,13 @@ keypair: libra group: ['public'] instance_type: m3.large - image: "{{ atomic_ami }}" + image: "{{ g_ami }}" count: "{{ oo_new_inst_names | oo_len }}" user_data: "{{ lookup('file', user_data_file) }}" wait: yes register: ec2 - - name: Add new instances public IPs to the atomic proxy host group + - name: Add new instances public IPs to the host group add_host: hostname: "{{ item.public_ip }}" groupname: new_ec2_instances" diff --git a/playbooks/aws/os2-atomic-proxy/config.yml b/playbooks/aws/os2-atomic-proxy/config.yml deleted file mode 100644 index 7d384a665..000000000 --- a/playbooks/aws/os2-atomic-proxy/config.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: "populate oo_hosts_to_config host group if needed" - hosts: localhost - gather_facts: no - tasks: - - name: Evaluate oo_host_group_exp if it's set - add_host: "name={{ item }} groups=oo_hosts_to_config" - with_items: "{{ oo_host_group_exp | default(['']) }}" - when: oo_host_group_exp is defined - -- name: "Configure instances" - hosts: oo_hosts_to_config - connection: ssh - user: root - vars_files: - - vars.yml - - "vars.{{ oo_env }}.yml" - roles: - - atomic_base - - atomic_proxy diff --git a/playbooks/aws/os2-atomic-proxy/filter_plugins b/playbooks/aws/os2-atomic-proxy/filter_plugins deleted file mode 120000 index 99a95e4ca..000000000 --- a/playbooks/aws/os2-atomic-proxy/filter_plugins +++ /dev/null @@ -1 +0,0 @@ -../../../filter_plugins \ No newline at end of file diff --git a/playbooks/aws/os2-atomic-proxy/launch.yml b/playbooks/aws/os2-atomic-proxy/launch.yml deleted file mode 100644 index fd6b0f39a..000000000 --- a/playbooks/aws/os2-atomic-proxy/launch.yml +++ /dev/null @@ -1,97 +0,0 @@ ---- -- name: Launch instance(s) - hosts: localhost - connection: local - gather_facts: no - - vars: - inst_region: us-east-1 - atomic_ami: ami-8e239fe6 - user_data_file: user_data.txt - oo_vpc_subnet_id: # Purposely left blank, these are here to be overridden in env vars_files - oo_assign_public_ip: # Purposely left blank, these are here to be overridden in env vars_files - - vars_files: - - vars.yml - - "vars.{{ oo_env }}.yml" - - tasks: - - name: Launch instances in VPC - ec2: - state: present - region: "{{ inst_region }}" - keypair: mmcgrath_libra - group_id: "{{ oo_security_group_ids }}" - instance_type: m3.large - image: "{{ atomic_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" - user_data: "{{ lookup('file', user_data_file) }}" - wait: yes - assign_public_ip: "{{ oo_assign_public_ip }}" - vpc_subnet_id: "{{ oo_vpc_subnet_id }}" - when: oo_vpc_subnet_id - register: ec2_vpc - - - set_fact: - ec2: "{{ ec2_vpc }}" - when: oo_vpc_subnet_id - - - name: Launch instances in Classic - ec2: - state: present - region: "{{ inst_region }}" - keypair: mmcgrath_libra - group: ['Libra', '{{ oo_env }}', '{{ oo_env }}_proxy', '{{ oo_env }}_proxy_atomic'] - instance_type: m3.large - image: "{{ atomic_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" - user_data: "{{ lookup('file', user_data_file) }}" - wait: yes - when: not oo_vpc_subnet_id - register: ec2_classic - - - set_fact: - ec2: "{{ ec2_classic }}" - when: not oo_vpc_subnet_id - - - name: Add new instances public IPs to the atomic proxy host group - add_host: "hostname={{ item.public_ip }} groupname=new_ec2_instances" - with_items: ec2.instances - - - name: Add Name and environment tags to instances - ec2_tag: "resource={{ item.1.id }} region={{ inst_region }} state=present" - with_together: - - oo_new_inst_names - - ec2.instances - args: - tags: - Name: "{{ item.0 }}" - - - name: Add other tags to instances - ec2_tag: "resource={{ item.id }} region={{ inst_region }} state=present" - with_items: ec2.instances - args: - tags: "{{ oo_new_inst_tags }}" - - - name: Add new instances public IPs to oo_hosts_to_config - add_host: "hostname={{ item.0 }} ansible_ssh_host={{ item.1.public_ip }} groupname=oo_hosts_to_config" - with_together: - - oo_new_inst_names - - ec2.instances - - - debug: var=ec2 - - - name: Wait for ssh - wait_for: "port=22 host={{ item.public_ip }}" - with_items: ec2.instances - - - name: Wait for root user setup - command: "ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null root@{{ item.public_ip }} echo root user is setup" - register: result - until: result.rc == 0 - retries: 20 - delay: 10 - with_items: ec2.instances - -# Apply the configs, seprate so that just the configs can be run by themselves -- include: config.yml diff --git a/playbooks/aws/os2-atomic-proxy/roles b/playbooks/aws/os2-atomic-proxy/roles deleted file mode 120000 index 20c4c58cf..000000000 --- a/playbooks/aws/os2-atomic-proxy/roles +++ /dev/null @@ -1 +0,0 @@ -../../../roles \ No newline at end of file diff --git a/playbooks/aws/os2-atomic-proxy/user_data.txt b/playbooks/aws/os2-atomic-proxy/user_data.txt deleted file mode 100644 index 643d17c32..000000000 --- a/playbooks/aws/os2-atomic-proxy/user_data.txt +++ /dev/null @@ -1,6 +0,0 @@ -#cloud-config -disable_root: 0 - -system_info: - default_user: - name: root diff --git a/playbooks/aws/os2-atomic-proxy/vars.int.yml b/playbooks/aws/os2-atomic-proxy/vars.int.yml deleted file mode 100644 index 00157cd89..000000000 --- a/playbooks/aws/os2-atomic-proxy/vars.int.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -oo_env_long: integration -oo_zabbix_hostgroups: ['INT Environment'] diff --git a/playbooks/aws/os2-atomic-proxy/vars.prod.yml b/playbooks/aws/os2-atomic-proxy/vars.prod.yml deleted file mode 100644 index 641afc626..000000000 --- a/playbooks/aws/os2-atomic-proxy/vars.prod.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -oo_env_long: production -oo_zabbix_hostgroups: ['PROD Environment'] diff --git a/playbooks/aws/os2-atomic-proxy/vars.stg.yml b/playbooks/aws/os2-atomic-proxy/vars.stg.yml deleted file mode 100644 index 1cecfc9b2..000000000 --- a/playbooks/aws/os2-atomic-proxy/vars.stg.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -oo_env_long: staging -oo_zabbix_hostgroups: ['STG Environment'] -oo_vpc_subnet_id: subnet-700bdd07 -oo_assign_public_ip: yes -oo_security_group_ids: - - sg-02c2f267 # Libra (vpc) - - sg-f0bfbe95 # stg (vpc) - - sg-a3bfbec6 # stg_proxy (vpc) - - sg-d4bfbeb1 # stg_proxy_atomic (vpc) diff --git a/playbooks/aws/os2-atomic-proxy/vars.yml b/playbooks/aws/os2-atomic-proxy/vars.yml deleted file mode 100644 index ed97d539c..000000000 --- a/playbooks/aws/os2-atomic-proxy/vars.yml +++ /dev/null @@ -1 +0,0 @@ ---- -- cgit v1.2.3 From 1b4526d677651cb3677cbf7cc687a76fcba47c9a Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 27 Apr 2015 15:04:57 -0700 Subject: [WIP] Infrastructure - Deploy services in cluster * Create OpenShift Docker Registry * Create OpenShift router --- playbooks/gce/openshift-cluster/launch.yml | 15 +++++++++++++++ playbooks/gce/openshift-cluster/list.yml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'playbooks') diff --git a/playbooks/gce/openshift-cluster/launch.yml b/playbooks/gce/openshift-cluster/launch.yml index 771f51e91..36fc430aa 100644 --- a/playbooks/gce/openshift-cluster/launch.yml +++ b/playbooks/gce/openshift-cluster/launch.yml @@ -23,6 +23,21 @@ cluster: "{{ cluster_id }}" type: "{{ k8s_type }}" + - set_fact: + oo_first_master: "{{ item }}" + with_items: master_names.split() + - debug: var=oo_first_master + - include: update.yml +- name: Deploy OpenShift Services + hosts: oo_first_master + connection: ssh + gather_facts: yes + vars_files: + - vars.yml + roles: + - openshift_docker_registry + - openshift_router + - include: list.yml diff --git a/playbooks/gce/openshift-cluster/list.yml b/playbooks/gce/openshift-cluster/list.yml index 962381306..5ba0f5a48 100644 --- a/playbooks/gce/openshift-cluster/list.yml +++ b/playbooks/gce/openshift-cluster/list.yml @@ -16,7 +16,7 @@ ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated) -- name: List Hosts +- name: List instance(s) hosts: oo_list_hosts gather_facts: no tasks: -- cgit v1.2.3 From 3e533e199aa9262f5ca45f8311e82e975cde73b9 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 1 May 2015 13:57:30 -0700 Subject: * Deploy services from common playbook --- playbooks/aws/openshift-cluster/launch.yml | 8 ++++++++ playbooks/common/openshift-cluster/create_services.yml | 14 ++++++++++++++ playbooks/gce/openshift-cluster/launch.yml | 15 ++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 playbooks/common/openshift-cluster/create_services.yml (limited to 'playbooks') diff --git a/playbooks/aws/openshift-cluster/launch.yml b/playbooks/aws/openshift-cluster/launch.yml index 3eb5496e4..f64925124 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: + create_services__master: "{{ service_master }}" + - include: list.yml diff --git a/playbooks/common/openshift-cluster/create_services.yml b/playbooks/common/openshift-cluster/create_services.yml new file mode 100644 index 000000000..c85db5234 --- /dev/null +++ b/playbooks/common/openshift-cluster/create_services.yml @@ -0,0 +1,14 @@ +--- +- name: Debug Deploy OpenShift Services + hosts: localhost + gather_facts: no + tasks: + - debug: var=create_services__master + +- name: Deploy OpenShift Services + hosts: "{{ create_services__master }}" + connection: ssh + gather_facts: yes + roles: + - openshift_registry + - openshift_router diff --git a/playbooks/gce/openshift-cluster/launch.yml b/playbooks/gce/openshift-cluster/launch.yml index 36fc430aa..53d461183 100644 --- a/playbooks/gce/openshift-cluster/launch.yml +++ b/playbooks/gce/openshift-cluster/launch.yml @@ -24,20 +24,21 @@ type: "{{ k8s_type }}" - set_fact: - oo_first_master: "{{ item }}" - with_items: master_names.split() - - debug: var=oo_first_master + a_master: "{{ master_names[0] }}" + - add_host: name={{ a_master }} groups=service_master - include: update.yml - name: Deploy OpenShift Services - hosts: oo_first_master + hosts: service_master connection: ssh gather_facts: yes - vars_files: - - vars.yml roles: - - openshift_docker_registry + - openshift_registry - openshift_router +- include: ../../common/openshift-cluster/create_services.yml + vars: + create_services__master: "{{ service_master }}" + - include: list.yml -- cgit v1.2.3 From 9873607d36f974114da1177451761ee053e38d71 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 29 May 2015 14:35:48 -0700 Subject: Install fluentd on nodes and master * Configure fluentd to aggragate container logs --- playbooks/common/openshift-master/config.yml | 1 + playbooks/common/openshift-node/config.yml | 1 + 2 files changed, 2 insertions(+) (limited to 'playbooks') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 05822d118..2566f979e 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -6,6 +6,7 @@ roles: - openshift_master - { role: openshift_sdn_master, when: openshift.common.use_openshift_sdn | bool } + - fluentd_master tasks: - name: Create group for deployment type group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }} diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 96641a274..b371312bc 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -96,6 +96,7 @@ roles: - openshift_node - { role: openshift_sdn_node, when: openshift.common.use_openshift_sdn | bool } + - fluentd_node tasks: - name: Create group for deployment type group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }} -- cgit v1.2.3 From 205b22f62b91deebaf87c1e33c8f76631d8ce2d5 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 1 Jun 2015 10:40:08 -0700 Subject: * Make fluentd deployment optional with openshift_use_fluentd --- playbooks/common/openshift-master/config.yml | 2 +- playbooks/common/openshift-node/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'playbooks') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 2566f979e..4df64e95f 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -6,7 +6,7 @@ roles: - openshift_master - { role: openshift_sdn_master, when: openshift.common.use_openshift_sdn | bool } - - fluentd_master + - { role: fluentd_master, when openshift.common.use_fluentd | bool } tasks: - name: Create group for deployment type group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }} diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index b371312bc..70711e39b 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -96,7 +96,7 @@ roles: - openshift_node - { role: openshift_sdn_node, when: openshift.common.use_openshift_sdn | bool } - - fluentd_node + - { role: fluentd_node, when: openshift.common.use_fluentd | bool } tasks: - name: Create group for deployment type group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }} -- cgit v1.2.3 From a2d9ea46fce456b2d4f890d6d321fa36e5cc6e2e Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Mon, 1 Jun 2015 11:49:22 -0700 Subject: * Rename create_services__master to g_svc_master --- playbooks/aws/openshift-cluster/launch.yml | 2 +- playbooks/common/openshift-cluster/create_services.yml | 8 +------- playbooks/gce/openshift-cluster/launch.yml | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'playbooks') diff --git a/playbooks/aws/openshift-cluster/launch.yml b/playbooks/aws/openshift-cluster/launch.yml index f64925124..33e1ec25d 100644 --- a/playbooks/aws/openshift-cluster/launch.yml +++ b/playbooks/aws/openshift-cluster/launch.yml @@ -33,6 +33,6 @@ - include: ../../common/openshift-cluster/create_services.yml vars: - create_services__master: "{{ service_master }}" + g_svc_master: "{{ service_master }}" - include: list.yml diff --git a/playbooks/common/openshift-cluster/create_services.yml b/playbooks/common/openshift-cluster/create_services.yml index c85db5234..e70709d19 100644 --- a/playbooks/common/openshift-cluster/create_services.yml +++ b/playbooks/common/openshift-cluster/create_services.yml @@ -1,12 +1,6 @@ --- -- name: Debug Deploy OpenShift Services - hosts: localhost - gather_facts: no - tasks: - - debug: var=create_services__master - - name: Deploy OpenShift Services - hosts: "{{ create_services__master }}" + hosts: "{{ g_svc_master }}" connection: ssh gather_facts: yes roles: diff --git a/playbooks/gce/openshift-cluster/launch.yml b/playbooks/gce/openshift-cluster/launch.yml index 53d461183..35737f03d 100644 --- a/playbooks/gce/openshift-cluster/launch.yml +++ b/playbooks/gce/openshift-cluster/launch.yml @@ -39,6 +39,6 @@ - include: ../../common/openshift-cluster/create_services.yml vars: - create_services__master: "{{ service_master }}" + g_svc_master: "{{ service_master }}" - include: list.yml -- cgit v1.2.3 From 67afaa13ee375def01960004195254b46cddd0db Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 3 Jun 2015 09:29:46 -0700 Subject: Infrastructure - Add service action to bin/cluster * Add necessary playbooks/roles * Cleanup bin/cluster to meet new design guide lines --- playbooks/aws/openshift-cluster/service.yml | 28 ++++++++++++++++++++++ playbooks/common/openshift-master/service.yml | 18 ++++++++++++++ playbooks/common/openshift-node/service.yml | 18 ++++++++++++++ playbooks/gce/openshift-cluster/service.yml | 28 ++++++++++++++++++++++ playbooks/gce/openshift-cluster/wip.yml | 26 ++++++++++++++++++++ playbooks/libvirt/openshift-cluster/service.yml | 32 +++++++++++++++++++++++++ 6 files changed, 150 insertions(+) create mode 100644 playbooks/aws/openshift-cluster/service.yml create mode 100644 playbooks/common/openshift-master/service.yml create mode 100644 playbooks/common/openshift-node/service.yml create mode 100644 playbooks/gce/openshift-cluster/service.yml create mode 100644 playbooks/gce/openshift-cluster/wip.yml create mode 100644 playbooks/libvirt/openshift-cluster/service.yml (limited to 'playbooks') 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/common/openshift-master/service.yml b/playbooks/common/openshift-master/service.yml new file mode 100644 index 000000000..5636ad156 --- /dev/null +++ b/playbooks/common/openshift-master/service.yml @@ -0,0 +1,18 @@ +--- +- name: Populate g_service_masters host group if needed + hosts: localhost + gather_facts: no + tasks: + - fail: msg="new_cluster_state is required to be injected in this playbook" + when: new_cluster_state is not defined + + - name: Evaluate g_service_masters + add_host: name={{ item }} groups=g_service_masters + with_items: oo_host_group_exp | default([]) + +- name: Change openshift-master state on master instance(s) + hosts: g_service_masters + connection: ssh + gather_facts: no + tasks: + - service: name=openshift-master state="{{ new_cluster_state }}" diff --git a/playbooks/common/openshift-node/service.yml b/playbooks/common/openshift-node/service.yml new file mode 100644 index 000000000..f76df089f --- /dev/null +++ b/playbooks/common/openshift-node/service.yml @@ -0,0 +1,18 @@ +--- +- name: Populate g_service_nodes host group if needed + hosts: localhost + gather_facts: no + tasks: + - fail: msg="new_cluster_state is required to be injected in this playbook" + when: new_cluster_state is not defined + + - name: Evaluate g_service_nodes + add_host: name={{ item }} groups=g_service_nodes + with_items: oo_host_group_exp | default([]) + +- name: Change openshift-node state on node instance(s) + hosts: g_service_nodes + connection: ssh + gather_facts: no + tasks: + - service: name=openshift-node state="{{ new_cluster_state }}" diff --git a/playbooks/gce/openshift-cluster/service.yml b/playbooks/gce/openshift-cluster/service.yml new file mode 100644 index 000000000..2d0f2ab95 --- /dev/null +++ b/playbooks/gce/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 + + - set_fact: scratch_group=tag_env-host-type-{{ cluster_id }}-openshift-node + - add_host: + name: "{{ item }}" + groups: g_service_nodes + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated) + + - set_fact: scratch_group=tag_env-host-type-{{ cluster_id }}-openshift-master + - add_host: + name: "{{ item }}" + groups: g_service_masters + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + with_items: groups[scratch_group] | default([]) | difference(['localhost']) | difference(groups.status_terminated) + +- include: ../../common/openshift-node/service.yml +- include: ../../common/openshift-master/service.yml diff --git a/playbooks/gce/openshift-cluster/wip.yml b/playbooks/gce/openshift-cluster/wip.yml new file mode 100644 index 000000000..51a521a6b --- /dev/null +++ b/playbooks/gce/openshift-cluster/wip.yml @@ -0,0 +1,26 @@ +--- +- name: WIP + hosts: localhost + connection: local + gather_facts: no + vars_files: + - vars.yml + tasks: + - name: Evaluate oo_masters_for_deploy + add_host: + name: "{{ item }}" + groups: oo_masters_for_deploy + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user | default(ansible_ssh_user, true) }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + with_items: groups["tag_env-host-type-{{ cluster_id }}-openshift-master"] | default([]) + +- name: Deploy OpenShift Services + hosts: oo_masters_for_deploy + connection: ssh + gather_facts: yes + user: root + vars_files: + - vars.yml + roles: + - openshift_registry + - openshift_router diff --git a/playbooks/libvirt/openshift-cluster/service.yml b/playbooks/libvirt/openshift-cluster/service.yml new file mode 100644 index 000000000..ae095f5a2 --- /dev/null +++ b/playbooks/libvirt/openshift-cluster/service.yml @@ -0,0 +1,32 @@ +--- +# TODO: need to figure out a plan for setting hostname, currently the default +# is localhost, so no hostname value (or public_hostname) value is getting +# assigned + +- 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 }}" + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + groups: g_service_masters + with_items: groups["tag_env-host-type-{{ cluster_id }}-openshift-master"] | default([]) + + - name: Evaluate g_service_nodes + add_host: + name: "{{ item }}" + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + groups: g_service_nodes + with_items: groups["tag_env-host-type-{{ cluster_id }}-openshift-node"] | default([]) + +- include: ../../common/openshift-node/service.yml +- include: ../../common/openshift-master/service.yml -- cgit v1.2.3 From 2283750d0ad8b24a823f034ebd6172526c535943 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Sat, 6 Jun 2015 13:40:18 -0400 Subject: add use_fluentd to openshift_facts - Move use_fluentd into openshift_facts proper - default use_fluentd to False unless deployment_type == origin --- playbooks/common/openshift-master/config.yml | 6 ++++-- playbooks/common/openshift-node/config.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'playbooks') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 4df64e95f..a9a4e6afc 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -5,8 +5,10 @@ openshift_sdn_master_url: https://{{ openshift.common.hostname }}:4001 roles: - openshift_master - - { role: openshift_sdn_master, when: openshift.common.use_openshift_sdn | bool } - - { role: fluentd_master, when openshift.common.use_fluentd | bool } + - role: openshift_sdn_master + when: openshift.common.use_openshift_sdn | bool + - role: fluentd_master + when: openshift.common.use_fluentd | bool tasks: - name: Create group for deployment type group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }} diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 70711e39b..55abedfe7 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -95,8 +95,10 @@ dest: "{{ openshift_node_cert_dir }}" roles: - openshift_node - - { role: openshift_sdn_node, when: openshift.common.use_openshift_sdn | bool } - - { role: fluentd_node, when: openshift.common.use_fluentd | bool } + - role: openshift_sdn_node + when: openshift.common.use_openshift_sdn | bool + - role: fluentd_node + when: openshift.common.use_fluentd | bool tasks: - name: Create group for deployment type group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }} -- cgit v1.2.3 From 5bd864d11b08370581b9cba219862ff4f578eca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Sun, 7 Jun 2015 23:35:24 +0200 Subject: Fix libvirt playbook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we don’t explicitly specify the libvirt URI to use for virsh, it will use the LIBVIRT_DEFAULT_URI environment variable. For a consistent behavior, all `virsh` invocation must be done with the `-c ` parameter. --- playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'playbooks') diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index 8bf1e84ee..8291192ab 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml @@ -59,14 +59,14 @@ with_items: instances - name: Wait for the VMs to get an IP - shell: 'virsh net-dhcp-leases openshift-ansible | egrep -c ''{{ instances | join("|") }}''' + shell: 'virsh -c {{ libvirt_uri }} net-dhcp-leases openshift-ansible | egrep -c ''{{ instances | join("|") }}''' register: nb_allocated_ips until: nb_allocated_ips.stdout == '{{ instances | length }}' retries: 30 delay: 1 - name: Collect IP addresses of the VMs - shell: 'virsh net-dhcp-leases openshift-ansible | awk ''$6 == "{{ item }}" {gsub(/\/.*/, "", $5); print $5}''' + shell: 'virsh -c {{ libvirt_uri }} net-dhcp-leases openshift-ansible | awk ''$6 == "{{ item }}" {gsub(/\/.*/, "", $5); print $5}''' register: scratch_ip with_items: instances -- cgit v1.2.3 From 901f0ee491efb34f9788e11dd6d572928146da91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Mon, 20 Apr 2015 14:11:48 +0200 Subject: Implement OpenStack provider --- playbooks/openstack/openshift-cluster/config.yml | 34 +++++ .../openshift-cluster/files/heat_stack.yml | 149 +++++++++++++++++++++ .../openstack/openshift-cluster/files/user-data | 7 + .../openstack/openshift-cluster/filter_plugins | 1 + playbooks/openstack/openshift-cluster/launch.yml | 31 +++++ playbooks/openstack/openshift-cluster/list.yml | 24 ++++ playbooks/openstack/openshift-cluster/roles | 1 + .../tasks/configure_openstack.yml | 27 ++++ .../openshift-cluster/tasks/launch_instances.yml | 48 +++++++ .../openstack/openshift-cluster/terminate.yml | 43 ++++++ playbooks/openstack/openshift-cluster/update.yml | 18 +++ playbooks/openstack/openshift-cluster/vars.yml | 39 ++++++ 12 files changed, 422 insertions(+) create mode 100644 playbooks/openstack/openshift-cluster/config.yml create mode 100644 playbooks/openstack/openshift-cluster/files/heat_stack.yml create mode 100644 playbooks/openstack/openshift-cluster/files/user-data create mode 120000 playbooks/openstack/openshift-cluster/filter_plugins create mode 100644 playbooks/openstack/openshift-cluster/launch.yml create mode 100644 playbooks/openstack/openshift-cluster/list.yml create mode 120000 playbooks/openstack/openshift-cluster/roles create mode 100644 playbooks/openstack/openshift-cluster/tasks/configure_openstack.yml create mode 100644 playbooks/openstack/openshift-cluster/tasks/launch_instances.yml create mode 100644 playbooks/openstack/openshift-cluster/terminate.yml create mode 100644 playbooks/openstack/openshift-cluster/update.yml create mode 100644 playbooks/openstack/openshift-cluster/vars.yml (limited to 'playbooks') diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml new file mode 100644 index 000000000..1c0644e04 --- /dev/null +++ b/playbooks/openstack/openshift-cluster/config.yml @@ -0,0 +1,34 @@ +- name: Populate oo_masters_to_config host group + hosts: localhost + gather_facts: no + vars_files: + - vars.yml + tasks: + - name: Evaluate oo_masters_to_config + add_host: + name: "{{ item }}" + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + groups: oo_masters_to_config + with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-master"] | default([]) + - name: Evaluate oo_nodes_to_config + add_host: + name: "{{ item }}" + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + groups: oo_nodes_to_config + with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([]) + - name: Evaluate oo_first_master + add_host: + name: "{{ groups['tag_env-host-type_' ~ cluster_id ~ '-openshift-master'][0] }}" + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + groups: oo_first_master + when: "'tag_env-host-type_{{ cluster_id }}-openshift-master' in groups" + +- include: ../../common/openshift-cluster/config.yml + vars: + openshift_cluster_id: "{{ cluster_id }}" + openshift_debug_level: 4 + openshift_deployment_type: "{{ deployment_type }}" + openshift_hostname: "{{ ansible_default_ipv4.address }}" diff --git a/playbooks/openstack/openshift-cluster/files/heat_stack.yml b/playbooks/openstack/openshift-cluster/files/heat_stack.yml new file mode 100644 index 000000000..c5f95d87d --- /dev/null +++ b/playbooks/openstack/openshift-cluster/files/heat_stack.yml @@ -0,0 +1,149 @@ +heat_template_version: 2014-10-16 + +description: OpenShift cluster + +parameters: + cluster-id: + type: string + label: Cluster ID + description: Identifier of the cluster + + network-prefix: + type: string + label: Network prefix + description: Prefix of the network objects + + cidr: + type: string + label: CIDR + description: CIDR of the network of the cluster + + dns-nameservers: + type: comma_delimited_list + label: DNS nameservers list + description: List of DNS nameservers + + external-net: + type: string + label: External network + description: Name of the external network + default: external + + ssh-incoming: + type: string + label: Source of ssh connections + description: Source of legitimate ssh connections + +resources: + net: + type: OS::Neutron::Net + properties: + name: + str_replace: + template: network-prefix-net + params: + network-prefix: { get_param: network-prefix } + + subnet: + type: OS::Neutron::Subnet + properties: + name: + str_replace: + template: network-prefix-subnet + params: + network-prefix: { get_param: network-prefix } + network: { get_resource: net } + cidr: { get_param: cidr } + dns_nameservers: { get_param: dns-nameservers } + + router: + type: OS::Neutron::Router + properties: + name: + str_replace: + template: network-prefix-router + params: + network-prefix: { get_param: network-prefix } + external_gateway_info: + network: { get_param: external-net } + + interface: + type: OS::Neutron::RouterInterface + properties: + router_id: { get_resource: router } + subnet_id: { get_resource: subnet } + + node-secgrp: + type: OS::Neutron::SecurityGroup + properties: + name: + str_replace: + template: network-prefix-node-secgrp + params: + network-prefix: { get_param: network-prefix } + description: + str_replace: + template: Security group for cluster-id OpenShift cluster nodes + params: + cluster-id: { get_param: cluster-id } + rules: + - direction: ingress + protocol: tcp + port_range_min: 22 + port_range_max: 22 + remote_ip_prefix: { get_param: ssh-incoming } + - direction: ingress + protocol: udp + port_range_min: 4789 + port_range_max: 4789 + remote_mode: remote_group_id + - direction: ingress + protocol: tcp + port_range_min: 10250 + port_range_max: 10250 + remote_mode: remote_group_id + remote_group_id: { get_resource: master-secgrp } + + master-secgrp: + type: OS::Neutron::SecurityGroup + properties: + name: + str_replace: + template: network-prefix-master-secgrp + params: + network-prefix: { get_param: network-prefix } + description: + str_replace: + template: Security group for cluster-id OpenShift cluster master + params: + cluster-id: { get_param: cluster-id } + rules: + - direction: ingress + protocol: tcp + port_range_min: 22 + port_range_max: 22 + remote_ip_prefix: { get_param: ssh-incoming } + - direction: ingress + protocol: tcp + port_range_min: 4001 + port_range_max: 4001 + - direction: ingress + protocol: tcp + port_range_min: 8443 + port_range_max: 8443 + - direction: ingress + protocol: tcp + port_range_min: 53 + port_range_max: 53 + - direction: ingress + protocol: udp + port_range_min: 53 + port_range_max: 53 + - direction: ingress + protocol: tcp + port_range_min: 24224 + port_range_max: 24224 + - direction: ingress + protocol: udp + port_range_min: 24224 + port_range_max: 24224 diff --git a/playbooks/openstack/openshift-cluster/files/user-data b/playbooks/openstack/openshift-cluster/files/user-data new file mode 100644 index 000000000..e789a5b69 --- /dev/null +++ b/playbooks/openstack/openshift-cluster/files/user-data @@ -0,0 +1,7 @@ +#cloud-config +disable_root: true + +system_info: + default_user: + name: openshift + sudo: ["ALL=(ALL) NOPASSWD: ALL"] diff --git a/playbooks/openstack/openshift-cluster/filter_plugins b/playbooks/openstack/openshift-cluster/filter_plugins new file mode 120000 index 000000000..99a95e4ca --- /dev/null +++ b/playbooks/openstack/openshift-cluster/filter_plugins @@ -0,0 +1 @@ +../../../filter_plugins \ No newline at end of file diff --git a/playbooks/openstack/openshift-cluster/launch.yml b/playbooks/openstack/openshift-cluster/launch.yml new file mode 100644 index 000000000..5c86ade3f --- /dev/null +++ b/playbooks/openstack/openshift-cluster/launch.yml @@ -0,0 +1,31 @@ +--- +- name: Launch instance(s) + hosts: localhost + connection: local + gather_facts: no + vars_files: + - vars.yml + tasks: + - fail: + msg: "Deployment type not supported for OpenStack provider yet" + when: deployment_type in ['online', 'enterprise'] + + - include: tasks/configure_openstack.yml + + - include: ../../common/openshift-cluster/set_master_launch_facts_tasks.yml + - include: tasks/launch_instances.yml + vars: + instances: "{{ master_names }}" + cluster: "{{ cluster_id }}" + type: "{{ k8s_type }}" + + - include: ../../common/openshift-cluster/set_node_launch_facts_tasks.yml + - include: tasks/launch_instances.yml + vars: + instances: "{{ node_names }}" + cluster: "{{ cluster_id }}" + type: "{{ k8s_type }}" + +- include: update.yml + +- include: list.yml diff --git a/playbooks/openstack/openshift-cluster/list.yml b/playbooks/openstack/openshift-cluster/list.yml new file mode 100644 index 000000000..a75e350c7 --- /dev/null +++ b/playbooks/openstack/openshift-cluster/list.yml @@ -0,0 +1,24 @@ +--- +- name: Generate oo_list_hosts group + hosts: localhost + gather_facts: no + vars_files: + - vars.yml + tasks: + - set_fact: scratch_group=tag_env_{{ cluster_id }} + when: cluster_id != '' + - set_fact: scratch_group=all + when: cluster_id == '' + - add_host: + name: "{{ item }}" + groups: oo_list_hosts + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_ssh_host: "{{ hostvars[item].ansible_ssh_host | default(item) }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + with_items: groups[scratch_group] | default([]) | difference(['localhost']) + +- name: List Hosts + hosts: oo_list_hosts + tasks: + - debug: + msg: 'public:{{ansible_ssh_host}} private:{{ansible_default_ipv4.address}}' diff --git a/playbooks/openstack/openshift-cluster/roles b/playbooks/openstack/openshift-cluster/roles new file mode 120000 index 000000000..20c4c58cf --- /dev/null +++ b/playbooks/openstack/openshift-cluster/roles @@ -0,0 +1 @@ +../../../roles \ No newline at end of file diff --git a/playbooks/openstack/openshift-cluster/tasks/configure_openstack.yml b/playbooks/openstack/openshift-cluster/tasks/configure_openstack.yml new file mode 100644 index 000000000..2cbdb4805 --- /dev/null +++ b/playbooks/openstack/openshift-cluster/tasks/configure_openstack.yml @@ -0,0 +1,27 @@ +--- +- name: Check infra + command: 'heat stack-show {{ openstack_network_prefix }}-stack' + register: stack_show_result + changed_when: false + failed_when: stack_show_result.rc != 0 and 'Stack not found' not in stack_show_result.stderr + +- name: Create infra + command: 'heat stack-create -f {{ openstack_infra_heat_stack }} -P cluster-id={{ cluster_id }} -P network-prefix={{ openstack_network_prefix }} -P dns-nameservers={{ openstack_network_dns | join(",") }} -P cidr={{ openstack_network_cidr }} -P ssh-incoming={{ openstack_ssh_access_from }} {{ openstack_network_prefix }}-stack' + when: stack_show_result.rc == 1 + +- name: Update infra + command: 'heat stack-update -f {{ openstack_infra_heat_stack }} -P cluster-id={{ cluster_id }} -P network-prefix={{ openstack_network_prefix }} -P dns-nameservers={{ openstack_network_dns | join(",") }} -P cidr={{ openstack_network_cidr }} -P ssh-incoming={{ openstack_ssh_access_from }} {{ openstack_network_prefix }}-stack' + when: stack_show_result.rc == 0 + +- name: Wait for infra readiness + shell: 'heat stack-show {{ openstack_network_prefix }}-stack | awk ''$2 == "stack_status" {print $4}''' + register: stack_show_status_result + until: stack_show_status_result.stdout not in ['CREATE_IN_PROGRESS', 'UPDATE_IN_PROGRESS'] + retries: 30 + delay: 1 + failed_when: stack_show_status_result.stdout not in ['CREATE_COMPLETE', 'UPDATE_COMPLETE'] + +- name: Create ssh keypair + nova_keypair: + name: "{{ openstack_ssh_keypair }}" + public_key: "{{ openstack_ssh_public_key }}" diff --git a/playbooks/openstack/openshift-cluster/tasks/launch_instances.yml b/playbooks/openstack/openshift-cluster/tasks/launch_instances.yml new file mode 100644 index 000000000..1b9696aac --- /dev/null +++ b/playbooks/openstack/openshift-cluster/tasks/launch_instances.yml @@ -0,0 +1,48 @@ +--- +- name: Get net id + shell: 'neutron net-show {{ openstack_network_prefix }}-net | awk "/\\/ {print \$4}"' + register: net_id_result + +- name: Launch instance(s) + nova_compute: + name: '{{ item }}' + image_name: '{{ deployment_vars[deployment_type].image.name | default(omit, true) }}' + image_id: '{{ deployment_vars[deployment_type].image.id | default(omit, true) }}' + flavor_ram: '{{ openstack_flavor[k8s_type].ram | default(omit, true) }}' + flavor_id: '{{ openstack_flavor[k8s_type].id | default(omit, true) }}' + flavor_include: '{{ openstack_flavor[k8s_type].include | default(omit, true) }}' + key_name: '{{ openstack_ssh_keypair }}' + security_groups: '{{ openstack_network_prefix }}-{{ k8s_type }}-secgrp' + nics: + - net-id: '{{ net_id_result.stdout }}' + user_data: "{{ lookup('file','files/user-data') }}" + meta: + env: '{{ cluster }}' + host-type: '{{ type }}' + env-host-type: '{{ cluster }}-openshift-{{ type }}' + floating_ip_pools: '{{ openstack_floating_ip_pools }}' + with_items: instances + register: nova_compute_result + +- name: Add new instances groups and variables + add_host: + hostname: '{{ item.item }}' + ansible_ssh_host: '{{ item.public_ip }}' + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + groups: 'tag_env_{{ cluster }}, tag_host-type_{{ type }}, tag_env-host-type_{{ cluster }}-openshift-{{ type }}' + with_items: nova_compute_result.results + +- name: Wait for ssh + wait_for: + host: '{{ item.public_ip }}' + port: 22 + with_items: nova_compute_result.results + +- name: Wait for user setup + command: 'ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null {{ hostvars[item.item].ansible_ssh_user }}@{{ item.public_ip }} echo {{ hostvars[item.item].ansible_ssh_user }} user is setup' + register: result + until: result.rc == 0 + retries: 30 + delay: 1 + with_items: nova_compute_result.results diff --git a/playbooks/openstack/openshift-cluster/terminate.yml b/playbooks/openstack/openshift-cluster/terminate.yml new file mode 100644 index 000000000..2f05f0992 --- /dev/null +++ b/playbooks/openstack/openshift-cluster/terminate.yml @@ -0,0 +1,43 @@ +- name: Terminate instance(s) + hosts: localhost + connection: local + gather_facts: no + vars_files: + - vars.yml + tasks: + - set_fact: cluster_group=tag_env_{{ cluster_id }} + - add_host: + name: "{{ item }}" + groups: oo_hosts_to_terminate + ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" + ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" + with_items: groups[cluster_group] | default([]) + +- hosts: oo_hosts_to_terminate + +- hosts: localhost + connection: local + gather_facts: no + vars_files: + - vars.yml + tasks: + - name: Retrieve the floating IPs + shell: "neutron floatingip-list | awk '/{{ hostvars[item].ansible_default_ipv4.address }}/ {print $2}'" + with_items: groups['oo_hosts_to_terminate'] | default([]) + register: floating_ips_to_delete + + - name: Terminate instance(s) + nova_compute: + name: "{{ hostvars[item].os_name }}" + state: absent + with_items: groups['oo_hosts_to_terminate'] | default([]) + + - name: Delete floating IPs + command: "neutron floatingip-delete {{ item.stdout }}" + with_items: floating_ips_to_delete.results | default([]) + + - name: Destroy the network + command: "heat stack-delete {{ openstack_network_prefix }}-stack" + register: stack_delete_result + changed_when: stack_delete_result.rc == 0 + failed_when: stack_delete_result.rc != 0 and 'could not be found' not in stack_delete_result.stdout diff --git a/playbooks/openstack/openshift-cluster/update.yml b/playbooks/openstack/openshift-cluster/update.yml new file mode 100644 index 000000000..5e7ab4e58 --- /dev/null +++ b/playbooks/openstack/openshift-cluster/update.yml @@ -0,0 +1,18 @@ +--- +- name: Populate oo_hosts_to_update group + hosts: localhost + gather_facts: no + vars_files: + - vars.yml + tasks: + - name: Evaluate oo_hosts_to_update + add_host: + name: "{{ item }}" + groups: oo_hosts_to_update + 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"] | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-node"]) | default([]) + +- include: ../../common/openshift-cluster/update_repos_and_packages.yml + +- include: config.yml diff --git a/playbooks/openstack/openshift-cluster/vars.yml b/playbooks/openstack/openshift-cluster/vars.yml new file mode 100644 index 000000000..c754f19fc --- /dev/null +++ b/playbooks/openstack/openshift-cluster/vars.yml @@ -0,0 +1,39 @@ +--- +openstack_infra_heat_stack: "{{ opt_infra_heat_stack | default('files/heat_stack.yml') }}" +openstack_network_prefix: "{{ opt_network_prefix | default('openshift-ansible-'+cluster_id) }}" +openstack_network_cidr: "{{ opt_net_cidr | default('192.168.' + ( ( 1048576 | random % 256 ) | string() ) + '.0/24') }}" +openstack_network_external_net: "{{ opt_external_net | default('external') }}" +openstack_floating_ip_pools: "{{ opt_floating_ip_pools | default('external') | oo_split() }}" +openstack_network_dns: "{{ opt_dns | default('8.8.8.8,8.8.4.4') | oo_split() }}" +openstack_ssh_keypair: "{{ opt_keypair | default(lookup('env', 'LOGNAME')+'_key') }}" +openstack_ssh_public_key: "{{ lookup('file', opt_public_key | default('~/.ssh/id_rsa.pub')) }}" +openstack_ssh_access_from: "{{ opt_ssh_from | default('0.0.0.0/0') }}" +openstack_flavor: + master: + ram: "{{ opt_master_flavor_ram | default(2048) }}" + id: "{{ opt_master_flavor_id | default() }}" + include: "{{ opt_master_flavor_include | default() }}" + node: + ram: "{{ opt_node_flavor_ram | default(4096) }}" + id: "{{ opt_node_flavor_id | default() }}" + include: "{{ opt_node_flavor_include | default() }}" + +deployment_vars: + origin: + image: + name: "{{ opt_image_name | default('centos-70-raw') }}" + id: + ssh_user: openshift + sudo: yes + online: + image: + name: + id: + ssh_user: root + sudo: no + enterprise: + image: + name: "{{ opt_image_name | default('centos-70-raw') }}" + id: + ssh_user: openshift + sudo: yes -- cgit v1.2.3 From 3b660e9b3f3859d69371f12e18922274db7ad026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Mon, 8 Jun 2015 09:32:59 +0200 Subject: Replace the custom oo_len filter by the Jinja2 standard one: length --- playbooks/aws/ansible-tower/launch.yml | 2 +- playbooks/aws/openshift-cluster/tasks/launch_instances.yml | 2 +- playbooks/aws/openshift-master/launch.yml | 2 +- playbooks/aws/openshift-node/launch.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'playbooks') diff --git a/playbooks/aws/ansible-tower/launch.yml b/playbooks/aws/ansible-tower/launch.yml index c23bda3a0..4bcc8b8dc 100644 --- a/playbooks/aws/ansible-tower/launch.yml +++ b/playbooks/aws/ansible-tower/launch.yml @@ -22,7 +22,7 @@ group_id: "{{ oo_security_group_ids }}" instance_type: c4.xlarge image: "{{ rhel7_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" + count: "{{ oo_new_inst_names | length }}" user_data: "{{ lookup('file', user_data_file) }}" wait: yes assign_public_ip: "{{ oo_assign_public_ip }}" diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml index 666a8d1fb..4f594e2ed 100644 --- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml @@ -79,7 +79,7 @@ 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 }}" diff --git a/playbooks/aws/openshift-master/launch.yml b/playbooks/aws/openshift-master/launch.yml index 51a0258f0..1cefad492 100644 --- a/playbooks/aws/openshift-master/launch.yml +++ b/playbooks/aws/openshift-master/launch.yml @@ -19,7 +19,7 @@ group: ['public'] instance_type: m3.large image: "{{ g_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" + count: "{{ oo_new_inst_names | length }}" user_data: "{{ lookup('file', user_data_file) }}" wait: yes register: ec2 diff --git a/playbooks/aws/openshift-node/launch.yml b/playbooks/aws/openshift-node/launch.yml index d6024a020..e7d1f7310 100644 --- a/playbooks/aws/openshift-node/launch.yml +++ b/playbooks/aws/openshift-node/launch.yml @@ -19,7 +19,7 @@ group: ['public'] instance_type: m3.large image: "{{ g_ami }}" - count: "{{ oo_new_inst_names | oo_len }}" + count: "{{ oo_new_inst_names | length }}" user_data: "{{ lookup('file', user_data_file) }}" wait: yes register: ec2 -- cgit v1.2.3 From 21b4f324c38f2131d63c7004875587dc5cca0b6d Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Tue, 9 Jun 2015 15:23:38 -0400 Subject: added environment tag (will eventually replace env tag). --- playbooks/aws/openshift-cluster/tasks/launch_instances.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'playbooks') diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml index 4f594e2ed..060147659 100644 --- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml @@ -86,6 +86,7 @@ wait: yes instance_tags: created-by: "{{ created_by }}" + environment: "{{ env }}" env: "{{ env }}" host-type: "{{ host_type }}" env-host-type: "{{ env_host_type }}" -- cgit v1.2.3 From b57392ddd54bbff225ba83dd5a5bf40ea99344a4 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 30 Apr 2015 17:04:15 -0400 Subject: Accomodate upstream configuration change - Master config and certificates are now in /etc/openshift/master - Node config is now in /etc/openshift/node - Several certificates have been renamed to accomodate a flattening of structure to accomodate secret storage - Add openshift_data_dir to ensure etcd and volumes are stored in /var/lib/openshift - Add openshift_generated_configs_dir --- playbooks/common/openshift-node/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'playbooks') diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 55abedfe7..feaeaab95 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -60,7 +60,7 @@ - name: Create a tarball of the node config directories command: tar -czvf {{ sync_tmpdir }}/{{ item.openshift.common.hostname }}.tgz ./ args: - chdir: "{{ openshift_cert_dir }}/node-{{ item.openshift.common.hostname }}" + chdir: "{{ openshift_generated_configs_dir }}/node-{{ item.openshift.common.hostname }}" with_items: openshift_nodes changed_when: False -- cgit v1.2.3 From 94a77cb1d81b6e4e316ae679890df4994816532f Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 22 May 2015 13:13:17 -0400 Subject: Templatize configs and 0.5.2 changes - Templatize node config - Templatize master config - Integrated sdn changes - Updates for openshift_facts - Added support for node, master and sdn related changes - registry_url - added identity provider facts - Removed openshift_sdn_* roles - Install httpd-tools if configuring htpasswd auth - Remove references to external_id - Setting external_id interferes with nodes associating with the generated node object when pre-registering nodes. - osc/oc and osadm/oadm binary detection in openshift_facts Misc Changes: - make non-errata puddle default for byo example - comment out master in list of nodes in inventory/byo/hosts - remove non-error errors from fluentd_* roles - Use admin kubeconfig instead of openshift-client --- playbooks/aws/openshift-cluster/config.yml | 1 + playbooks/aws/openshift-node/config.yml | 1 + playbooks/byo/openshift-node/config.yml | 4 +- playbooks/common/openshift-master/config.yml | 4 -- playbooks/common/openshift-node/config.yml | 80 ++++++++++++------------ playbooks/gce/openshift-cluster/config.yml | 1 + playbooks/gce/openshift-node/config.yml | 1 + playbooks/libvirt/openshift-cluster/config.yml | 1 + playbooks/openstack/openshift-cluster/config.yml | 1 + 9 files changed, 50 insertions(+), 44 deletions(-) (limited to 'playbooks') 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-node/config.yml b/playbooks/aws/openshift-node/config.yml index fc9b397b4..a993a1e99 100644 --- a/playbooks/aws/openshift-node/config.yml +++ b/playbooks/aws/openshift-node/config.yml @@ -21,5 +21,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/byo/openshift-node/config.yml b/playbooks/byo/openshift-node/config.yml index d569827b4..f50903061 100644 --- a/playbooks/byo/openshift-node/config.yml +++ b/playbooks/byo/openshift-node/config.yml @@ -10,12 +10,14 @@ with_items: groups.nodes - name: Evaluate oo_first_master add_host: - name: "{{ groups.masters[0] }}" + name: "{{ item }}" groups: oo_first_master + with_items: groups.masters.0 - include: ../../common/openshift-node/config.yml vars: + openshift_first_master: "{{ groups.masters.0 }}" openshift_cluster_id: "{{ cluster_id | default('default') }}" openshift_debug_level: 4 openshift_deployment_type: "{{ deployment_type }}" diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index a9a4e6afc..052ed14c7 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -1,12 +1,8 @@ --- - name: Configure master instances hosts: oo_masters_to_config - vars: - openshift_sdn_master_url: https://{{ openshift.common.hostname }}:4001 roles: - openshift_master - - role: openshift_sdn_master - when: openshift.common.use_openshift_sdn | bool - role: fluentd_master when: openshift.common.use_fluentd | bool tasks: diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index feaeaab95..a650796c7 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -4,9 +4,9 @@ roles: - openshift_facts tasks: - # Since the master is registering the nodes before they are configured, we - # need to make sure to set the node properties beforehand if we do not want - # the defaults + # Since the master is generating the node certificates before they are + # configured, we need to make sure to set the node properties beforehand if + # we do not want the defaults - openshift_facts: role: "{{ item.role }}" local_facts: "{{ item.local_facts }}" @@ -18,13 +18,26 @@ deployment_type: "{{ openshift_deployment_type }}" - role: node local_facts: - external_id: "{{ openshift_node_external_id | default(None) }}" resources_cpu: "{{ openshift_node_resources_cpu | default(None) }}" resources_memory: "{{ openshift_node_resources_memory | default(None) }}" pod_cidr: "{{ openshift_node_pod_cidr | default(None) }}" labels: "{{ openshift_node_labels | default(None) }}" annotations: "{{ openshift_node_annotations | default(None) }}" - + - name: Check status of node certificates + stat: + path: "{{ item }}" + with_items: + - "/etc/openshift/node/node.key" + - "/etc/openshift/node/node.kubeconfig" + - "/etc/openshift/node/ca.crt" + - "/etc/openshift/node/server.key" + register: stat_result + - set_fact: + certs_missing: "{{ stat_result.results | map(attribute='stat.exists') + | list | intersect([false])}}" + node_subdir: node-{{ openshift.common.hostname }} + config_dir: /etc/openshift/generated-configs/node-{{ openshift.common.hostname }} + node_cert_dir: /etc/openshift/node - name: Create temp directory for syncing certs hosts: localhost @@ -37,66 +50,57 @@ register: mktemp changed_when: False - - name: Register nodes hosts: oo_first_master vars: - openshift_nodes: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']) }}" + nodes_needing_certs: "{{ hostvars + | oo_select_keys(groups['oo_nodes_to_config']) + | oo_filter_list(filter_attr='certs_missing') }}" + openshift_nodes: "{{ hostvars + | oo_select_keys(groups['oo_nodes_to_config']) }}" sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}" roles: - openshift_register_nodes - tasks: - # TODO: update so that we only sync necessary configs/directories, currently - # we sync for all nodes in oo_nodes_to_config. We will need to inspect the - # configs on the nodes to make the determination on whether to sync or not. - - name: Create the temp directory on the master - file: - path: "{{ sync_tmpdir }}" - owner: "{{ ansible_ssh_user }}" - mode: 0700 - state: directory - changed_when: False - + post_tasks: - name: Create a tarball of the node config directories - command: tar -czvf {{ sync_tmpdir }}/{{ item.openshift.common.hostname }}.tgz ./ + command: > + tar -czvf {{ item.config_dir }}.tgz ./ + --transform 's|system:{{ item.node_subdir }}|node|' + -C {{ item.config_dir }} . args: - chdir: "{{ openshift_generated_configs_dir }}/node-{{ item.openshift.common.hostname }}" - with_items: openshift_nodes - changed_when: False + creates: "{{ item.config_dir }}.tgz" + with_items: nodes_needing_certs - name: Retrieve the node config tarballs from the master fetch: - src: "{{ sync_tmpdir }}/{{ item.openshift.common.hostname }}.tgz" + src: "{{ item.config_dir }}.tgz" dest: "{{ sync_tmpdir }}/" + flat: yes fail_on_missing: yes validate_checksum: yes - with_items: openshift_nodes - changed_when: False - + with_items: nodes_needing_certs - name: Configure node instances hosts: oo_nodes_to_config - gather_facts: no vars: - sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}/{{ groups['oo_first_master'][0] }}/{{ hostvars.localhost.mktemp.stdout }}" - openshift_sdn_master_url: "https://{{ hostvars[groups['oo_first_master'][0]].openshift.common.hostname }}:4001" + sync_tmpdir: "{{ hostvars.localhost.mktemp.stdout }}" + openshift_node_master_api_url: "{{ hostvars[openshift_first_master].openshift.master.api_url }}" pre_tasks: - name: Ensure certificate directory exists file: - path: "{{ openshift_node_cert_dir }}" + path: "{{ node_cert_dir }}" state: directory - # TODO: notify restart openshift-node and/or restart openshift-sdn-node, + # TODO: notify restart openshift-node # possibly test service started time against certificate/config file - # timestamps in openshift-node or openshift-sdn-node to trigger notify + # timestamps in openshift-node to trigger notify - name: Unarchive the tarball on the node unarchive: - src: "{{ sync_tmpdir }}/{{ openshift.common.hostname }}.tgz" - dest: "{{ openshift_node_cert_dir }}" + src: "{{ sync_tmpdir }}/{{ node_subdir }}.tgz" + dest: "{{ node_cert_dir }}" + when: certs_missing roles: - openshift_node - - role: openshift_sdn_node - when: openshift.common.use_openshift_sdn | bool - role: fluentd_node when: openshift.common.use_fluentd | bool tasks: @@ -113,7 +117,6 @@ - file: name={{ sync_tmpdir }} state=absent changed_when: False - - name: Delete temporary directory on localhost hosts: localhost connection: local @@ -123,7 +126,6 @@ - file: name={{ mktemp.stdout }} state=absent changed_when: False - # Additional config for online type deployments - name: Additional instance config hosts: oo_nodes_deployment_type_online diff --git a/playbooks/gce/openshift-cluster/config.yml b/playbooks/gce/openshift-cluster/config.yml index 8b8490246..8c320dbd2 100644 --- a/playbooks/gce/openshift-cluster/config.yml +++ b/playbooks/gce/openshift-cluster/config.yml @@ -34,4 +34,5 @@ openshift_cluster_id: "{{ cluster_id }}" openshift_debug_level: 4 openshift_deployment_type: "{{ deployment_type }}" + openshift_first_master: "{{ groups.oo_first_master.0 }}" openshift_hostname: "{{ gce_private_ip }}" diff --git a/playbooks/gce/openshift-node/config.yml b/playbooks/gce/openshift-node/config.yml index 5b1601176..54b0da2ca 100644 --- a/playbooks/gce/openshift-node/config.yml +++ b/playbooks/gce/openshift-node/config.yml @@ -21,4 +21,5 @@ openshift_cluster_id: "{{ cluster_id }}" openshift_debug_level: 4 openshift_deployment_type: "{{ deployment_type }}" + openshift_first_master: "{{ groups.oo_first_master.0 }}" openshift_hostname: "{{ gce_private_ip }}" diff --git a/playbooks/libvirt/openshift-cluster/config.yml b/playbooks/libvirt/openshift-cluster/config.yml index faf278b10..75e2005a2 100644 --- a/playbooks/libvirt/openshift-cluster/config.yml +++ b/playbooks/libvirt/openshift-cluster/config.yml @@ -36,3 +36,4 @@ openshift_cluster_id: "{{ cluster_id }}" openshift_debug_level: 4 openshift_deployment_type: "{{ deployment_type }}" + openshift_first_master: "{{ groups.oo_first_master.0 }}" diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml index 1c0644e04..abadaf5ca 100644 --- a/playbooks/openstack/openshift-cluster/config.yml +++ b/playbooks/openstack/openshift-cluster/config.yml @@ -31,4 +31,5 @@ openshift_cluster_id: "{{ cluster_id }}" openshift_debug_level: 4 openshift_deployment_type: "{{ deployment_type }}" + openshift_first_master: "{{ groups.oo_first_master.0 }}" openshift_hostname: "{{ ansible_default_ipv4.address }}" -- cgit v1.2.3 From 5176446e148679e7a75119a1bfe9088262365ff9 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Thu, 4 Jun 2015 14:34:27 -0400 Subject: Bugfixes - Don't include ./ in the tarball we transfer to the nodes - Fixup node argument ordering --- playbooks/common/openshift-node/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'playbooks') diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index a650796c7..9e642f3d3 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -64,7 +64,7 @@ post_tasks: - name: Create a tarball of the node config directories command: > - tar -czvf {{ item.config_dir }}.tgz ./ + tar -czvf {{ item.config_dir }}.tgz --transform 's|system:{{ item.node_subdir }}|node|' -C {{ item.config_dir }} . args: -- cgit v1.2.3