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>
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>
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
Adds missing 'domain' parameter to function which
was causing errors when using keystone federation.
Change-Id: Icfc06feae806a9faf8f4d12bf2281dd6c9772989
Closes-Bug: 1733108
Signed-off-by: Michael Rice <michael@michaelrice.org>
iteritems is a py2 callable and will break when using py3.
Change-Id: Icea444baea8f3597cb8dd24e3d61e9ed0926cdf5
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
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
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
Uses keystone.client instead of keystone.client.v3 with session and auth
to return a keystone client with the discovered URL.
Also sets project_domain_name and user_domain_name do "Default" as they
are expected by Keystone.
Change-Id: I8fce922e2907584138a132f37887f227eabe9abe
Partial-Bug: #1688320
Set no_log=True for the 'login_password' and 'password' arguments of the
keystone module so that they will not be printed in plain text within
Ansible run output.
Change-Id: I07748e9ff1c1459f0eacf1409bef4e158c9e6446
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
When bootstrapping Keystone it is sometimes useful to ignore the
service catalog and contact a specific Keystone instance.
Change-Id: I6ecfc422b0e8a7a5fadea08389c1268009ac7f2a
The magnum and neutron modules parse an openrc file and create key-value
pairs by literally assigning the key to anything in front of an '=' and
the value to everything after an '='. If the value is surrounded by
quotes, do not include them.
Depends-On: I4b1e7b5cb83061ea35108db545fdfa33cef037a5
Change-Id: Ib44d9fa63332286fe4e51bd818f80b5989815988
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
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
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
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
In python 3, range() does what xrange() used to do and xrange() does not
exist. If you want to write code that will run on both Python 2 and
Python 3, you can't use xrange().
range() can actually be faster in some cases - eg. if iterating over the
same sequence multiple times. xrange() has to reconstruct the integer
object every time, but range() will have real integer objects.
(It will always perform worse in terms of memory however)
xrange() isn't usable in all cases where a real list is needed.
For instance, it doesn't support slices, or any list methods.
Change-Id: I033289359882c08185d59d13fa0b994c4566185a
The existing logic only parsed the first flat network, but having
multiple flat networks is perfectly legal.
Change-Id: I15a17aa8f72d177c5afba3d34ee978e3fe576a67
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>
Glance requires that the passed image properties be an iterable
dictionary.
Update the documented example to use YAML's syntax for a dictionary
instead of a JSON string. The resulting string will be deserialized
to a Python dict.
Change-Id: I2f02a4e772398d0c133d3109058d55c4f96b72f7
The dist-sort module has been updated to ensure its execution
is effective, fast, and nonintrusive. There are cases where
the rounds made by the module take an excessive amount of time
to complete. This change ensures that the module is limiting its
rounds to a known index and the iterable is processed using a
generator.
Change-Id: I03d1f70cb6cd17f38ef37b4d8371a8982beca29e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Since glance image_properties is not a required argument, only attempt
to include it in the glance image create options when it's provided.
Change-Id: Ia4b27e1f3b433ac0efa89a1794c81f9c522093fb
The 'Glance' plugin lacked the ability to set properties
on the images that were created via the plugin. This patch
adds that ability.
Change-Id: If2c73050ed8335b3a22b79bb7ce28189de046427
Instead of inserting 'True' and 'False' into Ansible's BOOLEANS
constants, designate the parameters as a 'bool' type.
ansible.module_utils.basic will downcase and handle ensuring the
variables are cast to booleans.
Change-Id: I2fc70a90df5cca76b49fc21adee59350173157d9
This commit adds "state" parameter in the keystone module for
its ensure_endpoint command.
This is the state parameter behavior:
- When not set or set to present, it will ensure the endpoint
with the URL given will be present in keystone
- When set to update, it will ensure that the same kind of
endpoint gets its url changed if it was different. If there
was no endpoint of the same kind, the module will create the
endpoint
- When set to absent, the module will delete the endpoint with
the given url.
Closes-Bug: #1426191
Change-Id: Ie5e715d02f2d5fb96ceeb2c3e368090aa4702599
Update the ensure_user, ensure_user_role, and ensure_group_role commands
and dependent functions to allow creation of and role assignment to a
user without specifying a project.
This will allow use of the keystone library for creating users, such as
the heat stack admin, within only a domain.
Since a role can only get granted to either a project or domain at one
time, only attempt to grant the role within the project if both are
provided.
Notifications of state changes for the ensure role commands have also
been fixed.
Partial-Bug: 1579612
Change-Id: I6a132e5407c9881a047037b85bd6e25b85c0d8a1
In the os_keystone role, the 'Ensure Keystone user to Admin role'
this patch causes 'keystoneclient.exceptions.ValidationError:
Specify either a domain or project, not both'.
This reverts commit 2e1492a127.
Change-Id: I8784d4213e297fd78477b54b21c47f4c5223bb1e
Update the ensure_user and ensure_user_role commands and dependent
functions to allow creation of and role assignment to a user without
specifying a project.
This will allow use of the keystone library for creating users, such as
the heat stack admin, within only a domain.
Partial-Bug: 1579612
Change-Id: I0e4c51e772f61d4879716b7b5dbe5c8211cea901
When creating a subnet, we retrieve the allocation_ranges from the
variables dict with a default value of "". This should then be fine for
various string operations. The problems is that ansible defaults
varialbes that aren't supplied to None. This means they are present in
the variables dict so don't get the default value of "".
To fix this the code that parses allocation_ranges is wrapped in an
additional conditional.
Change-Id: Ie0310c3da050336ed9b5f5d8fc02e3a4d704491d
This allows IP allocation to be restricted to user provided ranges
within a subnet.
This is genreally useful, but the specific impetus is to avoid IP
conflicts between instances and the hosts on the public network in an AIO.
This patch does not solve the problem but paves the way for one that will.
Change-Id: I5e57bd43a2637c5e8508a7a0f0c6a41587aba94a
Partial-Bug: #1564491
When using the ansible keystone to create projects, users, or
other keystone operations by using login_user and login_password
fails asking to define login_project_name, but when login_project_name
is defined, fails with message:
"msg": "unsupported parameter for module: login_project_name"
this is because such key is not defined in the keystone library.
Change-Id: I7c6bdfd9e6ca51b4c4045204f1dd49733c949dad
Closes-Bug: 1551423