From ee521f91f281535b38047d94f32c987b9bd87ff5 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 6 Dec 2022 12:12:03 +0100 Subject: [PATCH] Stop using need_service_restart local fact We can reduce complexity of logic on when to restart glance as we anyway leverage in-role handlers to restart service when needed. Patch adds also triggering service restart when install_packages are changed. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/866693 Change-Id: Ieeeb9bc3b8922700e0c70f150cf1af0a75c805ea Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/866126 --- tasks/glance_install.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tasks/glance_install.yml b/tasks/glance_install.yml index 441f7dcd..f2a6a445 100644 --- a/tasks/glance_install.yml +++ b/tasks/glance_install.yml @@ -114,6 +114,8 @@ until: install_packages is success retries: 5 delay: 2 + notify: + - "Restart glance services" - name: Install the python venv import_role: @@ -130,23 +132,11 @@ union(glance_user_pip_packages) | union(((glance_oslomsg_amqp1_enabled | bool) | ternary(glance_optional_oslomsg_amqp1_pip_packages, []))) }} venv_facts_when_changed: - - section: "glance" - option: "need_service_restart" - value: True - section: "glance" option: "venv_tag" value: "{{ glance_venv_tag }}" when: glance_install_method == 'source' -- name: Record the need for a service restart - ini_file: - dest: "/etc/ansible/facts.d/openstack_ansible.fact" - section: "glance" - option: "need_service_restart" - value: true - when: (install_packages is changed) or - ('need_service_restart' not in ansible_local['openstack_ansible']['glance']) - - name: Run the systemd service role include_role: name: systemd_service