zuul-jobs/roles/update-json-file/README.rst
Sorin Sbarnea 762ce6e96e update-json-file: avoid failure when destination does not exists
It is perfectly valid to want to add a value to a file that
does not exist yet, even the path may be missing.

This fixes last night regression when installing docker no longer
creates the /etc/docker folder, causing our MTU update to fail.

Change-Id: I0f037d1d6664de3c3b777aaf6da9cd7c3e8bb15f
Reference: https://review.rdoproject.org/zuul/builds?job_name=tox-py36-ci-config&project=rdo-infra/ci-config
2021-02-12 13:26:49 +00:00

1.2 KiB

Update JSON file

This role reads a JSON file, merges it with supplied values using Ansible's combine filter and writes it back out. It is useful for updating configuration files. Note this role is not currently idempotent and will write the file each time.

Role Variables

The mode for the combined file.

The user for the combined file.

The group for the combined file.

The mode for the directory if that does not already exists.