From be11b503b1c094f84b50f97bb30fb128e4188b82 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 22 May 2017 15:43:49 +0000 Subject: [PATCH] Add venv_tag local fact In order to make it easier to detect the currently deployed venv for a service, and therefore allow smarter decisions for things like upgrading, we implement the venv tag as a local fact. The file used to store facts will be the same for all OpenStack services, with each service using its own section. Example: "ansible_local": { "openstack_ansible": { "magnum": { "venv_tag": "14.2.1" } } } Change-Id: If7e92533cbf351a552aa5caecafde3c07499ea6e --- tasks/magnum_install.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/magnum_install.yml b/tasks/magnum_install.yml index 5d1674e..c33830f 100644 --- a/tasks/magnum_install.yml +++ b/tasks/magnum_install.yml @@ -111,3 +111,10 @@ command: > virtualenv-tools --update-path=auto --reinitialize {{ magnum_bin | dirname }} when: magnum_get_venv | changed + +- name: Record the venv tag deployed + ini_file: + dest: "/etc/ansible/facts.d/openstack_ansible.fact" + section: magnum + option: venv_tag + value: "{{ magnum_venv_tag }}"