Commit Graph

47 Commits

Author SHA1 Message Date
Elod Illes 04e621b5bd 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
2023-11-13 16:56:52 +01:00
Dmitriy Rabotyagov e528ed0e9e 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
2023-05-01 11:17:53 +02:00
Dmitriy Rabotyagov fdb572d0ba 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
2023-04-29 02:54:36 +00:00
niuke e8a66da627 remove unicode prefix from code
Change-Id: I867dd90aba8f504137dee53b9ce4f025b75ff6de
2022-08-24 19:41:07 +08:00
Dmitriy Rabotyagov 29ddca2734 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
2022-06-23 12:16:24 +02:00
Jesse Pretorius (odyssey4me) ed68c9d67d 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
2022-06-13 17:51:48 +01:00
Andreas Jaeger 436042ee87 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
2020-05-20 16:45:12 +00:00
Dmitriy Rabotyagov 266432bdd5 Replace git.openstack.org with opendev.org
This patch replaces git.openstack.org with opendev.org as redirection
from old path was enabled.

Change-Id: I703c4d371e746995166c37516d3db68652ce67d5
2019-11-14 19:14:50 +02:00
Kevin Carter c53966f310
Add the ability to parse list only files
This change will allow config_template to parse list only files
and extend or replace the content of the list based on the
selected module options.

Change-Id: I2a24033b0323bcc25bd1b50ffb4034441ab2f468
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-07-25 16:37:56 -05:00
Kevin Carter 09c76e2380
Enhance the config_template comment parser
The config_template comment parser will now respect all comments in
INI files, as they are written. This will ensure spacing, paragraphs,
and other comments bits that may be in an INI file remain intact,
even when overriding options and sections. With this feature we'll
now be able to insert options in OSLO config generated files without
truncating or making a mess of the file structure.

This is an internal enhancement and requires no change from the
operator or from within any ansible task. To ensure enhanced comments
are working, new tests have been added which will run though all of
the `config_template` INI file functions using a mock service file.
Existing tests for the old comment structure has been removed.
This includes tests that were running redundant tasks for file
diffs or expected the only style, merged, comment layout. All of the
tests have been broken out into descriptive task files. This was
largely done for readability. It was difficult to see what tests
we had and how I needed to extend them to test the enhanced comments
functionality given the INI type tests were all thoughout the
`tests/test-common-tasks.yml`. Now that the files have been broken
out developers will easily be able to audit our tests making it
simple to extend.

Change-Id: Ia6cdc215c35fa9ac45b718c211616a9887a74e37
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-07-23 12:49:41 -05:00
Kevin Carter 73aa099f0a Add option to use a remote source
The config template action plugin assumes that the local node is
supplying a configuration file that will be used to copy content
to a target node. This change gives the module the ability to
change configuration files on target nodes using all remote
sources. The new boolean option, `remote_src` has been added to
enable or disable this functionality. When enabled, the module
will retrieve content from the target node and load it as
"user_content". By pre-loading it in the user content the
module will function normally without any major structural
changes or performance impact.

Change-Id: Id9c7e16fb935c2da0b32b7cf53449f68bd1e9c89
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-07-09 16:19:08 +00:00
Michael Vollman b74d7acbf4 Compare dict vars to determine changed
Compare dict vars of before and after configuration to determine whether
the config keys or values have changed so a configuration file will not
be incorrectly marked as changed when only the ordering has changed.

Set diff return variable to a dict of changes applied.

Change-Id: Ie67119b1420936c8ed89f8338ea9dce4c47e185c
2018-09-24 20:08:51 -04:00
Andy McCrae 75cb8670fb Allow default section in ini to be specified
The default section in an ini file will always be 'DEFAULT', but for some
configuration files you may want to be able to set this to ensure
another section is at the top. 'global' for example, when working with
fio.

This PR adds the ability to set the section to be at the top, but will
default to 'DEFAULT' so no change will happen to existing tasks running
config_template.

Change-Id: Ifbc0b91aef46f3c2d98e73fdc9ab888244550bab
2018-05-09 12:57:33 +01:00
Andy McCrae 2c6ebef2a4 Fix pep8 for config_template.py
Gate tests will fail until we fix pep8 for config_template.py
This PR fixes the config_template module for pep8 compliance,
follows the latest PTI for docs compliance,
and re-enables the linters.

Change-Id: Ic288b462a53ac45983f47f29a7d5d8d48d0b9c0b
Co-Authored-By: Jean-Philippe Evrard <jean-philippe@evrard.me>
2018-03-26 12:53:57 +00:00
OpenStack Release Bot fcf65b89d5 Update reno for stable/queens
Change-Id: I7b1fec79d98997cfe71d8584a01c08caf79cba7a
2018-02-14 15:51:21 +00:00
Kevin Carter c665f9f2a2
Remove the vars plugin as it's no longer used
This plugin is no longer used and conflicts with Ansible 2.4. Master
has recently moved to Ansible 2.4 and placed all of the group_vars back
into the inventory path. Being that the plugin is no longer required
and results in a runtime warning[0] it's being removed.

[0] - http://paste.openstack.org/show/628674/

Change-Id: If91214dd2d2a36da82e5433a3a4a36c3946cbf4e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-12-12 22:09:29 -06:00
Andreas Jaeger 7145937250 Remove setting of version/release from releasenotes
Release notes are version independent, so remove version/release
values. We've found that projects now require the service package
to be installed in order to build release notes, and this is entirely
due to the current convention of pulling in the version information.

Release notes should not need installation in order to build, so this
unnecessary version setting needs to be removed.

This is needed for new release notes publishing, see
I56909152975f731a9d2c21b2825b972195e48ee8 and the discussion starting
at
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html
.

Change-Id: I1694a1b7da68e29e83e2931d40befc1683719c2c
2017-11-17 08:09:51 +01:00
Jean-Philippe Evrard ead9047761 Initial OSA zuul v3 role jobs
This patch implements an initial set of jobs intended to match
the current job execution method. It does not intend to improve
how the jobs are executed - only to replicate what is currently
in openstack-infra/openstack-zuul-jobs and provide the platform
to iterate on.

Change-Id: Id5a41c4f09bfc63b373e83493dd85a53850bd71c
2017-10-17 20:43:54 +00:00
OpenStack Release Bot d54eda4e9d Update reno for stable/pike
Change-Id: Ia7628628484b0834b2ed915aec8e41dd146fade8
2017-08-21 10:34:45 +01:00
Jenkins e5ec919e77 Merge "Add a get_nested filter" 2017-07-07 22:16:35 +00:00
Nolan Brubaker 80a1262252 Add a get_nested filter
When accessing nested facts, such as in ansible_local sections, guard
statements in the when clause can get quite long, due to having to
repeate the 'in/not in' logic for every key at every level.

The get_nested filter attempts to instead to move the guard into a
single line, making the conditions easier to write and maintain.

As example,

   ('openstack_ansible' not in ansible_local or
    'swift' not in ansible_local['openstack_ansible'] or
    'venv_tag' not in ansible_local['openstack_ansible']['swift'] or
    ansible_local['openstack_ansible']['swift']['venv_tag'] == swift_venv_tag)

 could be rewritten as

     get_nested(ansible_local, 'openstack_ansible.swift.venv_tag') == swift_venv_tag

Change-Id: I3b43c25c8783c43cf5285f2b3e7267b2c5712ea0
2017-07-07 19:42:39 +00:00
ZhongShengping 38a7c29364 Fix openstackdocstheme settings
To use openstackdocstheme 1.11.0 properly, this patch fixes
some settings according to follow[0].

[0]https://docs.openstack.org/openstackdocstheme/latest/

Change-Id: I39e4ca8729a68786c950ade684ca3e5edaa68cca
2017-07-03 16:48:23 +08:00
Jenkins 5360291611 Merge "Add ignore_none_type to config template" 2017-06-26 21:15:55 +00:00
Miguel Alex Cantu 76d5f02a32 Add ignore_none_type to config template
It is sometimes useful to tell ConfigTemplateParser to write
out options that are valueless and not suffixed with '=' or ':',
such as when overriding a my.cnf.

This commit adds the 'ignore_none_type' attribute to the config_template
module. If this attribute is set to false, then valueless options will be
written out to the resultant INI file as-is, without the '=' or ':' suffix.

