* Update ansible-config_template from branch 'master'
to ca25191181ef1d1269afe95ad0911bac8d4d0610
- [doc] Document limitation and workaround for variables in mapping keys
Related-Bug: #2048036
Change-Id: Iadaab9c1d9af63bb32a2f9f6977b08fa7f643165
* Update ansible-config_template from branch 'master'
to 04e621b5bdebef8d99755e445eda9e378428c4a8
- Fix releasenotes build
When building releasenotes (with 'tox -e releasenotes') the job fails
with the following error:
WARNING: Invalid configuration value found: 'language = None'. Update
your configuration to a valid language code. Falling back to 'en'
(English).
This caused publish-openstack-releasenotes-python3 post release job
failure as well. By removing the explicit set of language of None makes
the sphinx warning disappear.
Change-Id: I2482824f78901e14781bde49674bde4a9fd431ec
* Update ansible-config_template from branch 'master'
to c272bc341ac3965555b8f5a6ebb6237e447002ed
- Revert "Publish openstack.config_template on galaxy"
This reverts commit d90989ef87626fa9e87eb0e44de75e14e60be6b4.
Reason for revert: This job requires secret that can not be shared the way it is
originally supposed. So we should find other way around to publish collection to the galaxy.
Change-Id: I748bc0d2e476148c38f8305f15fd6e573eb7d008
* Update ansible-config_template from branch 'master'
to 36934a118197bd49028dec75fccd5662dbf1ec13
- Merge "Fix usage of {% raw %} tags and Jinja2 headers"
- Fix usage of {% raw %} tags and Jinja2 headers
At the moment we do resolve template 2 times for some historical reasons
This leads to {% raw %} tag as well as any other content be not respected
on the second renderring, since after the first one these tags
are gone, so no escaping or whatsoever work.
At the same time there're no obvious reasons to render second time,
since all override content is being renderred already. So there should
not be anything left that indeed needs this second run.
Change-Id: I414b1b3b4e426316707dda23b9aeff6b6f4f7c2f
Closes-Bug: #1649381
* Update ansible-config_template from branch 'master'
to 8d14af7a2f7ba68966b802ce48c46e9420f3d328
- Merge "Add support for start/end_string arguments"
- Add support for start/end_string arguments
In case template contains some Jinja content that we don't want to
resolve, there're not much options due to the bug, that ignores
{% raw %} tags. The other way to work it around is to override tags that
Jinja will use to detect the content it needs to render. This way
content that should be renderred can be placed in the same template
with the one that needs to stay intact.
Change-Id: I4d28f5ab03858f5555f5e9e555da1dddc0f2b016
Related-Bug: #1649381
* Update ansible-config_template from branch 'master'
to 2a59c043edcf98bcb5221e58d5aea2f89c2c9657
- setup.cfg: Replace dashes with underscores
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:
UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Change-Id: I74130dab437c7ec7333d19bf2efc6f9b6095a0ff
* Update ansible-config_template from branch 'master'
to 795122864bb33aacac33d71360990b252185eff1
- Remove TripleO jobs
We are tearing down TripleO master because of project removal.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-openstack_hosts/+/877665
Change-Id: I7b64e77a9a2939971cca965a8837ce0471bdac61
* Update ansible-config_template from branch 'master'
to 26a8d943527a74026eeaa4f00d6d4d8b480c3ce7
- Replace deprecated whitelist_externals
This option was deprecated in favor of the allowlist_externals option
and does no longer work in recent tox.
Change-Id: I1cbf545c382fdb4dda837699392e59061ccf8f75
* Update ansible-config_template from branch 'master'
to 2ccc59fa13c9834344d9c040cfa818b7d16f6800
- document the removal of keys in ini files
which requires an empty dictionary in playbook YAML config_overrides
parameter
Change-Id: I3ab9c434883e743738b3e06d54c3c54c84bc7217
* Update ansible-config_template from branch 'master'
to dae35c0bc329764bacfb47132f465d3cfbf70c2a
- Merge "Publish openstack.config_template on galaxy"
- Publish openstack.config_template on galaxy
We try to re-use ansible-colelctions-openstack CI job [1] for
publishing config_template collection.
[1] 86b573883a/.zuul.yaml (L352-L373)
Change-Id: Ib0ba55190864bbb5544ae4ef58aea588d9f53d24
* Update ansible-config_template from branch 'master'
to 29ddca2734ccca4d067689055e936b2e30434c41
- Update documentation about installation methods
config_template historically was published on PyPi during times before
collections were a thing. This was one of the installations methods
that is not relevant or preffered since collections are here.
That patch aims to update documentation about ways of plugin
installation as well as adding deprecation notice of PyPi.
In the futher releases we will drop publishing on PyPi.
Change-Id: Ie1cd7b305b4d82fd0fbf4568ef20ff3d0236c049
* Update ansible-config_template from branch 'master'
to c24b5ad83dd37daa97b6fb2d288927661c1e2b5f
- Merge "Add blank lines between functions and classes"
- Add blank lines between functions and classes
Change-Id: Id178c7e7311f8e1e9950c94d2ab4fa46c396d6d0
* Update ansible-config_template from branch 'master'
to 15c29209f0f3c0845b749d36ceb12d78b8984c66
- Merge "Add more complete examples with sample output"
- Add more complete examples with sample output
The existing examples from code are not sufficient to explain
how the various features of the module can be used. This patch
hopes to add more practical examples to show some of the
features.
Hopefully this also sets a trend so that more examples are added
in the future.
Change-Id: I035ce06a2391904724aaf8b0a724d7b4fa8e27f0
* Update ansible-config_template from branch 'master'
to a17a949e9987616a98e60a4dba32357376871ae2
- Release config-template to 1.3.0
We have merged bunch of changes to the collection, so worth releasing it
now.
Change-Id: Icb839e648388ab4f12679e40f554a12d3461497d
* Update ansible-config_template from branch 'master'
to 3222aeda8f6a2d380802153a15a5fd961d356024
- Use ensure SafeDumper used yaml configs
With ansible 2.12 they started using CSafeDumper instead of
SafeDumper which ignores indent in yaml files.
To preserver behaviour and config formats we fallback to original
behaviour with indenting.
For that we adjust parenting of AnsibleDumper and adding SafeDumper
when it's not present there.
[1] bfd93c835a/lib/ansible/module_utils/common/yaml.py (L30)
Change-Id: Iadddef84eae31fab9478ad02220ae49d1c91fa4c
* Update ansible-config_template from branch 'master'
to ed68c9d67d72887bc0de90f90cf26e421bb6a514
- Remove orphaned releasenotes
These releasenotes appear to be originally from
https://opendev.org/openstack/openstack-ansible-plugins
and do not pertain to anything in the config_template
module.
Change-Id: I23f0395d52e2c639dc987b37e0f251b8f3ea418b
* Update ansible-config_template from branch 'master'
to 78e7f22caa79a19ecfed9d4e378bd0d261a93a11
- Replace include for newer ansible version
In order to pass functional tests on newer ansible we need to replace
dropped inlcude with proper import_playbook module.
Change-Id: I2bf9ca6003b66d5f7b8be9d7b54e12cb9b56f3c6
* Update ansible-config_template from branch 'master'
to 8ca0706565ffa3f6a03d567e106c6c4a64c72209
- Set py_modules to an empty list in setup.py
This prevents setuptools 61.0.0 doing autodiscovery and failing
as this is an ansible role, not a python module.
Change-Id: I5ef8a23aed6193bc61e52f0b069a835d229597d5
* Update ansible-config_template from branch 'master'
to 461379169dbcc83cdc73fc7465f7d94c99a06c8e
- Copy refactor of code quality issues
The following commit copy implemented by ceph-ansible [1] code quality
issues detected by DeepSource:
- Use literals instead of function calls to create data structure.
- Refactor useless else block in the loop.
[1] a0bc5afe26 (diff-ee824655f36c314a50f7dfe3f4c5ed7b41d4168ce17ec243139c6913192c6d66)
Change-Id: Ied7219f215cbbd7c2eb131234d59992a68f59e81
* Update ansible-config_template from branch 'master'
to 7422a0941b8aa29eebe45c192844a27c25c216ef
- Move config_template to plugins/action
Unlike to the modules, ansible-galaxy tool does not respect symlinks,
which results in collection brokeness after it installation as plugin
itself is just missing there.
In the meanwhile, symlinks are respected by regular git clone which
is used for regular module retrievment.
Change-Id: I747b217e6b0706c05e5fae98bc5b89be3cbb5930
* Update ansible-config_template from branch 'master'
to bb1d445a08e4a2dccb3503625199c9d11368adda
- Add option to install as collection
We create symlink and galaxy.yml file so that this module
could be installed as an ansible collection in addition
to already used methods.
Change-Id: I2f49028fbea09a2f38b54544ae96dee9d0156f6f
* Update ansible-config_template from branch 'master'
to 8a9b9622d5225177891bf0fa14b4b37b8c5fb379
- Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654
Change-Id: If4aa4ee0d63a046635f7236cf35aa6125133adab
* Update ansible-config_template from branch 'master'
to 331d8932aa6f60fc540db65c2bbabac25825e79d
- Add PKI role to functional testing
Change-Id: I5b1f1fcaef6cab54b3ad4ba3c31afeccf66f97d3
* Update ansible-config_template from branch 'master'
to 57efa55efbc1d16ee1538786c93af27d916d4039
- Merge "Remove references to unsupported operating systems"
- Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7 are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible
Change-Id: I705b1ea8907a12d30a05a7b3ebbbfb7a8a021325
* Update ansible-config_template from branch 'master'
to 62812dedc0d7b1dbf98ca785f0a0f1988aab415e
- Run tests against localhost and container
Use localhost and container1 as proper targets for the test playbook
rather than a combination of import_tasks/delegate_to for container1.
The previous code did not run the imported tasks against container1,
but instead a second time against localhost. This makes the handlers
checking the output from ansible diff fail as on the second run
against localhost there are no changes, giving an empty diff.
Changing the test play targets to localhost:container1 makes it more
obvious that the whole test playbook should be run against the host
and the container. It is not clear from the old code if the original
intent was to specifically test config_template tasks delegated from
the host to a container.
Change-Id: Ibc72868d9957567fe86a9d3205a80ec33441baff
* Update ansible-config_template from branch 'master'
- Fix section overrides when commented option persist
In cases, when key already exist, but commented out without space
(ie "#key) and is not in default section, it's not updated with
sectdict.insert statement. That is possible happens because
self._sections keys are protected and can't be overwritten (at least
new assignment makes no difference)
Change-Id: Ie0c588a2d559bd38c68b3d018e547a036d83214c
Closes-Bug: #1889547
* Update ansible-config_template from branch 'master'
- Update config_template to use the builtin _get_remote_user function
This change will ensure the config_template module is able to pull the appropriate
remote use when creating a temp file or directory.
Related-Bug: #1884816
Change-Id: I36b13db4d0b722e7c6c7244ab142003193a56ffe
Signed-off-by: Kevin Carter <kecarter@redhat.com>
* Update ansible-config_template from branch 'master'
- Modernise tox.ini and run OSA metal jobs in CI
There was no coverage of an actual OSA deployment in CI, so we
add this. Also remove the legacy python3 functional test
and move all tox environments to be python3.
Change-Id: I36cee01b9a14adf1840d35c3a8934de8a994f399
* Update ansible-config_template from branch 'master'
- Templar: use available_variables
This aims to resolve deprecation warning: set_available_variables is
being deprecated. Use "@available_variables.setter" instead
Change-Id: I95191ad596656051bd6a2ba8dd720823ea3434ec
* Update ansible-config_template from branch 'master'
- Update docstheme for style
New version of openstackdocstheme (Victoria+) respects pygments_style.
Since this repo is using now Victoria (master) requirements but has
not branched for Ussuri yet, it uses the new version.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
Change-Id: I65491a951bee4fbdc15206de98b35cd569508bd7
* Update ansible-config_template from branch 'master'
- Add option to enable / disable the template engine
This change allows a deployer to selectively enable or disable the
template engine. This will allow folks to override the contents of
a configuration file via the `config_overrides` option but not render
any jinja related content within the file, except for what is provided
by the `config_overrides` option.
Change-Id: If226b4814a88b3bd7968b5e2ef64474710665ae0
Signed-off-by: Kevin Carter <kecarter@redhat.com>
* Update ansible-config_template from branch 'master'
- Add traps for py3 and fix remote src
This change adds traps for the FileNotFound exception which is used instead
of OSError when a file is not found. This will ensure that that fall back
exception handeling works properly in py2 and py3.
The remote_src flag was not being respected with the new fallback options,
this change adds a check for remote_src so it works in normal and fallback
mode.
Change-Id: I136dd1f3220d3b004d5275a9fa15edea53d58f6b
Signed-off-by: Kevin Carter <kecarter@redhat.com>