diff options
4 files changed, 10 insertions, 8 deletions
| diff --git a/inventory/libvirt/hosts/libvirt_generic.py b/inventory/libvirt/hosts/libvirt_generic.py index 0a98e2af3..4652f112e 100755 --- a/inventory/libvirt/hosts/libvirt_generic.py +++ b/inventory/libvirt/hosts/libvirt_generic.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2  """  libvirt external inventory script @@ -131,7 +131,7 @@ class LibvirtInventory(object):              root = ET.fromstring(domain.XMLDesc())              ns = {'ansible': 'https://github.com/ansible/ansible'} -            for tag_elem in root.findall('./metadata/ansible:tag', ns): +            for tag_elem in root.findall('./metadata/ansible:tags/ansible:tag', ns):                  tag = tag_elem.text                  self.push(inventory, "tag_%s" % tag, domain_name)                  self.push(hostvars, 'libvirt_tags', tag) diff --git a/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_network.yml b/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_network.yml index a320e681e..3117d9edc 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_network.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_network.yml @@ -3,7 +3,7 @@    command: "virsh -c {{ libvirt_uri }} net-info {{ libvirt_network }}"    register: net_info_result    changed_when: False -  failed_when: "net_info_result.rc != 0 and 'error: Network not found:' not in net_info_result.stderr" +  failed_when: "net_info_result.rc != 0 and 'no network with matching name' not in net_info_result.stderr"  - name: Create a temp directory for the template xml file    command: "mktemp -d /tmp/openshift-ansible-XXXXXXX" diff --git a/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml b/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml index b49879c6a..8a67d713f 100644 --- a/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml +++ b/playbooks/libvirt/openshift-cluster/tasks/configure_libvirt_storage_pool.yml @@ -16,7 +16,7 @@    command: "virsh -c {{ libvirt_uri }} pool-info {{ libvirt_storage_pool }}"    register: pool_info_result    changed_when: False -  failed_when: "pool_info_result.rc != 0 and 'error: Storage pool not found:' not in pool_info_result.stderr" +  failed_when: "pool_info_result.rc != 0 and 'no storage pool with matching name' not in pool_info_result.stderr"  - name: Create the libvirt storage pool for openshift    command: 'virsh -c {{ libvirt_uri }} pool-create-as {{ libvirt_storage_pool }} dir --target {{ libvirt_storage_pool_path }}' diff --git a/playbooks/libvirt/openshift-cluster/templates/domain.xml b/playbooks/libvirt/openshift-cluster/templates/domain.xml index 8cb017367..7656249da 100644 --- a/playbooks/libvirt/openshift-cluster/templates/domain.xml +++ b/playbooks/libvirt/openshift-cluster/templates/domain.xml @@ -2,10 +2,12 @@    <name>{{ item }}</name>    <memory unit='GiB'>1</memory>    <metadata xmlns:ansible="https://github.com/ansible/ansible"> -    <ansible:tag>deployment-type-{{ deployment_type }}</ansible:tag> -    <ansible:tag>env-{{ cluster }}</ansible:tag> -    <ansible:tag>env-host-type-{{ cluster }}-openshift-{{ type }}</ansible:tag> -    <ansible:tag>host-type-{{ type }}</ansible:tag> +    <ansible:tags> +      <ansible:tag>deployment-type-{{ deployment_type }}</ansible:tag> +      <ansible:tag>env-{{ cluster }}</ansible:tag> +      <ansible:tag>env-host-type-{{ cluster }}-openshift-{{ type }}</ansible:tag> +      <ansible:tag>host-type-{{ type }}</ansible:tag> +    </ansible:tags>    </metadata>    <currentMemory unit='GiB'>1</currentMemory>    <vcpu placement='static'>2</vcpu> | 