Change-Id: I5c88b2019c01b44193a5d0df9299ecce6de52f01
Partial-Bug: #1693234
2017-06-26 19:12:43 +00:00
ZhongShengping 2869a79ec8 Switch from oslosphinx to openstackdocstheme
As part of the docs migration work[0] for Pike we need to switch to use the
openstackdocstheme.

[0]https://review.openstack.org/#/c/472275/

Change-Id: I66ea11e32ec9736e2376027863723c19c07a32fb
2017-06-26 14:52:48 +08:00
Jimmy McCrory a5d669f0b4 Remove neutron library
As of Ansible 2.3, the os_network module now allows more additional
options for 'provider_network_type'[0]. Use of OSA's neutron plugin can
be removed.

[0] https://github.com/ansible/ansible-modules-core/issues/5589

Change-Id: If74185ecca1ea639c2e1526b5542e89dd533084b
Implements: blueprint use-std-ansible-modules
2017-05-24 23:00:42 +00:00
Jean-Philippe Evrard 77bbd15bdb Introduce userspace group_vars and host_vars
This opens the door to using group_vars and host_vars in
userspace, by allowing the user to define a ":" delimited list
of folder that will then be used by a vars_plugin, and (maybe
later) by the inventory.

This can't override group_vars due to ansible precedence.
We could technically have this override done by moving the
group_vars into a different folder and adding it to these
environment variables.

Change-Id: Id22e82b01b08885a1c7b516818ca07e75f6d558f
2017-03-14 12:57:33 +00:00
Andy McCrae 5822e29d41 Always update existing matching endpoints
There is no usecase for having 2 endpoints that have the same Region,
interface, service_name and service_type.

The keystone module should default to update these endpoints if the url
is different, but the Region, interface, service_name and service_type
match.

This will make the default behaviour of state "present" to match that of
state "update".

Change-Id: I0ade538e20f2a926b33c1637446c2d4f650cd13d
2017-03-14 11:10:17 +00:00
OpenStack Release Bot b02850124b Update reno for stable/ocata
Change-Id: Ia1a37102f4d0c119ca9cf852c1e4ee443a434479
2017-02-03 18:58:55 +00:00
Bjoern Teipel ab176bbe0d Implementation Neutron SR-IOV
This change adds the new attribute
``sriov_host_interface`` in order to map ml2 network
names to physical SR-IOV capable network interfaces.

Co-Authored-By: James Denton <james.denton@rackspace.com>

Change-Id: Ia62725e2369f75000157e0ab2c3f858e61fef10d
Closes-Bug: #1653283
2017-01-09 11:12:05 -06:00
gecong1973 1325a99cee Delete unnecessary utf-8 coding
The file was added redundant utf-8 coding by some editor.
we can delete it .

Change-Id: Iac814d97c435b5620ecb2c333218e044255f4bb8
2016-12-27 10:22:00 +08:00
Logan V 800ef36999 Revert "Remove neutron library"
Using the upstream library breaks the ability to test network plugins
that use 'local' neutron networks (ie. calico).

https://github.com/ansible/ansible-modules-core/issues/5589

This reverts commit 38b899b63b.

Change-Id: I8a33db524c24324dc2af8463a43cb145f7cc34d6
2016-11-12 17:12:48 -06:00
Jimmy McCrory 0af898835a Remove glance library
With the use of this library replaced by upstream Ansible modules it's
no longer necessary to carry it.

Closes-Bug: 1538642

Change-Id: I55591132180eec99ce9b9bc38caa996b01d18949
Depends-On: Ic98613c37069ccb2ec1bc9a7644c922cc5b37e22
Depends-On: I017303e9a731ebc60315ea1784ba184a8294b08e
Depends-On: If0e36c61307056c8786c67b60fd56b03f2ad7bda
2016-11-11 09:19:45 -08:00
Jimmy McCrory 38b899b63b Remove neutron library
With the use of this library replaced by upstream Ansible modules it's
no longer necessary to carry it.

Change-Id: Iedc9c18a457eb2b620538c693337860b80a85123
Depends-On: I8c165531407c6b6aa8e5910cb28ae610b53e2ee5
2016-11-04 10:45:56 -07:00
Jenkins 35d486984d Merge "Add get_networks command to neutron library" 2016-10-12 17:36:22 +00:00
Andy McCrae 6b5a7d942d Add get_networks command to neutron library
get_networks will return network information, and will fail if the
specified "net_name" network is not present.
If no "net_name" is specified the network information will be
returned without performing the check on the existence of "net_name"
network within neutron.

