kubeconfig should be loaded if *either* or both of context
or kubeconfig is set (this allows picking a context and default
kubeconfig or picking a kubeconfig with default context)
Fixes#47149
* Behave better if auto_remove and output_logs are combined. Warn if output cannot be retrieved because of auto_remove.
* Add tests.
* Added changelog.
Currently there is no way to reset the custom_compatibility_version to
NULL. If we provide a empty string('') to custom_compatibility_version,
it will fail with error "IndexError: list index out of range" at _get_minor
function.
To reset the custom_compatibility_version, we have to pass None value to
types.Version. The PR fixes the same.
This reverts commit 0e933f76ba.
The tests for this were broken on centos6 because jinja2 does not have
a map filter on that platform. Tests need to be rewritten
This patch fixes an error that occurs when attempting to see if the
netns already exists on the remote device. This change will now execute
`ip netns list` and check if the desired namespace is in the output.
Signed-off-by: Peter Sprygada <psprygada@ansible.com>
* Fix prompt mismatch issue for ios
Fixes#40884#44463
* If the command prompt is matched check if data is
still pending to be read from buffer.
* This fix adds a new timer `buffer_read_timeout`
which will be trigerred after command prompt
is matched and data is attempted to be read from channel.
If not data is present of channel the timer will expire
and response we be returned to calling function.
* Fix unit test failure
* Update to make buffer timeout float
* Update doc and fix review comment
* Fix CI issues
* Update doc
* Fix review comments
* Fix review comments
* Fix AWS EC2 inventory plugin caching of groups
* Added changelog fragment for aws_ec2 caching fix
* Store the AWS query results
The underlying inventory object contains inventory from other sources,
so caching it as ours would be wrong.
It seems easiest and safest to just cache the boto query results
instead.
* Remove unused functions
When a non-existent Gluster volume is to be deleted, i.e.:
gluster_volume:
state: absent
name: vol1-does-not-exist
the "gluster_volume" module would always fail with "volume not found
vol1-does-not-exist". The reason is that the code checked whether the
state is "delete", a value which isn't accepted for the "state"
parameter. Instead the expected value for volume deletion is, as above,
"absent".
Using blockinfile with a custom marker lacking {mark} results in non-idempotency - block is repeatedly inserted on subsequent playbook runs.
+label: docsite_pr
* New module vmware_host_powermgmt_policy
* minor changes
Signed-off-by: Christian Kotte <christian.kotte@gmx.de>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* New module vmware_host_ipv6
* Minor changes
Signed-off-by: Christian Kotte <christian.kotte@gmx.de>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
If a "domain" parameter is provided, use it in looking up the user ID.
Additionally, if both a domain and project parameter are provided, then
remove the domain ID from the list of filter criteria after having used
it to look up both the user and the project. OpenStack will not allow us
to apply both a project ID (which implies a domain) and a domain ID as a
search filter.
Fixes#42911
* Add datacenter_name alias
* Improve vcenter_folder module
* add check mode support
* fix VM folder deletion
* fix folder deletion under parent folder
* fix (host) folder creation if two datacenters are present
* Resolve invalid-unary-operand-type.
* Resolve raising-format-tuple.
* Resolve stop-iteration-return.
* Use disable comment instead of fixing logic.
The affected line in _find_address_range will only fail on Python 3.7
and later if the function is called with an empty address list. As an
internal method it is never called in this way, making it a non-issue
for use via public methods.
Using a comment to disable the rule in favor of an ignore.txt entry
since there are no plans to change the logic in the code itself. This
will also prevent any potential future issues being added in other
parts of the code when updating it based on upstream changes.
Fixes: https://github.com/ansible/ansible/issues/45900
This PR fixes the case when the cloud_init_persist was used, but we
still sent use_cloud_init=False, which is in oVirt API evaluated as not
to use cloud_init in first VM execution. This patch is changing it to
send just None, instead of False.
Signed-off-by: Ondra Machacek <omachace@redhat.com>
* Add runtime option to docker_container module
Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>
* Add changelog fragment
Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>
* Add idempotency test for docker_container.runtime
Signed-off-by: Antoine Bardoux <abardoux@nvidia.com>
##### SUMMARY
The azure_rm_cdnprofile module was missing a valid sku 'standard_microsoft'. Added it to the list of valid choices.
##### ISSUE TYPE
- Bugfix Pull Request
##### COMPONENT NAME
azure_rm_cdnprofile
##### ANSIBLE VERSION
```
ansible 2.8.0.dev0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0]
```
##### ADDITIONAL INFORMATION
It was not possible to deploy using the 'standard_microsoft' sku previously. This addition allows this.
* win_domain: Add missing functionality
* Fix typo: Treshold -> Threshold
* Improvements based on feedback
* moved mode checks to after pre-reqs are installed
The kind: paramter is missing from the original example (which won't actually work). The organization needs to be listed as required (if you don't list it, you will get an error). Also adding additional example using the tower_username and tower_password method.
* reboot: Add timeout in error to help troubleshooting
So we've been hit by 'Timed out waiting for boot_time check' and it was
unclear what timeout was used for the boot_time check. By adding the
timeout value it is easier to understand the used value, and verify if a
change to the timeout is reflected in the output.
* Add changelog fragment
This PR fixes the update check method so it now check also the next_run
configuration of the virtual machine if it exists.
So if previously the VM was updated with new parameters, and then reset
back, the module didn't set the parameters to be set back in next_run.
This PR fixes it so the next run configuration is set back with proper
parameters.
Signed-off-by: Ondra Machacek <omachace@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1639894
Signed-off-by: Ondra Machacek <omachace@redhat.com>
* kick off
* done for the day
* beta code and test
* fix a typo
* boto3_conn and boto_exception aren't used in this code, ec2_argument_spec is used but unneeded.
* Returning when find a match avoids doing extra work, especially when pagination is involved
* add new permissions for test
* (output is changed) is preferred over accessing the attribute directly.
* pass the result through camel_dict_to_snake_dict() before returning it.
* AnsibleAWSModule automatically merges the argument_spec.
* deletes the created resources even if a test fails.
* AnsibleAWSModule automatically merges the argument_spec.
* fix typo
* fix pep8
* paginate list_repositories
* specify permissions for test
* cut the unnecessary code.
* add return doc string
* add missed ':'
* fix syntax error: mapping values are not allowed here
* add description for return
* fix syntax error
* rename module name and turn off automated integration test.
* add key_data argument
The key_data argument helps when using a private key stored in Vault.
* Add "version_added" line
Add version_added line to pass automated tests.
* remove unnecessary nesting
* Adding iam_password_policy module
* fixing various issues -- error handling, bugs
* fixing various issues based on tests
* renaming dummy var
* fixing type reference in documentation
* adding int tests and other updates
* removing typo
* fixing auth for int tests
* removing int tests for now
* readding integration tests w/ unsupported designation
* removing conflicting group
* Update aliases
* Fix unused variable
* removed hardcoded loader/plugins list
* updated a few errors to keep orig object
* fix httpapi/cliconf listing
* ansible-doc fixes
* show undocumented as UNDOCUMENTEd
* added missing undoc
* Add support for IOS vlan parsing filter.
Example usage below:
{% set parsed_vlans = vlans | vlan_parser %}
switchport trunk allowed vlan {{ parsed_vlans[0] }}
{% for i in range (1, parsed_vlans | count) %}
switchport trunk allowed vlan add {{ parsed_vlans[i] }}
* Update test_network.py
Add import statement for filter
* Fixed PEP8 issues relating to comments
* Fix PEP8 issues related to blank lines
* Removed magic numbers for line lengths. This should generalize support
to other IOS-like NOS that use similar methods for listing vlans. The
default arguments for line lengths will still be specific to Cisco IOS.
The unit tests for line length are still specific to Cisco IOS.
* An earlier optimization of ansible-doc -l caused failures.
The optimization quickly searches the plugin code for short_description
fields and then uses that in the -l output. The searching was a bit too
naive and ended up pulling out malformed yaml. This caused those
plugins to be omitted from the list of plugins of that type with
a warning that their documentation strings were wrong.
This change makes the documentation parser aware that the documentation
string could have a relative indent for all of its fields which makes it
robust in the face of this particular problem.
* Don't search for space after short_description:
Any whitespace would be valid. In particular newline
1. Add support for SCSI controller creation
2. Support for SCSI Type
3. Warn about Disk Unit Number 7
4. Allow specifying SCSI controller
5. Allow specifying Disk Unit Number
6. Idempotency
7. Remove disks
8. Do not allow to reduce disk
9. More than 15 disks support
10. No SCSI controller and unit number check
11. Thin support
12. Update documentation and example
13. Multiple Datastore and datastore cluster support
14. Check datatype of disk unit number and SCSI controller
15. Handle disk_size when it is int or float
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Update pydoc
* Update module documentation and example
* Add aliases for name as creation_token
Fixes: #28738
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Added secure boot enable/disable to vmware_guest_boot_manager. Also added its state to facts
* VMware does not support secure boot when boot_firmware is bios. Add some guardrails to protect the user from misconfiguration
* Address review comments
When multiple virtual machines or templates are found in environment,
module needs folder path. This fix adds facility to specify folder path
for template or virtual machine if multiples are found.
Fixes: #37087
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Fix in confirmed_commit capability in netconf_config modules
Fixes#46804
* If confirm value is greater than zero or confirm_commit option is set and confirmed-commit
capability is not supported but Netconf server only in that case fail the module
* Update confirm-commit flag
* Minor changes
* Don't execute mount or umount in check mode
* The datastore was mounted or unmounted when you execute the playbook in
check mode.
* Test if running in check mode before mounting or unmounting the
datastore.
* Add support for NFS v4.1 datastores
* Move ansible.compat.tests to test/units/compat/.
* Fix unit test references to ansible.compat.tests.
* Move builtins compat to separate file.
* Fix classification of test/units/compat/ dir.
Python sets the SIGPIPE handler to SIG_IGN. On execv() signal handlers are
reset to their defaults, EXCEPT those that are SIG_IGN which are left ignored.
In Python 3 subprocess.popen explicitly resets the SIGPIPE handler to SIG_DFL,
but unfortunately in Python 2.7 it does not. This leads to subprocesses being
executed with SIGPIPE ignored. This is often a problem with bash scripts which
rely on SIGPIPE to terminate commands in a pipe, but can easily be a problem
with other applications.
This implements the Python 3 behaviour for Python 2.7 by using a preexec_fn.