From 6c50146670ff5aea31afb73a682571c2302c4871 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 6 Feb 2018 09:51:08 -0600 Subject: [PATCH] Add defaults for lxc container_tech When upgrading the container_tech option may be undefined. This change adds defaults to the container_tech conditional following the patter we use through the rest of the playbooks. Closes-Bug: #1747628 Change-Id: I415116f92f164a36f4594f3d11d109e60f62a9bd Signed-off-by: Kevin Carter --- playbooks/common-playbooks/cinder.yml | 2 +- playbooks/common-playbooks/nova.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/playbooks/common-playbooks/cinder.yml b/playbooks/common-playbooks/cinder.yml index e58c5d293e..18cda91272 100644 --- a/playbooks/common-playbooks/cinder.yml +++ b/playbooks/common-playbooks/cinder.yml @@ -89,7 +89,7 @@ {% endif %} with_dict: "{{ cinder_backends | default({}) }}" when: - - container_tech == 'lxc' + - container_tech | default('lxc') == 'lxc' - physical_host != container_name - cinder_backend_lvm_inuse | bool delegate_to: "{{ physical_host }}" diff --git a/playbooks/common-playbooks/nova.yml b/playbooks/common-playbooks/nova.yml index 0de833892d..a31635b43e 100644 --- a/playbooks/common-playbooks/nova.yml +++ b/playbooks/common-playbooks/nova.yml @@ -93,7 +93,7 @@ 'added' in device_add.stdout.lower() delegate_to: "{{ physical_host }}" when: - - container_tech == 'lxc' + - container_tech | default('lxc') == 'lxc' - "'nova_compute' in group_names" - "not is_metal | bool" tags: @@ -104,7 +104,7 @@ lxc-device -n {{ container_name }} add /dev/net/tun /dev/net/tun delegate_to: "{{ physical_host }}" when: - - container_tech == 'lxc' + - container_tech | default('lxc') == 'lxc' - "'nova_compute' in group_names" - "not is_metal | bool" tags: @@ -116,7 +116,7 @@ delegate_to: "{{ physical_host }}" register: kvm_device when: - - container_tech == 'lxc' + - container_tech | default('lxc') == 'lxc' - "'nova_compute' in group_names" - "not is_metal | bool" tags: @@ -131,7 +131,7 @@ changed_when: > 'added' in device_add.stdout.lower() when: - - container_tech == 'lxc' + - container_tech | default('lxc') == 'lxc' - "'nova_compute' in group_names" - "not is_metal | bool" - "'ischr' in kvm_device.stat and kvm_device.stat.ischr | bool"