From d0ded3201681e415f81f720148cb4619eec816a4 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 12 Sep 2022 09:43:26 +0100 Subject: [PATCH] Follow ups to venv Follow ups to Icd60aca084323cede944ee261d2cf5941b320e4b. Change-Id: Id25a8b35ad42ee7f095098c210bc14926aec18ed --- ansible/host_setup.yml | 3 +-- ansible/roles/virtualbmc-daemon/tasks/main.yml | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/host_setup.yml b/ansible/host_setup.yml index ed4d253..da5ecb6 100644 --- a/ansible/host_setup.yml +++ b/ansible/host_setup.yml @@ -1,6 +1,6 @@ --- - name: Create Tenks venv - hosts: all + hosts: localhost:hypervisors tags: - host-setup tasks: @@ -78,7 +78,6 @@ include_role: name: virtualbmc-daemon vars: - selinux_enabled: "{{ ansible_facts.selinux.status | default('disabled') == 'enabled' }}" vbmcd_virtualenv_path: "{{ virtualenv_path }}" vbmcd_python_upper_constraints_url: >- {{ python_upper_constraints_url }} diff --git a/ansible/roles/virtualbmc-daemon/tasks/main.yml b/ansible/roles/virtualbmc-daemon/tasks/main.yml index ec69f4e..31bcc86 100644 --- a/ansible/roles/virtualbmc-daemon/tasks/main.yml +++ b/ansible/roles/virtualbmc-daemon/tasks/main.yml @@ -76,8 +76,11 @@ become: true command: "restorecon -r {{ vbmcd_virtualenv_path }}/bin" when: sefcontext.changed + changed_when: true - when: selinux_enabled and vbmcd_virtualenv_path + when: + - ansible_facts.selinux.status | default('disabled') == 'enabled' + - vbmcd_virtualenv_path - name: Ensure Virtual BMC systemd service is configured template: