Add variant local fact

In order to make it easier to detect the variant used
when a container was deployed, and therefore potentially
allowing smarter descisions for things like replacing
the container when a new variant is available, we
implement the variant 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": {
        "lxc": {
            "variant": "default"
        }
    }
}

Change-Id: I340bfea36353381424f2abda62af814aabca98cf
This commit is contained in:
Jesse Pretorius 2017-05-22 13:19:32 +00:00
parent 61d36c1151
commit 64261a0c19
1 changed files with 7 additions and 0 deletions

View File

@ -473,3 +473,10 @@
state: directory
tags:
- lxc_container_create-install
- name: Record the container variant deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: lxc
option: variant
value: "{{ properties['lxc_container_variant'] | default(lxc_container_variant) }}"