From 0bcea6eaf24b796ba6b2658c213c8bc24783d498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Wed, 12 Aug 2015 17:48:33 +0200 Subject: Add the sub-host-type tag to the libvirt VMs --- playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml | 2 +- playbooks/libvirt/openshift-cluster/templates/domain.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'playbooks/libvirt') diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml index 4b91c6da8..4825207c9 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 }}' + groups: 'tag_env-{{ cluster }}, tag_host-type-{{ type }}, tag_env-host-type-{{ cluster }}-openshift-{{ 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 df200e374..870bcf2a6 100644 --- a/playbooks/libvirt/openshift-cluster/templates/domain.xml +++ b/playbooks/libvirt/openshift-cluster/templates/domain.xml @@ -6,6 +6,7 @@ env-{{ cluster }} env-host-type-{{ cluster }}-openshift-{{ type }} host-type-{{ type }} + sub-host-type-{{ g_sub_host_type }} 1 -- cgit v1.2.3 From 332aa8c8219ba99510090ce2412326780ad9ce74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Thu, 13 Aug 2015 14:45:25 +0200 Subject: Better structure the output of the list playbook The list playbook listed the IPs of the VMs without logging their role like: TASK: [debug ] ************************************************************ ok: [10.64.109.37] => { "msg": "public:10.64.109.37 private:192.168.165.5" } ok: [10.64.109.47] => { "msg": "public:10.64.109.47 private:192.168.165.6" } ok: [10.64.109.36] => { "msg": "public:10.64.109.36 private:192.168.165.4" } ok: [10.64.109.215] => { "msg": "public:10.64.109.215 private:192.168.165.2" } The list playbook now prints the information in a more structured way with a list of masters, a list of nodes and the subtype of the nodes like: TASK: [debug ] ************************************************************ ok: [localhost] => { "msg": { "lenaicnewlist": { "master": [ { "name": "10.64.109.215", "private IP": "192.168.165.2", "public IP": "10.64.109.215", "subtype": "default" } ], "node": [ { "name": "10.64.109.47", "private IP": "192.168.165.6", "public IP": "10.64.109.47", "subtype": "compute" }, { "name": "10.64.109.37", "private IP": "192.168.165.5", "public IP": "10.64.109.37", "subtype": "compute" }, { "name": "10.64.109.36", "private IP": "192.168.165.4", "public IP": "10.64.109.36", "subtype": "infra" } ] } } } --- playbooks/libvirt/openshift-cluster/list.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'playbooks/libvirt') diff --git a/playbooks/libvirt/openshift-cluster/list.yml b/playbooks/libvirt/openshift-cluster/list.yml index eaedc4d0d..5954bb01e 100644 --- a/playbooks/libvirt/openshift-cluster/list.yml +++ b/playbooks/libvirt/openshift-cluster/list.yml @@ -18,6 +18,12 @@ - name: List Hosts hosts: oo_list_hosts + +- name: List Hosts + hosts: localhost + gather_facts: no + vars_files: + - vars.yml tasks: - debug: - msg: 'public:{{ansible_default_ipv4.address}} private:{{ansible_default_ipv4.address}}' + msg: "{{ hostvars | oo_select_keys(groups[scratch_group] | default([])) | oo_pretty_print_cluster }}" -- cgit v1.2.3