tripleo-ansible/tripleo_ansible/roles/tripleo_upgrade_hiera/tasks/set.yml

30 lines
1.1 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: ensure tripleo-upgrade hiera file exists
include_tasks: create-tripleo-upgrade-file.yml
- name: set/update the tripleo-upgrade key/value
set_fact:
tripleo_upgrade_hiera_data_add: "{{ tripleo_upgrade_hiera_command.stdout | from_json | combine({ tripleo_upgrade_key: tripleo_upgrade_value }) }}"
cacheable: false
- name: write the updated tripleo-upgrade hiera data
copy:
content: "{{ tripleo_upgrade_hiera_data_add | to_nice_json }}"
dest: "{{ tripleo_upgrade_hiera_file }}"
become: true