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

Change-Id: Ic28e2d9d755eb8f5dfe30a7fc82da7eecd122765
This commit is contained in:
Jesse Pretorius 2017-05-22 15:44:58 +00:00
parent 72e2f6f3ea
commit 4dfa9a89e9
1 changed files with 7 additions and 0 deletions

View File

@ -108,3 +108,10 @@
when:
- not molteniron_developer_mode | bool
- molteniron_get_venv | changed or molteniron_venv_dir | changed
- name: Record the venv tag deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: molteniron
option: venv_tag
value: "{{ molteniron_venv_tag }}"