From 9bd0e45d1f2930ed5fcab676f9f2536573dcb60b Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 10 Feb 2022 14:12:52 +0200 Subject: [PATCH] Drop libvirtd_version identification Since all supported distros have libvirt version >= 5.7 there's no reason to ensure that it is true. So we remove corresponsive code and simplify logic. Change-Id: I281829214df8affec7774a45a3ca0405a866b5c0 --- handlers/main.yml | 2 - tasks/drivers/kvm/nova_compute_kvm.yml | 53 -------------------------- 2 files changed, 55 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index ee06a198..b50afcfe 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -31,8 +31,6 @@ state: "{{ item.condition | default(False) | ternary('started', 'stopped') }}" enabled: "{{ item.condition | default(False) }}" masked: no - when: - - libvirtd_version is version('5.7', '>=') with_items: - name: libvirtd-tls.socket condition: "{{ nova_libvirtd_listen_tls | bool }}" diff --git a/tasks/drivers/kvm/nova_compute_kvm.yml b/tasks/drivers/kvm/nova_compute_kvm.yml index aff0bcfc..e2986d3f 100644 --- a/tasks/drivers/kvm/nova_compute_kvm.yml +++ b/tasks/drivers/kvm/nova_compute_kvm.yml @@ -21,25 +21,6 @@ tags: - always -- name: Check libvirtd version - command: "libvirtd --version" - register: _libvirtd_version_cmd - changed_when: false - tags: - - nova-install - - nova-config - - nova-kvm - - nova-libvirt - -- name: Set libvirtd version - set_fact: - libvirtd_version: "{{ _libvirtd_version_cmd['stdout'].split()[-1] }}" - tags: - - nova-install - - nova-config - - nova-kvm - - nova-libvirt - - name: Set nested kvm virt copy: src: kvm.conf @@ -112,22 +93,6 @@ - nova-kvm - nova-libvirt -- name: Set libvirt runtime options (Ubuntu) - lineinfile: - dest: "/etc/default/libvirtd" - line: 'libvirtd_opts="-l"' - regexp: "^libvirtd_opts=" - backup: "yes" - when: - - (nova_libvirtd_listen_tcp == 1) or (nova_libvirtd_listen_tls == 1) - - libvirtd_version is version('5.7', '<') - - ansible_facts['pkg_mgr'] == 'apt' - notify: Restart libvirt-bin - tags: - - nova-config - - nova-kvm - - nova-libvirt - - name: Unset libvirt runtime options (Ubuntu) lineinfile: dest: "/etc/default/libvirtd" @@ -135,7 +100,6 @@ regexp: "^libvirtd_opts=" backup: "yes" when: - - (nova_libvirtd_listen_tcp == 0 and nova_libvirtd_listen_tls == 0) or libvirtd_version is version('5.7', '>=') - ansible_facts['pkg_mgr'] == 'apt' notify: Restart libvirt-bin tags: @@ -143,22 +107,6 @@ - nova-kvm - nova-libvirt -- name: Set libvirt runtime options (RPM) - lineinfile: - dest: "/etc/sysconfig/libvirtd" - line: 'LIBVIRTD_ARGS="-l"' - regexp: "^(#)?LIBVIRTD_ARGS=*" - backup: "yes" - when: - - (nova_libvirtd_listen_tcp == 1) or (nova_libvirtd_listen_tls == 1) - - libvirtd_version is version('5.7', '<') - - ansible_facts['pkg_mgr'] == 'dnf' - notify: Restart libvirt-bin - tags: - - nova-config - - nova-kvm - - nova-libvirt - - name: Unset libvirt runtime options (RPM) lineinfile: dest: "/etc/sysconfig/libvirtd" @@ -166,7 +114,6 @@ regexp: "^(#)?LIBVIRTD_ARGS=*" backup: "yes" when: - - (nova_libvirtd_listen_tcp == 0 and nova_libvirtd_listen_tls == 0) or libvirtd_version is version('5.7', '>=') - ansible_facts['pkg_mgr'] == 'dnf' notify: Restart libvirt-bin tags: