tripleo-common/roles/tripleo-upgrade-hiera
Jiri Stransky f48331f36b Fix tripleo-upgrade-hiera key deleting
The commit fixes these issues:

* When tripleo-upgrade-hiera key deleting was used multiple times in a
  playbook, the fact tripleo_upgrade_hiera_data_del persisted from the
  previous invocation instead of getting gradually filled from empty
  dict. This resulted in never deleting the keys except on the first
  run of the task.

* When the key deleting was called in an Ansible `loop`, the external
  `item` variable and the internal `item` in the deleting code
  conflicted on naming, breaking the removal of the key. We now use
  `loop_var: upgrade_hiera_item` to avoid naming collisions.

Closes-Bug: #1832827
Change-Id: I3fa0717203f3f6eae852d019bec71e97eb485aa2
(cherry picked from commit 6cfc204630)
2019-07-01 16:20:33 +00:00
..
defaults New role to create/update/delete hiera value during upgrade. 2019-01-22 13:53:57 +01:00
tasks Fix tripleo-upgrade-hiera key deleting 2019-07-01 16:20:33 +00:00
README.md New role to create/update/delete hiera value during upgrade. 2019-01-22 13:53:57 +01:00
test-playbook.yml New role to create/update/delete hiera value during upgrade. 2019-01-22 13:53:57 +01:00

tripleo-upgrade-hiera

An Ansible role to set hiera value during upgrade as json value/key.

Role variables

Required:

  • tripleo_upgrade_key -- the hiera key to setup. (optional for remove_all)
  • tripleo_upgrade_value -- the hiera value to setup. (non-needed for remove and remove_all)

Optional:

  • tripleo_upgrade_hiera_file -- hiera file to were the variable go. (defaults to "/etc/puppet/hieradata/upgrade.json")

Test playbook

Assuming you have tripleo-inventory.yml generated, you can run the test playbook like:

ANSIBLE_ROLES_PATH=tripleo-common/roles \
ANSIBLE_HOST_KEY_CHECKING=False \
ansible-playbook
    -i tripleo-inventory.yml \
    tripleo-common/roles/tripleo-upgrade-hiera/test-playbook.yml

License

Free software: Apache License (2.0)

Author Information

OpenStack TripleO team