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
This commit is contained in:
Jesse Pretorius 2017-05-22 15:43:49 +00:00
parent ad3ec0c806
commit be11b503b1
1 changed files with 7 additions and 0 deletions

View File

@ -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 }}"