From aa52ca9e12267ce5cf43ebde4782ed6f2fc57150 Mon Sep 17 00:00:00 2001 From: Jonathan Steffan Date: Sun, 22 Nov 2015 19:51:21 -0700 Subject: Update for latest CentOS-7-x86_64-GenericCloud. - Use xz compressed image - Update sha256 for new image - Update docs to reflect new settings --- playbooks/libvirt/openshift-cluster/launch.yml | 1 + playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml | 9 ++++++++- playbooks/libvirt/openshift-cluster/vars.yml | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'playbooks') diff --git a/playbooks/libvirt/openshift-cluster/launch.yml b/playbooks/libvirt/openshift-cluster/launch.yml index 8d7949dd1..acb53440d 100644 --- a/playbooks/libvirt/openshift-cluster/launch.yml +++ b/playbooks/libvirt/openshift-cluster/launch.yml @@ -11,6 +11,7 @@ image_url: "{{ deployment_vars[deployment_type].image.url }}" image_sha256: "{{ deployment_vars[deployment_type].image.sha256 }}" image_name: "{{ deployment_vars[deployment_type].image.name }}" + image_compression: "{{ deployment_vars[deployment_type].image.compression }}" tasks: - fail: msg="Deployment type not supported for libvirt provider yet" when: deployment_type == 'online' diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index 4825207c9..e1e552c36 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml @@ -13,8 +13,15 @@ get_url: url: '{{ image_url }}' sha256sum: '{{ image_sha256 }}' - dest: '{{ os_libvirt_storage_pool_path }}/{{ image_name }}' + dest: '{{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | join(".") }}' when: '{{ ( lookup("oo_option", "skip_image_download") | default("no", True) | lower ) in ["false", "no"] }}' + register: downloaded_image + +- name: Uncompress Base Cloud image + command: 'unxz -kf {{ os_libvirt_storage_pool_path }}/{{ image_name }}.{{ image_compression }}' + args: + creates: '{{ os_libvirt_storage_pool_path }}/{{ image_name }}' + when: image_compression in ["xz"] and downloaded_image.changed - name: Create the cloud-init config drive path file: diff --git a/playbooks/libvirt/openshift-cluster/vars.yml b/playbooks/libvirt/openshift-cluster/vars.yml index c77a0797e..67cfbcdb8 100644 --- a/playbooks/libvirt/openshift-cluster/vars.yml +++ b/playbooks/libvirt/openshift-cluster/vars.yml @@ -8,11 +8,13 @@ deployment_vars: origin: image: url: "{{ lookup('oo_option', 'image_url') | - default('http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2', True) }}" + default('http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz', True) }}" + compression: "{{ lookup('oo_option', 'image_compression') | + default('xz', True) }}" name: "{{ lookup('oo_option', 'image_name') | default('CentOS-7-x86_64-GenericCloud.qcow2', True) }}" sha256: "{{ lookup('oo_option', 'image_sha256') | - default('e324e3ab1d24a1bbf035ddb365e7f9058c0b454acf48d7aa15c5519fae5998ab', True) }}" + default('9461006300d65172f5668d8875f2aad7b54f7ba4e9c5435d65a84a5a2d66e39b', True) }}" ssh_user: openshift sudo: yes online: -- cgit v1.2.3 From a69aedf1f23b3e1927ce81378ec5e07d8aa6c9fc Mon Sep 17 00:00:00 2001 From: Jonathan Steffan Date: Sun, 22 Nov 2015 19:57:53 -0700 Subject: Use join for the uncompress command. --- playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'playbooks') diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index e1e552c36..f26b41f31 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml @@ -18,7 +18,7 @@ register: downloaded_image - name: Uncompress Base Cloud image - command: 'unxz -kf {{ os_libvirt_storage_pool_path }}/{{ image_name }}.{{ image_compression }}' + command: 'unxz -kf {{ os_libvirt_storage_pool_path }}/{{ [image_name, image_compression] | join(".") }}' args: creates: '{{ os_libvirt_storage_pool_path }}/{{ image_name }}' when: image_compression in ["xz"] and downloaded_image.changed -- cgit v1.2.3 From e81bf0e72dc12736b3ea69151123697b69b5240d Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Mon, 30 Nov 2015 11:42:46 -0500 Subject: Enforce connection: local and become: no on all localhost plays --- playbooks/adhoc/create_pv/create_pv.yaml | 10 ++++++---- playbooks/adhoc/noc/create_host.yml | 4 ++++ playbooks/adhoc/noc/create_maintenance.yml | 2 ++ playbooks/adhoc/noc/get_zabbix_problems.yml | 2 ++ playbooks/adhoc/zabbix_setup/clean_zabbix.yml | 2 ++ playbooks/adhoc/zabbix_setup/oo-config-zaio.yml | 2 ++ playbooks/aws/ansible-tower/config.yml | 2 ++ playbooks/aws/ansible-tower/launch.yml | 1 + playbooks/aws/openshift-cluster/addNodes.yml | 1 + playbooks/aws/openshift-cluster/config.yml | 2 ++ playbooks/aws/openshift-cluster/launch.yml | 1 + playbooks/aws/openshift-cluster/list.yml | 2 ++ playbooks/aws/openshift-cluster/scaleup.yml | 2 ++ playbooks/aws/openshift-cluster/service.yml | 2 ++ playbooks/aws/openshift-cluster/terminate.yml | 3 +++ playbooks/aws/openshift-cluster/update.yml | 2 ++ playbooks/common/openshift-cluster/evaluate_groups.yml | 2 ++ .../openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml | 16 ++++++++++++++++ playbooks/common/openshift-etcd/config.yml | 4 ++-- playbooks/common/openshift-etcd/service.yml | 2 ++ playbooks/common/openshift-master/config.yml | 8 +++++--- playbooks/common/openshift-master/service.yml | 2 ++ playbooks/common/openshift-node/config.yml | 4 ++-- playbooks/common/openshift-node/service.yml | 2 ++ playbooks/gce/openshift-cluster/config.yml | 2 ++ playbooks/gce/openshift-cluster/join_node.yml | 4 ++++ playbooks/gce/openshift-cluster/launch.yml | 1 + playbooks/gce/openshift-cluster/list.yml | 2 ++ playbooks/gce/openshift-cluster/service.yml | 2 ++ playbooks/gce/openshift-cluster/terminate.yml | 2 ++ playbooks/gce/openshift-cluster/update.yml | 2 ++ playbooks/gce/openshift-cluster/wip.yml | 1 + playbooks/libvirt/openshift-cluster/config.yml | 2 ++ playbooks/libvirt/openshift-cluster/launch.yml | 2 ++ playbooks/libvirt/openshift-cluster/list.yml | 4 ++++ playbooks/libvirt/openshift-cluster/service.yml | 2 ++ playbooks/libvirt/openshift-cluster/terminate.yml | 4 ++++ playbooks/libvirt/openshift-cluster/update.yml | 2 ++ playbooks/openstack/openshift-cluster/config.yml | 2 ++ playbooks/openstack/openshift-cluster/launch.yml | 1 + playbooks/openstack/openshift-cluster/list.yml | 4 ++++ playbooks/openstack/openshift-cluster/terminate.yml | 2 ++ playbooks/openstack/openshift-cluster/update.yml | 2 ++ 43 files changed, 112 insertions(+), 11 deletions(-) (limited to 'playbooks') diff --git a/playbooks/adhoc/create_pv/create_pv.yaml b/playbooks/adhoc/create_pv/create_pv.yaml index 4f0ef7a75..e4eb5da49 100644 --- a/playbooks/adhoc/create_pv/create_pv.yaml +++ b/playbooks/adhoc/create_pv/create_pv.yaml @@ -1,5 +1,5 @@ --- -#example run: +#example run: # ansible-playbook -e "cli_volume_size=1" \ # -e "cli_device_name=/dev/xvdf" \ # -e "cli_hosttype=master" \ @@ -9,6 +9,8 @@ # - name: Create a volume and attach it to master hosts: localhost + connection: local + become: no gather_facts: no vars: cli_volume_type: gp2 @@ -103,7 +105,7 @@ filesystem: dev: "{{ cli_device_name }}" fstype: ext4 - + - name: Mount the dev mount: name: "{{ pv_mntdir }}" @@ -112,7 +114,7 @@ state: mounted - name: chgrp g+rwXs - file: + file: path: "{{ pv_mntdir }}" mode: 'g+rwXs' recurse: yes @@ -154,6 +156,6 @@ - debug: var=oc_output - - fail: + - fail: msg: "Failed to add {{ pv_template }} to master." when: oc_output.rc != 0 diff --git a/playbooks/adhoc/noc/create_host.yml b/playbooks/adhoc/noc/create_host.yml index d250e6e69..2d2cae2b5 100644 --- a/playbooks/adhoc/noc/create_host.yml +++ b/playbooks/adhoc/noc/create_host.yml @@ -1,6 +1,8 @@ --- - name: 'Create a host object in zabbix' hosts: localhost + connection: local + become: no gather_facts: no roles: - os_zabbix @@ -23,6 +25,8 @@ #ansible-playbook -e 'oo_desc=kwoodson test' -e 'oo_name=kwoodson test name' -e 'oo_start=1435715357' -e 'oo_stop=1435718985' -e 'oo_hostids=11549' create_maintenance.yml - name: 'Create a host object in zabbix' hosts: localhost + connection: local + become: no gather_facts: no roles: - os_zabbix diff --git a/playbooks/adhoc/noc/create_maintenance.yml b/playbooks/adhoc/noc/create_maintenance.yml index c0ec57ce1..8ad5fa0e2 100644 --- a/playbooks/adhoc/noc/create_maintenance.yml +++ b/playbooks/adhoc/noc/create_maintenance.yml @@ -2,6 +2,8 @@ #ansible-playbook -e 'oo_desc=kwoodson test' -e 'oo_name=kwoodson test name' -e 'oo_start=1435715357' -e 'oo_stop=1435718985' -e 'oo_hostids=11549' create_maintenance.yml - name: 'Create a maintenace object in zabbix' hosts: localhost + connection: local + become: no gather_facts: no roles: - os_zabbix diff --git a/playbooks/adhoc/noc/get_zabbix_problems.yml b/playbooks/adhoc/noc/get_zabbix_problems.yml index 4b94fa228..79cae24ab 100644 --- a/playbooks/adhoc/noc/get_zabbix_problems.yml +++ b/playbooks/adhoc/noc/get_zabbix_problems.yml @@ -1,6 +1,8 @@ --- - name: 'Get current hosts who have triggers that are alerting by trigger description' hosts: localhost + connection: local + become: no gather_facts: no roles: - os_zabbix diff --git a/playbooks/adhoc/zabbix_setup/clean_zabbix.yml b/playbooks/adhoc/zabbix_setup/clean_zabbix.yml index 1e884240a..09f7c76cc 100644 --- a/playbooks/adhoc/zabbix_setup/clean_zabbix.yml +++ b/playbooks/adhoc/zabbix_setup/clean_zabbix.yml @@ -1,6 +1,8 @@ --- - hosts: localhost gather_facts: no + connection: local + become: no vars: g_server: http://localhost:8080/zabbix/api_jsonrpc.php g_user: '' diff --git a/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml b/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml index e2b8150c6..ec28564cf 100755 --- a/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml +++ b/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml @@ -2,6 +2,8 @@ --- - hosts: localhost gather_facts: no + connection: local + become: no vars: g_server: http://localhost/zabbix/api_jsonrpc.php g_user: Admin diff --git a/playbooks/aws/ansible-tower/config.yml b/playbooks/aws/ansible-tower/config.yml index efd1b9911..eb3f1a1da 100644 --- a/playbooks/aws/ansible-tower/config.yml +++ b/playbooks/aws/ansible-tower/config.yml @@ -2,6 +2,8 @@ - name: "populate oo_hosts_to_config host group if needed" hosts: localhost gather_facts: no + connection: local + become: no tasks: - name: Evaluate oo_host_group_exp if it's set add_host: "name={{ item }} groups=oo_hosts_to_config" diff --git a/playbooks/aws/ansible-tower/launch.yml b/playbooks/aws/ansible-tower/launch.yml index 850238ffb..b3279f48e 100644 --- a/playbooks/aws/ansible-tower/launch.yml +++ b/playbooks/aws/ansible-tower/launch.yml @@ -2,6 +2,7 @@ - name: Launch instance(s) hosts: localhost connection: local + become: no gather_facts: no vars: diff --git a/playbooks/aws/openshift-cluster/addNodes.yml b/playbooks/aws/openshift-cluster/addNodes.yml index fff3e401b..3d88e6b23 100644 --- a/playbooks/aws/openshift-cluster/addNodes.yml +++ b/playbooks/aws/openshift-cluster/addNodes.yml @@ -2,6 +2,7 @@ - name: Launch instance(s) hosts: localhost connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml index 5aa6b0f9b..4f395f754 100644 --- a/playbooks/aws/openshift-cluster/config.yml +++ b/playbooks/aws/openshift-cluster/config.yml @@ -1,6 +1,8 @@ --- - hosts: localhost gather_facts: no + connection: local + become: no vars_files: - vars.yml tasks: diff --git a/playbooks/aws/openshift-cluster/launch.yml b/playbooks/aws/openshift-cluster/launch.yml index 09bf34666..15b83dfad 100644 --- a/playbooks/aws/openshift-cluster/launch.yml +++ b/playbooks/aws/openshift-cluster/launch.yml @@ -2,6 +2,7 @@ - name: Launch instance(s) hosts: localhost connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/aws/openshift-cluster/list.yml b/playbooks/aws/openshift-cluster/list.yml index 04fcdc0a1..8341ba9c1 100644 --- a/playbooks/aws/openshift-cluster/list.yml +++ b/playbooks/aws/openshift-cluster/list.yml @@ -2,6 +2,8 @@ - name: Generate oo_list_hosts group hosts: localhost gather_facts: no + connection: local + become: no vars_files: - vars.yml tasks: diff --git a/playbooks/aws/openshift-cluster/scaleup.yml b/playbooks/aws/openshift-cluster/scaleup.yml index 4415700a3..7c91cf035 100644 --- a/playbooks/aws/openshift-cluster/scaleup.yml +++ b/playbooks/aws/openshift-cluster/scaleup.yml @@ -2,6 +2,8 @@ - hosts: localhost gather_facts: no + connection: local + become: no vars_files: - vars.yml tasks: diff --git a/playbooks/aws/openshift-cluster/service.yml b/playbooks/aws/openshift-cluster/service.yml index 25cf48505..cca6f9f5b 100644 --- a/playbooks/aws/openshift-cluster/service.yml +++ b/playbooks/aws/openshift-cluster/service.yml @@ -1,6 +1,8 @@ --- - name: Call same systemctl command for openshift on all instance(s) hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/aws/openshift-cluster/terminate.yml b/playbooks/aws/openshift-cluster/terminate.yml index 77287cad0..9f00358f5 100644 --- a/playbooks/aws/openshift-cluster/terminate.yml +++ b/playbooks/aws/openshift-cluster/terminate.yml @@ -1,6 +1,8 @@ --- - name: Terminate instance(s) hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml @@ -25,6 +27,7 @@ - name: Terminate instances hosts: localhost connection: local + become: no gather_facts: no vars: host_vars: "{{ hostvars diff --git a/playbooks/aws/openshift-cluster/update.yml b/playbooks/aws/openshift-cluster/update.yml index e006aa74a..c154fdd6b 100644 --- a/playbooks/aws/openshift-cluster/update.yml +++ b/playbooks/aws/openshift-cluster/update.yml @@ -1,6 +1,8 @@ --- - name: Populate oo_hosts_to_update group hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml index 34da372a4..7613b287e 100644 --- a/playbooks/common/openshift-cluster/evaluate_groups.yml +++ b/playbooks/common/openshift-cluster/evaluate_groups.yml @@ -1,6 +1,8 @@ --- - name: Populate config host groups hosts: localhost + connection: local + become: no gather_facts: no tasks: - fail: diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml index eea147229..0cfccd192 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml @@ -12,6 +12,8 @@ - name: Evaluate additional groups for upgrade hosts: localhost + connection: local + become: no tasks: - name: Evaluate etcd_hosts_to_backup add_host: @@ -87,6 +89,8 @@ ############################################################################## - name: Gate on pre-upgrade checks hosts: localhost + connection: local + become: no vars: pre_upgrade_hosts: "{{ groups.oo_masters_to_config | union(groups.oo_nodes_to_config) }}" tasks: @@ -171,6 +175,8 @@ ############################################################################## - name: Gate on etcd backup hosts: localhost + connection: local + become: no tasks: - set_fact: etcd_backup_completed: "{{ hostvars @@ -189,6 +195,8 @@ ############################################################################### - name: Create temp directory for syncing certs hosts: localhost + connection: local + become: no gather_facts: no tasks: - name: Create local temp directory for syncing certs @@ -339,6 +347,8 @@ - name: Delete temporary directory on localhost hosts: localhost + connection: local + become: no gather_facts: no tasks: - file: name={{ g_master_mktemp.stdout }} state=absent @@ -357,6 +367,8 @@ ############################################################################## - name: Gate on master update hosts: localhost + connection: local + become: no tasks: - set_fact: master_update_completed: "{{ hostvars @@ -397,6 +409,8 @@ ############################################################################## - name: Gate on nodes update hosts: localhost + connection: local + become: no tasks: - set_fact: node_update_completed: "{{ hostvars @@ -464,6 +478,8 @@ ############################################################################## - name: Gate on reconcile hosts: localhost + connection: local + become: no tasks: - set_fact: reconcile_completed: "{{ hostvars diff --git a/playbooks/common/openshift-etcd/config.yml b/playbooks/common/openshift-etcd/config.yml index 7d94ced2e..6dee196e3 100644 --- a/playbooks/common/openshift-etcd/config.yml +++ b/playbooks/common/openshift-etcd/config.yml @@ -33,7 +33,7 @@ - name: Create temp directory for syncing certs hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - name: Create local temp directory for syncing certs @@ -92,7 +92,7 @@ - name: Delete temporary directory on localhost hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - file: name={{ g_etcd_mktemp.stdout }} state=absent diff --git a/playbooks/common/openshift-etcd/service.yml b/playbooks/common/openshift-etcd/service.yml index 0bf69b22f..fd2bc24ae 100644 --- a/playbooks/common/openshift-etcd/service.yml +++ b/playbooks/common/openshift-etcd/service.yml @@ -1,6 +1,8 @@ --- - name: Populate g_service_masters host group if needed hosts: localhost + connection: local + become: no gather_facts: no tasks: - fail: msg="new_cluster_state is required to be injected in this playbook" diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 43e7836b3..b06a0d132 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -70,7 +70,7 @@ - name: Create temp directory for syncing certs hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - name: Create local temp directory for syncing certs @@ -207,7 +207,7 @@ - name: Compute haproxy_backend_servers hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - set_fact: @@ -268,6 +268,8 @@ - name: Parse named certificates hosts: localhost + connection: local + become: no vars: internal_hostnames: "{{ hostvars[groups.oo_first_master.0].openshift.common.internal_hostnames }}" named_certificates: "{{ hostvars[groups.oo_first_master.0].openshift_master_named_certificates | default([]) }}" @@ -394,7 +396,7 @@ - name: Delete temporary directory on localhost hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - file: name={{ g_master_mktemp.stdout }} state=absent diff --git a/playbooks/common/openshift-master/service.yml b/playbooks/common/openshift-master/service.yml index 27e1e66f9..f60c5a2b5 100644 --- a/playbooks/common/openshift-master/service.yml +++ b/playbooks/common/openshift-master/service.yml @@ -2,6 +2,8 @@ - name: Populate g_service_masters host group if needed hosts: localhost gather_facts: no + connection: local + become: no tasks: - fail: msg="new_cluster_state is required to be injected in this playbook" when: new_cluster_state is not defined diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 2b6171cb3..f2a1176dc 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -58,7 +58,7 @@ - name: Create temp directory for syncing certs hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - name: Create local temp directory for syncing certs @@ -189,7 +189,7 @@ - name: Delete temporary directory on localhost hosts: localhost connection: local - sudo: false + become: no gather_facts: no tasks: - file: name={{ mktemp.stdout }} state=absent diff --git a/playbooks/common/openshift-node/service.yml b/playbooks/common/openshift-node/service.yml index 5cf83e186..0f07add2a 100644 --- a/playbooks/common/openshift-node/service.yml +++ b/playbooks/common/openshift-node/service.yml @@ -1,6 +1,8 @@ --- - name: Populate g_service_nodes host group if needed hosts: localhost + connection: local + become: no gather_facts: no tasks: - fail: msg="new_cluster_state is required to be injected in this playbook" diff --git a/playbooks/gce/openshift-cluster/config.yml b/playbooks/gce/openshift-cluster/config.yml index 745161bcb..2a85d29dd 100644 --- a/playbooks/gce/openshift-cluster/config.yml +++ b/playbooks/gce/openshift-cluster/config.yml @@ -4,6 +4,8 @@ - hosts: localhost gather_facts: no + connection: local + become: no vars_files: - vars.yml tasks: diff --git a/playbooks/gce/openshift-cluster/join_node.yml b/playbooks/gce/openshift-cluster/join_node.yml index c8f6065cd..e2f81d9e3 100644 --- a/playbooks/gce/openshift-cluster/join_node.yml +++ b/playbooks/gce/openshift-cluster/join_node.yml @@ -1,6 +1,8 @@ --- - name: Populate oo_hosts_to_update group hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml @@ -16,6 +18,8 @@ - name: Populate oo_masters_to_config host group hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/gce/openshift-cluster/launch.yml b/playbooks/gce/openshift-cluster/launch.yml index d6ef57c45..562bf8d29 100644 --- a/playbooks/gce/openshift-cluster/launch.yml +++ b/playbooks/gce/openshift-cluster/launch.yml @@ -2,6 +2,7 @@ - name: Launch instance(s) hosts: localhost connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/gce/openshift-cluster/list.yml b/playbooks/gce/openshift-cluster/list.yml index 53b2b9a5e..b9ff89c79 100644 --- a/playbooks/gce/openshift-cluster/list.yml +++ b/playbooks/gce/openshift-cluster/list.yml @@ -1,6 +1,8 @@ --- - name: Generate oo_list_hosts group hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/gce/openshift-cluster/service.yml b/playbooks/gce/openshift-cluster/service.yml index 2d0f2ab95..4bf5c8131 100644 --- a/playbooks/gce/openshift-cluster/service.yml +++ b/playbooks/gce/openshift-cluster/service.yml @@ -1,6 +1,8 @@ --- - name: Call same systemctl command for openshift on all instance(s) hosts: localhost + connection: local + become: no gather_facts: no vars_files: - vars.yml diff --git a/playbooks/gce/openshift-cluster/terminate.yml b/playbooks/gce/openshift-cluster/terminate.yml index e20e0a8bc..f4e89983b 100644 --- a/playbooks/gce/openshift-cluster/terminate.yml +++ b/playbooks/gce/openshift-cluster/terminate.yml @@ -2,6 +2,7 @@ - name: Terminate instance(s) hosts: localhost connection: local + become: no gather_facts: no vars_files: - vars.yml @@ -27,6 +28,7 @@ - name: Terminate instances(s) hosts: localhost + become: no connection: local gather_facts: no vars_files: diff --git a/playbooks/gce/openshift-cluster/update.yml b/playbooks/gce/openshift-cluster/update.yml index 8096aa654..50958284d 100644 --- a/playbooks/gce/openshift-cluster/update.yml +++ b/playbooks/gce/openshift-cluster/update.yml @@ -1,6 +1,8 @@ --- - name: Populate oo_hosts_to_update group hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/gce/openshift-cluster/wip.yml b/playbooks/gce/openshift-cluster/wip.yml index 51a521a6b..34cef52bc 100644 --- a/playbooks/gce/openshift-cluster/wip.yml +++ b/playbooks/gce/openshift-cluster/wip.yml @@ -1,6 +1,7 @@ --- - name: WIP hosts: localhost + become: no connection: local gather_facts: no vars_files: diff --git a/playbooks/libvirt/openshift-cluster/config.yml b/playbooks/libvirt/openshift-cluster/config.yml index 4d1ae22ff..9bccf80b9 100644 --- a/playbooks/libvirt/openshift-cluster/config.yml +++ b/playbooks/libvirt/openshift-cluster/config.yml @@ -5,6 +5,8 @@ - hosts: localhost gather_facts: no + become: no + connection: local vars_files: - vars.yml tasks: diff --git a/playbooks/libvirt/openshift-cluster/launch.yml b/playbooks/libvirt/openshift-cluster/launch.yml index 8d7949dd1..da4f175cb 100644 --- a/playbooks/libvirt/openshift-cluster/launch.yml +++ b/playbooks/libvirt/openshift-cluster/launch.yml @@ -1,6 +1,8 @@ --- - name: Launch instance(s) hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/libvirt/openshift-cluster/list.yml b/playbooks/libvirt/openshift-cluster/list.yml index 5954bb01e..d89e699f2 100644 --- a/playbooks/libvirt/openshift-cluster/list.yml +++ b/playbooks/libvirt/openshift-cluster/list.yml @@ -1,6 +1,8 @@ --- - name: Generate oo_list_hosts group hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml @@ -21,6 +23,8 @@ - name: List Hosts hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/libvirt/openshift-cluster/service.yml b/playbooks/libvirt/openshift-cluster/service.yml index ae095f5a2..aabd2566d 100644 --- a/playbooks/libvirt/openshift-cluster/service.yml +++ b/playbooks/libvirt/openshift-cluster/service.yml @@ -5,6 +5,8 @@ - name: Call same systemctl command for openshift on all instance(s) hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/libvirt/openshift-cluster/terminate.yml b/playbooks/libvirt/openshift-cluster/terminate.yml index 8f00812a9..a6b963608 100644 --- a/playbooks/libvirt/openshift-cluster/terminate.yml +++ b/playbooks/libvirt/openshift-cluster/terminate.yml @@ -3,6 +3,8 @@ - name: Terminate instance(s) hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml @@ -28,6 +30,8 @@ - name: Terminate instance(s) hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/libvirt/openshift-cluster/update.yml b/playbooks/libvirt/openshift-cluster/update.yml index d09832c16..dde67bcb1 100644 --- a/playbooks/libvirt/openshift-cluster/update.yml +++ b/playbooks/libvirt/openshift-cluster/update.yml @@ -1,6 +1,8 @@ --- - name: Populate oo_hosts_to_update group hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml index 888804e28..ad68e8701 100644 --- a/playbooks/openstack/openshift-cluster/config.yml +++ b/playbooks/openstack/openshift-cluster/config.yml @@ -1,5 +1,7 @@ - hosts: localhost gather_facts: no + become: no + connection: local vars_files: - vars.yml tasks: diff --git a/playbooks/openstack/openshift-cluster/launch.yml b/playbooks/openstack/openshift-cluster/launch.yml index 651aef40b..d5b819533 100644 --- a/playbooks/openstack/openshift-cluster/launch.yml +++ b/playbooks/openstack/openshift-cluster/launch.yml @@ -1,6 +1,7 @@ --- - name: Launch instance(s) hosts: localhost + become: no connection: local gather_facts: no vars_files: diff --git a/playbooks/openstack/openshift-cluster/list.yml b/playbooks/openstack/openshift-cluster/list.yml index fa194b072..436d3e6f7 100644 --- a/playbooks/openstack/openshift-cluster/list.yml +++ b/playbooks/openstack/openshift-cluster/list.yml @@ -1,6 +1,8 @@ --- - name: Generate oo_list_hosts group hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml @@ -22,6 +24,8 @@ - name: List Hosts hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml diff --git a/playbooks/openstack/openshift-cluster/terminate.yml b/playbooks/openstack/openshift-cluster/terminate.yml index 62df2be73..2a7f04505 100644 --- a/playbooks/openstack/openshift-cluster/terminate.yml +++ b/playbooks/openstack/openshift-cluster/terminate.yml @@ -1,5 +1,6 @@ - name: Terminate instance(s) hosts: localhost + become: no connection: local gather_facts: no vars_files: @@ -25,6 +26,7 @@ default('no', True) | lower in ['no', 'false'] - hosts: localhost + become: no connection: local gather_facts: no vars_files: diff --git a/playbooks/openstack/openshift-cluster/update.yml b/playbooks/openstack/openshift-cluster/update.yml index e006aa74a..b4dd324a6 100644 --- a/playbooks/openstack/openshift-cluster/update.yml +++ b/playbooks/openstack/openshift-cluster/update.yml @@ -1,6 +1,8 @@ --- - name: Populate oo_hosts_to_update group hosts: localhost + become: no + connection: local gather_facts: no vars_files: - vars.yml -- cgit v1.2.3 From bb033f8ffdc551e34c9e48a151fb6dc99ab7207e Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Wed, 9 Dec 2015 15:27:54 -0500 Subject: Remove hacluster user during uninstall. --- playbooks/adhoc/uninstall.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'playbooks') diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml index 08a2ea6fb..d1bb2298a 100644 --- a/playbooks/adhoc/uninstall.yml +++ b/playbooks/adhoc/uninstall.yml @@ -79,6 +79,8 @@ - tuned-profiles-openshift-node - tuned-profiles-origin-node + - user: name=hacluster state=absent + - dnf: name={{ item }} state=absent when: ansible_pkg_mgr == "dnf" and not is_atomic | bool with_items: -- cgit v1.2.3 From b1d30491f1581503003646684137bf2c218660ba Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Wed, 9 Dec 2015 15:06:48 -0500 Subject: Remove yum / dnf duplication --- playbooks/adhoc/uninstall.yml | 38 ++-------------------- playbooks/aws/ansible-tower/launch.yml | 4 +-- .../upgrades/v3_0_minor/upgrade.yml | 4 +-- .../upgrades/v3_0_to_v3_1/upgrade.yml | 20 ++++-------- playbooks/common/openshift-master/config.yml | 2 +- 5 files changed, 14 insertions(+), 54 deletions(-) (limited to 'playbooks') diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml index d1bb2298a..9161076e5 100644 --- a/playbooks/adhoc/uninstall.yml +++ b/playbooks/adhoc/uninstall.yml @@ -47,42 +47,8 @@ - origin-node - pcsd - - yum: name={{ item }} state=absent - when: ansible_pkg_mgr == "yum" and not is_atomic | bool - with_items: - - atomic-enterprise - - atomic-enterprise-master - - atomic-enterprise-node - - atomic-enterprise-sdn-ovs - - atomic-openshift - - atomic-openshift-clients - - atomic-openshift-master - - atomic-openshift-node - - atomic-openshift-sdn-ovs - - corosync - - etcd - - openshift - - openshift-master - - openshift-node - - openshift-sdn - - openshift-sdn-ovs - - openvswitch - - origin - - origin-clients - - origin-master - - origin-node - - origin-sdn-ovs - - pacemaker - - pcs - - tuned-profiles-atomic-enterprise-node - - tuned-profiles-atomic-openshift-node - - tuned-profiles-openshift-node - - tuned-profiles-origin-node - - - user: name=hacluster state=absent - - - dnf: name={{ item }} state=absent - when: ansible_pkg_mgr == "dnf" and not is_atomic | bool + - action: "{{ ansible_pkg_mgr }} name={{ item }} state=absent" + when: not is_atomic | bool with_items: - atomic-enterprise - atomic-enterprise-master diff --git a/playbooks/aws/ansible-tower/launch.yml b/playbooks/aws/ansible-tower/launch.yml index 850238ffb..fd6b15c32 100644 --- a/playbooks/aws/ansible-tower/launch.yml +++ b/playbooks/aws/ansible-tower/launch.yml @@ -71,8 +71,8 @@ tasks: - - name: Yum update - yum: name=* state=latest + - name: Update All Things + action: "{{ ansible_pkg_mgr }} name=* state=latest" # Apply the configs, seprate so that just the configs can be run by themselves - include: config.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml index 9f7e49b93..63c8ef756 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml @@ -11,7 +11,7 @@ openshift_version: "{{ openshift_pkg_version | default('') }}" tasks: - name: Upgrade master packages - yum: pkg={{ openshift.common.service_type }}-master{{ openshift_version }} state=latest + action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-master{{ openshift_version }} state=latest" - name: Restart master services service: name="{{ openshift.common.service_type}}-master" state=restarted @@ -21,7 +21,7 @@ openshift_version: "{{ openshift_pkg_version | default('') }}" tasks: - name: Upgrade node packages - yum: pkg={{ openshift.common.service_type }}-node{{ openshift_version }} state=latest + action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-node{{ openshift_version }} state=latest" - name: Restart node services service: name="{{ openshift.common.service_type }}-node" state=restarted diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml index 0309e8a77..c31103f3e 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml @@ -54,8 +54,8 @@ - name: Verify upgrade can proceed hosts: oo_masters_to_config:oo_nodes_to_config tasks: - - name: Clean yum cache - command: yum clean all + - name: Clean package cache + command: "{{ ansible_pkg_mgr }} clean all" - set_fact: g_new_service_name: "{{ 'origin' if deployment_type =='origin' else 'atomic-openshift' }}" @@ -149,9 +149,7 @@ when: (embedded_etcd | bool) and (etcd_disk_usage.stdout|int > avail_disk.stdout|int) - name: Install etcd (for etcdctl) - yum: - pkg: etcd - state: latest + action: "{{ ansible_pkg_mgr }} name=etcd state=latest" - name: Generate etcd backup command: > @@ -222,17 +220,13 @@ openshift_version: "{{ openshift_pkg_version | default('') }}" tasks: - name: Upgrade to latest available kernel - yum: - pkg: kernel - state: latest + action: "{{ ansible_pkg_mgr}} name=kernel state=latest" - name: Upgrade master packages - command: yum update -y {{ openshift.common.service_type }}-master{{ openshift_version }} + command: "{{ ansible_pkg_mgr}} update -y {{ openshift.common.service_type }}-master{{ openshift_version }}" - name: Ensure python-yaml present for config upgrade - yum: - pkg: PyYAML - state: installed + action: "{{ ansible_pkg_mgr }} name=PyYAML state=present" - name: Upgrade master configuration openshift_upgrade_config: @@ -380,7 +374,7 @@ - openshift_facts tasks: - name: Upgrade node packages - command: yum update -y {{ openshift.common.service_type }}-node{{ openshift_version }} + command: "{{ ansible_pkg_mgr }} update -y {{ openshift.common.service_type }}-node{{ openshift_version }}" - name: Restart node service service: name="{{ openshift.common.service_type }}-node" state=restarted diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 196cdc8fe..d6d6e1cf4 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -245,7 +245,7 @@ msg: "openshift_master_session_auth_secrets and openshift_master_encryption_secrets must be equal length" when: (openshift_master_session_auth_secrets is defined and openshift_master_session_encryption_secrets is defined) and (openshift_master_session_auth_secrets | length != openshift_master_session_encryption_secrets | length) - name: Install OpenSSL package - action: "{{ansible_pkg_mgr}} pkg=openssl state=present" + action: "{{ ansible_pkg_mgr }} name=openssl state=present" - name: Generate session authentication key command: /usr/bin/openssl rand -base64 24 register: session_auth_output -- cgit v1.2.3 From 9fc1e7ac3e066add840be7691a9647f6157afe27 Mon Sep 17 00:00:00 2001 From: John T Skarbek Date: Thu, 3 Dec 2015 22:37:33 -0500 Subject: Make the install of openshift_examples optional * Allows us to make it optional to run the role `openshift_examples` * Defaults to true --- playbooks/common/openshift-master/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'playbooks') diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index becd68dbe..a537797b6 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -349,7 +349,8 @@ roles: - role: openshift_master_cluster when: openshift_master_ha | bool and openshift.master.cluster_method == "pacemaker" - - openshift_examples + - role: openshift_examples + when: openshift.common.install_examples | bool - role: openshift_cluster_metrics when: openshift.common.use_cluster_metrics | bool - role: openshift_manageiq -- cgit v1.2.3 From 7c945d07d2a61e7334a10388d37ac28f1bc58ce1 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Mon, 30 Nov 2015 17:33:03 -0500 Subject: Updating env-host-type to host patterns --- playbooks/adhoc/create_pv/create_pv.yaml | 10 +++--- .../docker_loopback_to_direct_lvm.yml | 2 +- playbooks/adhoc/grow_docker_vg/grow_docker_vg.yml | 2 +- playbooks/adhoc/s3_registry/s3_registry.yml | 2 +- playbooks/aws/openshift-cluster/config.yml | 8 ++--- playbooks/aws/openshift-cluster/scaleup.yml | 8 ++--- playbooks/aws/openshift-cluster/service.yml | 4 +-- .../openshift-cluster/tasks/launch_instances.yml | 7 +--- playbooks/aws/openshift-cluster/terminate.yml | 1 - playbooks/aws/openshift-cluster/update.yml | 13 ++++--- .../upgrades/v3_0_to_v3_1/upgrade.yml | 8 ++--- playbooks/byo/openshift-cluster/config.yml | 8 ++--- playbooks/byo/openshift-cluster/scaleup.yml | 8 ++--- .../upgrades/v3_0_minor/upgrade.yml | 8 ++--- .../upgrades/v3_0_to_v3_1/upgrade.yml | 8 ++--- .../common/openshift-cluster/evaluate_groups.yml | 42 +++++++++++----------- playbooks/gce/openshift-cluster/config.yml | 8 ++--- playbooks/gce/openshift-cluster/join_node.yml | 9 +++-- playbooks/gce/openshift-cluster/service.yml | 6 ++-- .../openshift-cluster/tasks/launch_instances.yml | 1 - playbooks/gce/openshift-cluster/update.yml | 9 +++-- playbooks/gce/openshift-cluster/wip.yml | 2 +- playbooks/libvirt/openshift-cluster/config.yml | 8 ++--- playbooks/libvirt/openshift-cluster/service.yml | 4 +-- .../openshift-cluster/tasks/launch_instances.yml | 2 +- .../libvirt/openshift-cluster/templates/domain.xml | 1 - playbooks/libvirt/openshift-cluster/update.yml | 10 ++++-- playbooks/openstack/openshift-cluster/config.yml | 8 ++--- .../openshift-cluster/files/heat_stack_server.yaml | 6 ---- playbooks/openstack/openshift-cluster/launch.yml | 8 ++--- playbooks/openstack/openshift-cluster/update.yml | 10 ++++-- 31 files changed, 117 insertions(+), 114 deletions(-) (limited to 'playbooks') diff --git a/playbooks/adhoc/create_pv/create_pv.yaml b/playbooks/adhoc/create_pv/create_pv.yaml index 4f0ef7a75..a9dc7710d 100644 --- a/playbooks/adhoc/create_pv/create_pv.yaml +++ b/playbooks/adhoc/create_pv/create_pv.yaml @@ -3,9 +3,9 @@ # ansible-playbook -e "cli_volume_size=1" \ # -e "cli_device_name=/dev/xvdf" \ # -e "cli_hosttype=master" \ -# -e "cli_environment=ops" \ +# -e "cli_env=ops" \ # create_pv.yaml -# FIXME: we need to change "environment" to "clusterid" as that's what it really is now. +# FIXME: we need to change "env" to "clusterid" as that's what it really is now. # - name: Create a volume and attach it to master hosts: localhost @@ -14,7 +14,7 @@ cli_volume_type: gp2 cli_volume_iops: '' oo_name: "{{ groups['tag_host-type_' ~ cli_hosttype] | - intersect(groups['tag_environment_' ~ cli_environment]) | + intersect(groups['tag_env_' ~ cli_env]) | first }}" pre_tasks: - fail: @@ -24,7 +24,7 @@ - cli_volume_size - cli_device_name - cli_hosttype - - cli_environment + - cli_env - name: set oo_name fact set_fact: @@ -55,7 +55,7 @@ args: tags: Name: "pv-{{ hostvars[oo_name]['ec2_tag_Name'] }}" - env: "{{cli_environment}}" + env: "{{cli_env}}" register: voltags - debug: var=voltags diff --git a/playbooks/adhoc/docker_loopback_to_lvm/docker_loopback_to_direct_lvm.yml b/playbooks/adhoc/docker_loopback_to_lvm/docker_loopback_to_direct_lvm.yml index b6a2d2f26..89128dd3c 100644 --- a/playbooks/adhoc/docker_loopback_to_lvm/docker_loopback_to_direct_lvm.yml +++ b/playbooks/adhoc/docker_loopback_to_lvm/docker_loopback_to_direct_lvm.yml @@ -113,7 +113,7 @@ args: tags: Name: "{{ ec2_tag_Name }}" - env: "{{ ec2_tag_environment }}" + env: "{{ ec2_tag_env}}" register: voltags - name: Wait for volume to attach diff --git a/playbooks/adhoc/grow_docker_vg/grow_docker_vg.yml b/playbooks/adhoc/grow_docker_vg/grow_docker_vg.yml index 63d473146..b4bcb25da 100644 --- a/playbooks/adhoc/grow_docker_vg/grow_docker_vg.yml +++ b/playbooks/adhoc/grow_docker_vg/grow_docker_vg.yml @@ -151,7 +151,7 @@ args: tags: Name: "{{ ec2_tag_Name }}" - env: "{{ ec2_tag_environment }}" + env: "{{ ec2_tag_env }}" register: voltags - name: check for attached drive diff --git a/playbooks/adhoc/s3_registry/s3_registry.yml b/playbooks/adhoc/s3_registry/s3_registry.yml index 4dcef1a42..071c2cf46 100644 --- a/playbooks/adhoc/s3_registry/s3_registry.yml +++ b/playbooks/adhoc/s3_registry/s3_registry.yml @@ -6,7 +6,7 @@ # The AWS access/secret keys should be the keys of a separate user (not your main user), containing only the necessary S3 access role. # The 'clusterid' is the short name of your cluster. -- hosts: tag_env-host-type_{{ clusterid }}-openshift-master +- hosts: tag_env_{{ clusterid }}:&tag_host-type_openshift-master remote_user: root gather_facts: False diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml index 5aa6b0f9b..7f4e06230 100644 --- a/playbooks/aws/openshift-cluster/config.yml +++ b/playbooks/aws/openshift-cluster/config.yml @@ -10,10 +10,10 @@ - include: ../../common/openshift-cluster/config.yml vars: - g_etcd_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-etcd' }}" - g_lb_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-lb' }}" - g_masters_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-master' }}" - g_nodes_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-node' }}" + g_etcd_hosts: "{{ (groups['tag_host-type_etcd']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_lb_hosts: "{{ (groups['tag_host-type_lb']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_master_hosts: "{{ (groups['tag_host-type_master']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_node_hosts: "{{ (groups['tag_host-type_node']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}" g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}" g_nodeonmaster: true diff --git a/playbooks/aws/openshift-cluster/scaleup.yml b/playbooks/aws/openshift-cluster/scaleup.yml index 4415700a3..b97199a72 100644 --- a/playbooks/aws/openshift-cluster/scaleup.yml +++ b/playbooks/aws/openshift-cluster/scaleup.yml @@ -20,10 +20,10 @@ - include: ../../common/openshift-cluster/scaleup.yml vars: - g_etcd_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-etcd' }}" - g_lb_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-lb' }}" - g_masters_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-master' }}" - g_new_nodes_group: 'nodes_to_add' + g_etcd_hosts: "{{ (groups['tag_host-type_etcd']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_lb_hosts: "{{ (groups['tag_host-type_lb']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_master_hosts: "{{ (groups['tag_host-type_master']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_new_node_hosts: "{{ groups.nodes_to_add }}" g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}" g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}" g_nodeonmaster: true diff --git a/playbooks/aws/openshift-cluster/service.yml b/playbooks/aws/openshift-cluster/service.yml index 25cf48505..7e994b07b 100644 --- a/playbooks/aws/openshift-cluster/service.yml +++ b/playbooks/aws/openshift-cluster/service.yml @@ -14,7 +14,7 @@ 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([]) + with_items: "{{ g_master_hosts | default([]) }}" - name: Evaluate g_service_nodes add_host: @@ -22,7 +22,7 @@ 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([]) + with_items: "{{ g_node_hosts | 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 99f0577fc..1fbd71a75 100644 --- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml @@ -3,7 +3,6 @@ created_by: "{{ lookup('env', 'LOGNAME')|default(cluster, true) }}" docker_vol_ephemeral: "{{ lookup('env', 'os_docker_vol_ephemeral') | default(false, true) }}" env: "{{ cluster }}" - env_host_type: "{{ cluster }}-openshift-{{ type }}" host_type: "{{ type }}" sub_host_type: "{{ g_sub_host_type }}" @@ -124,10 +123,8 @@ wait: yes instance_tags: created-by: "{{ created_by }}" - environment: "{{ env }}" env: "{{ env }}" host-type: "{{ host_type }}" - env-host-type: "{{ env_host_type }}" sub-host-type: "{{ sub_host_type }}" volumes: "{{ volumes }}" register: ec2 @@ -142,9 +139,7 @@ Name: "{{ item.0 }}" - set_fact: - instance_groups: "tag_created-by_{{ created_by }}, tag_env_{{ env }}, - tag_host-type_{{ host_type }}, tag_env-host-type_{{ env_host_type }}, - tag_sub-host-type_{{ sub_host_type }}" + instance_groups: "tag_created-by_{{ created_by }}, tag_env_{{ env }}, tag_host-type_{{ host_type }}, tag_sub-host-type_{{ sub_host_type }}" - set_fact: node_label: diff --git a/playbooks/aws/openshift-cluster/terminate.yml b/playbooks/aws/openshift-cluster/terminate.yml index 77287cad0..1925a909a 100644 --- a/playbooks/aws/openshift-cluster/terminate.yml +++ b/playbooks/aws/openshift-cluster/terminate.yml @@ -36,7 +36,6 @@ tags: env: "{{ item['ec2_tag_env'] }}" host-type: "{{ item['ec2_tag_host-type'] }}" - env-host-type: "{{ item['ec2_tag_env-host-type'] }}" sub_host_type: "{{ item['ec2_tag_sub-host-type'] }}" with_items: host_vars when: "'oo_hosts_to_terminate' in groups" diff --git a/playbooks/aws/openshift-cluster/update.yml b/playbooks/aws/openshift-cluster/update.yml index e006aa74a..ba12d358d 100644 --- a/playbooks/aws/openshift-cluster/update.yml +++ b/playbooks/aws/openshift-cluster/update.yml @@ -1,19 +1,22 @@ --- -- name: Populate oo_hosts_to_update group +- name: Update - Populate oo_hosts_to_update group hosts: localhost gather_facts: no + vars: + g_etcd_hosts: "{{ (groups['tag_host-type_etcd']|default([])) | intersect(groups['tag_env_' ~ cluster_id]) }}" + g_lb_hosts: "{{ (groups['tag_host-type_lb']|default([])) | intersect(groups['tag_env_' ~ cluster_id]) }}" + g_master_hosts: "{{ (groups['tag_host-type_master']|default([])) | intersect(groups['tag_env_' ~ cluster_id]) }}" + g_node_hosts: "{{ (groups['tag_host-type_node']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" vars_files: - vars.yml tasks: - - name: Evaluate oo_hosts_to_update + - name: Update - 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"] | default([])) - | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([])) - | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-etcd"] | default([])) + with_items: "{{ g_master_hosts | union(g_node_hosts) | union(g_etcd_hosts) | default([]) }}" - include: ../../common/openshift-cluster/update_repos_and_packages.yml diff --git a/playbooks/aws/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/aws/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml index 8cad51b5e..20cc97c8a 100644 --- a/playbooks/aws/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml +++ b/playbooks/aws/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml @@ -19,10 +19,10 @@ - include: ../../../../common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml vars: - g_etcd_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-etcd' }}" - g_lb_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-lb' }}" - g_masters_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-master' }}" - g_nodes_group: "{{ tmp_nodes_group | default('') }}" + g_etcd_hosts: "{{ (groups['tag_host-type_etcd']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_lb_hosts: "{{ (groups['tag_host-type_lb']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_master_hosts: "{{ (groups['tag_host-type_master']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_node_hosts: "{{ (groups['tag_host-type_node']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}" g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}" g_nodeonmaster: true diff --git a/playbooks/byo/openshift-cluster/config.yml b/playbooks/byo/openshift-cluster/config.yml index 411c7e660..ba8fe0a52 100644 --- a/playbooks/byo/openshift-cluster/config.yml +++ b/playbooks/byo/openshift-cluster/config.yml @@ -1,10 +1,10 @@ --- - include: ../../common/openshift-cluster/config.yml vars: - g_etcd_group: "{{ 'etcd' }}" - g_masters_group: "{{ 'masters' }}" - g_nodes_group: "{{ 'nodes' }}" - g_lb_group: "{{ 'lb' }}" + g_etcd_hosts: "{{ groups.etcd | default([]) }}" + g_master_hosts: "{{ groups.masters | default([]) }}" + g_node_hosts: "{{ groups.nodes | default([]) }}" + g_lb_hosts: "{{ groups.lb | default([]) }}" openshift_cluster_id: "{{ cluster_id | default('default') }}" openshift_debug_level: 2 openshift_deployment_type: "{{ deployment_type }}" diff --git a/playbooks/byo/openshift-cluster/scaleup.yml b/playbooks/byo/openshift-cluster/scaleup.yml index 70644d427..8f8ef6f21 100644 --- a/playbooks/byo/openshift-cluster/scaleup.yml +++ b/playbooks/byo/openshift-cluster/scaleup.yml @@ -1,10 +1,10 @@ --- - include: ../../common/openshift-cluster/scaleup.yml vars: - g_etcd_group: "{{ 'etcd' }}" - g_masters_group: "{{ 'masters' }}" - g_new_nodes_group: "{{ 'new_nodes' }}" - g_lb_group: "{{ 'lb' }}" + g_etcd_hosts: "{{ groups.etcd | default([]) }}" + g_master_hosts: "{{ groups.masters | default([]) }}" + g_new_node_hosts: "{{ groups.new_nodes | default([]) }}" + g_lb_hosts: "{{ groups.lb | default([]) }}" openshift_cluster_id: "{{ cluster_id | default('default') }}" openshift_debug_level: 2 openshift_deployment_type: "{{ deployment_type }}" diff --git a/playbooks/byo/openshift-cluster/upgrades/v3_0_minor/upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/v3_0_minor/upgrade.yml index 76fa9ba22..56e79e8c2 100644 --- a/playbooks/byo/openshift-cluster/upgrades/v3_0_minor/upgrade.yml +++ b/playbooks/byo/openshift-cluster/upgrades/v3_0_minor/upgrade.yml @@ -1,9 +1,9 @@ --- - include: ../../../../common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml vars: - g_etcd_group: "{{ 'etcd' }}" - g_masters_group: "{{ 'masters' }}" - g_nodes_group: "{{ 'nodes' }}" - g_lb_group: "{{ 'lb' }}" + g_etcd_hosts: "{{ groups.etcd | default([]) }}" + g_master_hosts: "{{ groups.masters | default([]) }}" + g_node_hosts: "{{ groups.nodes | default([]) }}" + g_lb_hosts: "{{ groups.lb | default([]) }}" openshift_cluster_id: "{{ cluster_id | default('default') }}" openshift_deployment_type: "{{ deployment_type }}" diff --git a/playbooks/byo/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml index b06442366..b4b4f3ec0 100644 --- a/playbooks/byo/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml +++ b/playbooks/byo/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml @@ -1,9 +1,9 @@ --- - include: ../../../../common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml vars: - g_etcd_group: "{{ 'etcd' }}" - g_masters_group: "{{ 'masters' }}" - g_nodes_group: "{{ 'nodes' }}" - g_lb_group: "{{ 'lb' }}" + g_etcd_hosts: "{{ groups.etcd | default([]) }}" + g_master_hosts: "{{ groups.masters | default([]) }}" + g_node_hosts: "{{ groups.nodes | default([]) }}" + g_lb_hosts: "{{ groups.lb | default([]) }}" openshift_cluster_id: "{{ cluster_id | default('default') }}" openshift_deployment_type: "{{ deployment_type }}" diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml index 34da372a4..5ecdcd7cc 100644 --- a/playbooks/common/openshift-cluster/evaluate_groups.yml +++ b/playbooks/common/openshift-cluster/evaluate_groups.yml @@ -4,20 +4,20 @@ gather_facts: no tasks: - fail: - msg: This playbook requires g_etcd_group to be set - when: g_etcd_group is not defined + msg: This playbook requires g_etcd_hosts to be set + when: g_etcd_hosts is not defined - fail: - msg: This playbook requires g_masters_group to be set - when: g_masters_group is not defined + msg: This playbook requires g_master_hosts to be set + when: g_master_hosts is not defined - fail: - msg: This playbook requires g_nodes_group or g_new_nodes_group to be set - when: g_nodes_group is not defined and g_new_nodes_group is not defined + msg: This playbook requires g_node_hosts or g_new_node_hosts to be set + when: g_node_hosts is not defined and g_new_node_hosts is not defined - fail: - msg: This playbook requires g_lb_group to be set - when: g_lb_group is not defined + msg: This playbook requires g_lb_hosts to be set + when: g_lb_hosts is not defined - name: Evaluate oo_etcd_to_config add_host: @@ -25,7 +25,7 @@ groups: oo_etcd_to_config ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_sudo: "{{ g_sudo | default(omit) }}" - with_items: groups[g_etcd_group] | default([]) + with_items: "{{ g_etcd_hosts | default([]) }}" - name: Evaluate oo_masters_to_config add_host: @@ -33,11 +33,11 @@ groups: oo_masters_to_config ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_sudo: "{{ g_sudo | default(omit) }}" - with_items: groups[g_masters_group] | default([]) + with_items: "{{ g_master_hosts | default([]) }}" - # Use g_new_nodes_group if it exists otherwise g_nodes_group + # Use g_new_node_hosts if it exists otherwise g_node_hosts - set_fact: - g_nodes_to_config: "{{ g_new_nodes_group | default(g_nodes_group | default([])) }}" + g_node_hosts_to_config: "{{ g_new_node_hosts | default(g_node_hosts | default([])) }}" - name: Evaluate oo_nodes_to_config add_host: @@ -45,32 +45,32 @@ groups: oo_nodes_to_config ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_sudo: "{{ g_sudo | default(omit) }}" - with_items: groups[g_nodes_to_config] | default([]) + with_items: "{{ g_node_hosts_to_config | default([]) }}" - # Skip adding the master to oo_nodes_to_config when g_new_nodes_group is + # Skip adding the master to oo_nodes_to_config when g_new_node_hosts is - name: Evaluate oo_nodes_to_config add_host: name: "{{ item }}" groups: oo_nodes_to_config ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_sudo: "{{ g_sudo | default(omit) }}" - with_items: groups[g_masters_group] | default([]) - when: g_nodeonmaster | default(false) == true and g_new_nodes_group is not defined + with_items: "{{ g_master_hosts | default([]) }}" + when: g_nodeonmaster | default(false) == true and g_new_node_hosts is not defined - name: Evaluate oo_first_etcd add_host: - name: "{{ groups[g_etcd_group][0] }}" + name: "{{ g_etcd_hosts[0] }}" groups: oo_first_etcd ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" - when: g_etcd_group in groups and (groups[g_etcd_group] | length) > 0 + when: g_etcd_hosts|length > 0 - name: Evaluate oo_first_master add_host: - name: "{{ groups[g_masters_group][0] }}" + name: "{{ g_master_hosts[0] }}" groups: oo_first_master ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_sudo: "{{ g_sudo | default(omit) }}" - when: g_masters_group in groups and (groups[g_masters_group] | length) > 0 + when: g_master_hosts|length > 0 - name: Evaluate oo_lb_to_config add_host: @@ -78,4 +78,4 @@ groups: oo_lb_to_config ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_sudo: "{{ g_sudo | default(omit) }}" - with_items: groups[g_lb_group] | default([]) + with_items: "{{ g_lb_hosts | default([]) }}" diff --git a/playbooks/gce/openshift-cluster/config.yml b/playbooks/gce/openshift-cluster/config.yml index 745161bcb..df1602c76 100644 --- a/playbooks/gce/openshift-cluster/config.yml +++ b/playbooks/gce/openshift-cluster/config.yml @@ -15,10 +15,10 @@ - include: ../../common/openshift-cluster/config.yml vars: - g_etcd_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-etcd' }}" - g_lb_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-lb' }}" - g_masters_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-master' }}" - g_nodes_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-node' }}" + g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}" g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}" g_nodeonmaster: true diff --git a/playbooks/gce/openshift-cluster/join_node.yml b/playbooks/gce/openshift-cluster/join_node.yml index c8f6065cd..cbf2325b5 100644 --- a/playbooks/gce/openshift-cluster/join_node.yml +++ b/playbooks/gce/openshift-cluster/join_node.yml @@ -2,6 +2,11 @@ - name: Populate oo_hosts_to_update group hosts: localhost gather_facts: no + vars: + g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" vars_files: - vars.yml tasks: @@ -29,11 +34,11 @@ - name: Evaluate oo_first_master add_host: - name: "{{ groups['tag_env-host-type-' ~ cluster_id ~ '-openshift-master'][0] }}" + name: "{{ g_master_hosts | first }}" 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" + when: g_master_hosts is defined and g_master_hosts|length > 0 #- include: config.yml - include: ../../common/openshift-node/config.yml diff --git a/playbooks/gce/openshift-cluster/service.yml b/playbooks/gce/openshift-cluster/service.yml index 2d0f2ab95..6da1be4d3 100644 --- a/playbooks/gce/openshift-cluster/service.yml +++ b/playbooks/gce/openshift-cluster/service.yml @@ -8,21 +8,19 @@ - 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) + with_items: "{{ g_node_hosts | 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) + with_items: "{{ g_master_hosts | 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/tasks/launch_instances.yml b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml index de8a75b18..2360a3263 100644 --- a/playbooks/gce/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/gce/openshift-cluster/tasks/launch_instances.yml @@ -19,7 +19,6 @@ - env-{{ cluster }} - host-type-{{ type }} - sub-host-type-{{ g_sub_host_type }} - - env-host-type-{{ cluster }}-openshift-{{ type }} when: instances |length > 0 register: gce diff --git a/playbooks/gce/openshift-cluster/update.yml b/playbooks/gce/openshift-cluster/update.yml index 8096aa654..b3368b100 100644 --- a/playbooks/gce/openshift-cluster/update.yml +++ b/playbooks/gce/openshift-cluster/update.yml @@ -2,6 +2,11 @@ - name: Populate oo_hosts_to_update group hosts: localhost gather_facts: no + vars: + g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" vars_files: - vars.yml tasks: @@ -11,9 +16,7 @@ groups: oo_hosts_to_update 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([])) - | union(groups["tag_env-host-type-{{ cluster_id }}-openshift-node"] | default([])) - | union(groups["tag_env-host-type-{{ cluster_id }}-openshift-etcd"] | default([])) + with_items: "{{ g_master_hosts | union(g_node_hosts) | union(g_etcd_hosts) | default([]) }}" - include: ../../common/openshift-cluster/update_repos_and_packages.yml diff --git a/playbooks/gce/openshift-cluster/wip.yml b/playbooks/gce/openshift-cluster/wip.yml index 51a521a6b..dc4fa83d3 100644 --- a/playbooks/gce/openshift-cluster/wip.yml +++ b/playbooks/gce/openshift-cluster/wip.yml @@ -12,7 +12,7 @@ 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([]) + with_items: "{{ g_master_hosts | default([]) }}" - name: Deploy OpenShift Services hosts: oo_masters_for_deploy diff --git a/playbooks/libvirt/openshift-cluster/config.yml b/playbooks/libvirt/openshift-cluster/config.yml index 4d1ae22ff..3410c735a 100644 --- a/playbooks/libvirt/openshift-cluster/config.yml +++ b/playbooks/libvirt/openshift-cluster/config.yml @@ -14,10 +14,10 @@ - include: ../../common/openshift-cluster/config.yml vars: - g_etcd_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-etcd' }}" - g_lb_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-lb' }}" - g_masters_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-master' }}" - g_nodes_group: "{{ 'tag_env-host-type-' ~ cluster_id ~ '-openshift-node' }}" + g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}" g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}" openshift_cluster_id: "{{ cluster_id }}" diff --git a/playbooks/libvirt/openshift-cluster/service.yml b/playbooks/libvirt/openshift-cluster/service.yml index ae095f5a2..8afaf2e9d 100644 --- a/playbooks/libvirt/openshift-cluster/service.yml +++ b/playbooks/libvirt/openshift-cluster/service.yml @@ -18,7 +18,7 @@ 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([]) + with_items: "{{ g_master_hosts | default([]) }}" - name: Evaluate g_service_nodes add_host: @@ -26,7 +26,7 @@ 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([]) + with_items: "{{ g_node_hosts | default([]) }}" - include: ../../common/openshift-node/service.yml - include: ../../common/openshift-master/service.yml diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index 4825207c9..e6317c32a 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml @@ -81,7 +81,7 @@ ansible_ssh_host: '{{ item.1 }}' 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 }}, tag_sub-host-type-{{ g_sub_host_type }}' + groups: 'tag_env-{{ cluster }}, tag_host-type-{{ type }}, tag_sub-host-type-{{ g_sub_host_type }}' with_together: - instances - ips diff --git a/playbooks/libvirt/openshift-cluster/templates/domain.xml b/playbooks/libvirt/openshift-cluster/templates/domain.xml index 870bcf2a6..c4ac6a434 100644 --- a/playbooks/libvirt/openshift-cluster/templates/domain.xml +++ b/playbooks/libvirt/openshift-cluster/templates/domain.xml @@ -4,7 +4,6 @@ env-{{ cluster }} - env-host-type-{{ cluster }}-openshift-{{ type }} host-type-{{ type }} sub-host-type-{{ g_sub_host_type }} diff --git a/playbooks/libvirt/openshift-cluster/update.yml b/playbooks/libvirt/openshift-cluster/update.yml index d09832c16..415880845 100644 --- a/playbooks/libvirt/openshift-cluster/update.yml +++ b/playbooks/libvirt/openshift-cluster/update.yml @@ -2,6 +2,12 @@ - name: Populate oo_hosts_to_update group hosts: localhost gather_facts: no + vars: + g_etcd_hosts: "{{ (groups['tag_host-type-etcd']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_lb_hosts: "{{ (groups['tag_host-type-lb']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_master_hosts: "{{ (groups['tag_host-type-master']|default([])) | intersect(groups['tag_env-' ~ cluster_id]) }}" + g_node_hosts: "{{ (groups['tag_host-type-node']|default([])) | intersect((groups['tag_env-' ~ cluster_id]|default([]))) }}" + vars_files: - vars.yml tasks: @@ -11,9 +17,7 @@ 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"] | default([])) - | union(groups["tag_env-host-type-{{ cluster_id }}-openshift-node"] | default([])) - | union(groups["tag_env-host-type-{{ cluster_id }}-openshift-etcd"] | default([])) + with_items: "{{ g_master_hosts | union(g_node_hosts) | union(g_etcd_hosts) | default([]) }}" - include: ../../common/openshift-cluster/update_repos_and_packages.yml diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml index 888804e28..397ddadf5 100644 --- a/playbooks/openstack/openshift-cluster/config.yml +++ b/playbooks/openstack/openshift-cluster/config.yml @@ -9,10 +9,10 @@ - include: ../../common/openshift-cluster/config.yml vars: - g_etcd_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-etcd' }}" - g_lb_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-lb' }}" - g_masters_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-master' }}" - g_nodes_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-node' }}" + g_etcd_hosts: "{{ (groups['tag_host-type_etcd']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_lb_hosts: "{{ (groups['tag_host-type_lb']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_master_hosts: "{{ (groups['tag_host-type_master']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + g_node_hosts: "{{ (groups['tag_host-type_node']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}" g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}" openshift_cluster_id: "{{ cluster_id }}" diff --git a/playbooks/openstack/openshift-cluster/files/heat_stack_server.yaml b/playbooks/openstack/openshift-cluster/files/heat_stack_server.yaml index 9dcab3e60..3f24a3e45 100644 --- a/playbooks/openstack/openshift-cluster/files/heat_stack_server.yaml +++ b/playbooks/openstack/openshift-cluster/files/heat_stack_server.yaml @@ -107,12 +107,6 @@ resources: metadata: env: { get_param: cluster_id } host-type: { get_param: type } - env-host-type: - str_replace: - template: cluster_id-openshift-type - params: - cluster_id: { get_param: cluster_id } - type: { get_param: type } sub-host-type: { get_param: subtype } port: diff --git a/playbooks/openstack/openshift-cluster/launch.yml b/playbooks/openstack/openshift-cluster/launch.yml index b18512495..491813ba8 100644 --- a/playbooks/openstack/openshift-cluster/launch.yml +++ b/playbooks/openstack/openshift-cluster/launch.yml @@ -70,7 +70,7 @@ ansible_ssh_host: '{{ item[2] }}' ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" - groups: 'tag_env_{{ cluster_id }}, tag_host-type_etcd, tag_env-host-type_{{ cluster_id }}-openshift-etcd, tag_sub-host-type_default' + groups: 'tag_env_{{ cluster_id }}, tag_host-type_etcd, tag_sub-host-type_default' with_together: - parsed_outputs.etcd_names - parsed_outputs.etcd_ips @@ -82,7 +82,7 @@ ansible_ssh_host: '{{ item[2] }}' ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" - groups: 'tag_env_{{ cluster_id }}, tag_host-type_master, tag_env-host-type_{{ cluster_id }}-openshift-master, tag_sub-host-type_default' + groups: 'tag_env_{{ cluster_id }}, tag_host-type_master, tag_sub-host-type_default' with_together: - parsed_outputs.master_names - parsed_outputs.master_ips @@ -94,7 +94,7 @@ ansible_ssh_host: '{{ item[2] }}' ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" - groups: 'tag_env_{{ cluster_id }}, tag_host-type_node, tag_env-host-type_{{ cluster_id }}-openshift-node, tag_sub-host-type_compute' + groups: 'tag_env_{{ cluster_id }}, tag_host-type_node, tag_sub-host-type_compute' with_together: - parsed_outputs.node_names - parsed_outputs.node_ips @@ -106,7 +106,7 @@ ansible_ssh_host: '{{ item[2] }}' ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}" ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}" - groups: 'tag_env_{{ cluster_id }}, tag_host-type_node, tag_env-host-type_{{ cluster_id }}-openshift-node, tag_sub-host-type_infra' + groups: 'tag_env_{{ cluster_id }}, tag_host-type_node, tag_sub-host-type_infra' with_together: - parsed_outputs.infra_names - parsed_outputs.infra_ips diff --git a/playbooks/openstack/openshift-cluster/update.yml b/playbooks/openstack/openshift-cluster/update.yml index e006aa74a..f2b9ffaf0 100644 --- a/playbooks/openstack/openshift-cluster/update.yml +++ b/playbooks/openstack/openshift-cluster/update.yml @@ -2,6 +2,12 @@ - name: Populate oo_hosts_to_update group hosts: localhost gather_facts: no + vars: + g_etcd_hosts: "{{ (groups['tag_host-type_etcd']|default([])) | intersect(groups['tag_env_' ~ cluster_id]) }}" + g_lb_hosts: "{{ (groups['tag_host-type_lb']|default([])) | intersect(groups['tag_env_' ~ cluster_id]) }}" + g_master_hosts: "{{ (groups['tag_host-type_master']|default([])) | intersect(groups['tag_env_' ~ cluster_id]) }}" + g_node_hosts: "{{ (groups['tag_host-type_node']|default([])) | intersect((groups['tag_env_' ~ cluster_id]|default([]))) }}" + vars_files: - vars.yml tasks: @@ -11,9 +17,7 @@ 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"] | default([])) - | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([])) - | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-etcd"] | default([])) + with_items: "{{ g_master_hosts | union(g_node_hosts) | union(g_etcd_hosts) | default([]) }}" - include: ../../common/openshift-cluster/update_repos_and_packages.yml -- cgit v1.2.3