Change-Id: I01775c9b29e312cc6696ffdc708befc46d11bf52
2016-10-12 13:28:09 +00:00
Andreas Jaeger 2e4aeaa007 Enable release notes translation
Releasenote translation publishing is being prepared. 'locale_dirs'
needs to be defined in conf.py to generate translated version of the
release notes.

Note that this repository might not get translated release notes - or
no translations at all - but we add the entry here nevertheless to
prepare for it.

Change-Id: I22dc695c28fe800a16f0ec14f6cbeb4d16319192
2016-10-06 20:39:19 +02:00
Davanum Srinivas 2d117d9980 Update reno for stable/newton
Change-Id: Iac324da9f4872d36a7e420959a29e68c3929d97b
2016-09-29 19:15:40 +00:00
Kevin Carter 80beba88da Add option to toggle list extensions
By default a list item in a JSON or YAML format will extend if a its already
defined in the target template and a config_override using a list is being set
for the existing "key".

This change allows that functionality to be toggled on or off. The boolean
option to enable list extension is ``list_extend``.

To maintain the API this feature will remain True by default.

Co-Authored-By: Travis Truman <travis_truman@cable.comcast.com>
Change-Id: I97e06aef2cc778f048f3d6863fe61d10eddb8602
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-09 16:15:00 -05:00
Jenkins 2b38db1e1c Merge "Implement an opportunistic strategy and connection plugin" 2016-08-26 02:55:25 +00:00
Kevin Carter cb01efef66 Implement an opportunistic strategy and connection plugin
This change is creating an opportunistic Ansible execution strategy and
an update the ssh connection plugin so that it supports direct access to lxc
containers within ever having to ssh into them.

The intention of this change is to speed up execution time and reliability by
tuning the execution environment within Ansible to run faster while also attempting
to subvert transient ssh issues.

Change-Id: Ide34513bf82523257bdd2a8a68dff165f9927c56
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-25 17:45:10 +00:00
Kevin Carter 7f50658956 Update the lookup plugin to force dep ordering
This change ensures that the dependency file ordering
for requirements file is kept intact for all fot the discovered
file used to build the repo environment.

Change-Id: I36d2044965c8a0809a417083c3f24c406b5a36c9
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-07-18 15:49:22 +00:00
Jenkins d790fa6a7d Merge "Adjust release note for config template" 2016-05-04 20:30:49 +00:00
Gabor Lekeny dce1b35de9 Add user and project login domains to keystone
Added login_user_domain_name and login_project_domain_name parameters to
keystone module.

Closes-Bug: #1574000

Change-Id: I29524ac9dad063c266122ecee09563531217974c
Signed-off-by: Gabor Lekeny <gabor.lekeny@ericsson.com>
2016-05-03 07:34:54 +00:00
Jesse Pretorius 79f3735ee0 Adjust release note for config template
The config template release note has a stand alone 'fixes' note which,
when rendered, makes no sense as it stands alone. As the bug is
clearly attached to the milestone it is unnecessary to mention the
bug fixed so that line has been removed.

Change-Id: Ia40e2e08be4d384eb3e5992502daaebe3d338d32
2016-05-03 08:33:51 +01:00
Travis Truman 4a70773429 Add reno scaffolding for release notes management
Change-Id: Ia51af4f15a03b722bc419013d041244674511dd8
2016-05-02 10:45:15 -04:00
Kevin Carter b42faff784
Add MultiStrOps support to config_template
This change adds the MultiStrOps variaable type to the config
template parsing as well as supports multi string options when
passing configuration overrides.

This is made prossible by using the set type for options found within
config overrides and creating a custom dictionary class that allows
for multiple keys to be stored as a set. When the config_template
encounters a set type it will process and reder value as a
MultiStrOps.

Set types are defined in yaml via the "?" entry.

Example Overrides:
  things:
    - 1
    - 2
  multistrops_things:
    ? a
    ? b

Example Rendered Config:
  things = 1,2
  multistrops_things = a
  multistrops_things = b

Change-Id: I2193ea2eb7f839c3151c2c96f9dfe86f141e5a15
Closes-Bug: #1542513
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-02-10 09:12:36 -06:00