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

Change-Id: I17f67d01c1711d27dab9dd835585b1b0a9a33835
(cherry picked from commit 3a1ce7a37c)
This commit is contained in:
Jesse Pretorius 2017-05-22 15:42:55 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 4110fca2b9
commit b217195f8a
1 changed files with 7 additions and 0 deletions

View File

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