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": {
        "trove": {
            "venv_tag": "14.2.1"
        }
    }
}

Change-Id: Id2545ad38d78c5c28310b67a8a3eb74b8b51b026
(cherry picked from commit cec3b715d1)
This commit is contained in:
Jesse Pretorius 2017-05-22 15:49:47 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 51b38916ad
commit 93913b6af5
1 changed files with 7 additions and 0 deletions

View File

@ -116,3 +116,10 @@
command: >
virtualenv-tools --update-path=auto --reinitialize {{ trove_bin | dirname }}
when: trove_get_venv | changed
- name: Record the venv tag deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: trove
option: venv_tag
value: "{{ trove_venv_tag }}"