* Make sure the uri module warns about using the deprecated HEADER_ arguments, so that we can actually deprecate in a future version
* Use module.deprecate
* No need to de-dupe ourselves, looks like it is done somewhere I didn't initially see
* Renamed the avi_ansible_utils to avi. Fixed the import error and cleaned up code.
* Refactored all new modules to use the new module_utils.avi
* Added module_utils.avi to python 2.4 skip list
This is the original `hpilo_facts` module that was once accepted in
Ansible but had been removed subsequently because it could not be tested
by the Ansible project.
Since then it was moved to the ansible-provisioning project and
maintained by HP engineers going forward.
Now we are trying to get it upstreamed again.
* new implementation of win_msg. TODO tests
* added check_mode. Get-AnsibleParam for parameters. Default msg is now 'Hello world!'. Use hash for $results.
Re-ordered some parameters alphabetically.
Documentation now in raw strings. Removed spurious required: false. Added metadata.
* Keep pep8 checks happy
* Really keep pep8 checks happy this time
* update Changelog.md
* make bracket style internally consistent
* added units to display_seconds description
This is the original iso_extract module from the ansible-provisioning project.
We are upstreaming all our modules, and this PR is part of that process.
This is the original `hpilo_boot` module that was once accepted in
Ansible but had been removed subsequently because it could not be tested
by the Ansible project.
Since then it was moved to the ansible-provisioning project and
maintained by HP engineers going forward.
Now we are trying to get it upstreamed again.
Fixes ansible#21796 Prevent users from deleting buckets rather than objects by making object parameter and mode=delobj mutually exclusive in task.
https://github.com/ansible/ansible/issues/21796
* Added check for avi SDK version as suggested in review.
* Fixed documentation based on review.
* Renamed module_utils.avi to module_utils.avi_ansible_utils
as import of avi.sdk would fail due to name collisions.
Moved the code to check for AVI version into the ansible modules.
* Updated the module with note about reason for name change.
* Add quota for the number of floating IP's to allow in Network.
* Add nova_floating_ips and neutron_floating_ips aliases to avoid confusion.
* rename aliases to compute_floating_ips and network_floating_ips.
* fixes and improvments for win_iis_webapppool module
* fixes following review feedback on win_iis_webapppool
* Fixed a too-long line in win_iis_webapppool documentation.
* Fixed trailing whitespace for pep8 compliance in documentation win_iis_webapppool.py
* fixed bracket bug
* module parameter attributes now populated. Switched to hashtable for result object. Removed remaining ; statement terminators.
* Remove example that was causing CI check failure
The list_elbs call to boto doesn't use any pagination, so any time there
are more ELBs than the API page size, this module will fail. This change
uses the `next_token` attribute of `ResultSet` to check if there are
still more ELBs to return.
Fixes#21361
* clarify facts assignment for several corner cases
run_once/delegate_facts:
now delegate_facts > run_once, previously run_once always published facts to all hosts in play
include_vars/delegate_to:
now include_vars allows to delegate to a specific host
also fix task_vars exception in delegate_facts/loop as var was removed
fixes#15365
* removed unused loop_var
Gerrithub presents tgz downloads that do not have a containing
directory. This causes a stack trace.
As all roles must contain a meta/main.yml, change ansible-galaxy
to use that to determine the enclosing directory (in the case
of multiple meta/main.yml files, use the one with the shortest parent)
Fixes#15413
* Make more use of AWS Exception information
* Use pythonic dict assignments
* Improve documentation formatting to make option names clearer
in descriptions
* Meet ansible line length requirements
* Tidy up flake8 messages
* Subscibe to pools matched by id before name matches.
If the pools regex matches any pool ids, then subscribe only to those pools.
If there are no pool id matches, then attempt to match the regexp and pool names.
If there are pool name matches, subscribe to those pools.
Fixes#19466, https://github.com/ansible/ansible-modules-core/issues/3898 (partially)
* Add pool id/name matches to 'to keep' list
use subscribe() to use the pools-first logic on update
When trying to copy files onto a Virtio-9p filesystem[1][2] int the host
using something like the template module, ansible throws an error that
says something like:
invalid selinux context: [Errno 95] Operation not supported
Adding 9p to the list of exceptional filesystems forces ansible to not
try to set an SELinux context on copied files.
[1] such as one mounted in a qemu VM, using:
# http://www.linux-kvm.org/page/9p_virtio
qemu-kvm [...] -virtfs local,id=apps_dev,path=/host/dir,security_model=passthrough,mount_tag=host_dir
[2] https://www.kernel.org/doc/Documentation/filesystems/9p.txt
Change-Id: Ia868dadce1ffd2b5bebf5ee1804501676e9d7e5f
This is the original `hponcfg` module that was once accepted in
Ansible but had been removed subsequently because it could not be tested
by the Ansible project.
Since then it was moved to the ansible-provisioning project and
maintained by HP engineers going forward.
Now we are trying to get it upstreamed again.
* Fix vyos signatures to match new versions
* Fix test cases referring to 'updates' instead of 'commands'
* I think this is an artifact of `connection: network_cli`?
* module will now check protocol running state before return
* warns on config argument no longer being needed
* lots of integration test cases updated
* updates unit and integration test cases for state check
fixes#21908
eos_config module wasn't respecting config block path (parents). This
patch fixes that problem. Also fixes a number of integration tests
cases
fixes#21903
* win_copy: Add force parameter and check-mode support
The rationale behind this is that if you're working with +3GB files,
creating the checksum takes a lot of time, which we can avoid by simply
testing if the file exists.
I also took the liberty to put the various parameters together. It
probably takes a (neglible) performance hit but makes the code a bit
easier to inspect/work with, as its closer to all other windows modules.
On a normal run, the action plugin does a local checksum of the source
and a remote checksum of the destination. And afterwards, the module
will do another remote checksum of the copied source, a remote checksum
of the original destination, and another remote checksum of the copied
destination.
On a very huge file (think 4GB) that means 5x reading the complete file
(if you have a large cache you may get away with it, otherwise you're
doomed !).
This patch will ensure with `force: no` that not checksums are being
performed.
* Moving presence check before remote checksum
* Adapted to wishes
* Even more performance improvements
We can diff non-utf8 files (as part of copy, for instance) but when we
try to turn the bytes into text for display, the characters cause
a traceback. Since diff output is only informational, we can replace
those problematic bytes with replacement characters. We do not want to
do this to other fields because those fields may be used inside of the
playbook (for templating another variable or matching in a conditional).
Fixes#21803Fixes#21804
Since vault edit attempts to unlink
edited files before creating a new file
with the same name and writing to it, if
the file was a symlink, the symlink would
be replaced with a regular file.
VaultEditor file ops now check if files
it is changing are symlinks and instead
works directly on the target, so that
os.rename() and shutils do the right thing.
Add unit tests cases for this case and
assorted VaultEditor test cases.
Fixes#20264
Fix 'task name is not templated in retry callback'
Add a task_name property to TaskResult that knows to
check in TaskResult._task_fields.
Add integration test for v2_retry_runner callback
Fixes#18236
get_masquerade_* functions only take one arg. The action_handler
wrapper function expected a tuple, but was being passed (zone)
instead of (zone,) making for an ambiquous tuple. The
(zone) arg was being treated as a tuple/list of six chars
(the zone name) instead of a tuple of one string.
This would cause errors like:
get_masquerade_enabled_permanent() takes exactly 1 argument (6 given)
Fixes#21632
* New module for setting up Avi Pool
* Fixed inconsistency between argspec and documentation regarding defaults and required attributes
* Added support for module_check
* Added new module to setup Avi VirtualService
* Fixed the documentation error where [] brackets where used making it incompatible with yaml
* Fixed inconsistency between argspec and documentation regarding defaults and required attributes
* Added support for check mode
* New module for setting up Avi SSL Key and Certificates for Virtual Services
* Fixed inconsistency between argspec and documentation regarding defaults and required attributes
* Added support for module_check
* New module for setting up Avi Pool Group settings.
* Fixed inconsistency between argspec and documentation regarding defaults and required attributes
* Added support for module_check
* New module for setting up Avi Pool Health Monitors
* Fixed inconsistency between argspec and documentation regarding defaults and required attributes
* Added support for module_check
* Update metadata on existing openstack instances
This adds or updates existing keys, but doesn't remove them
Fixes#5500
* Set meta to {} if None
* Move common metadata parsing into a method
* win_environment: Clean up, check-mode and diff support
Changes include:
- Remove trailing semi-colons
- Replaced PSObjects into normal hashes
- Make use of Get-AnsibleParam and types
- Added check-mode support
- Added diff support
* Improve diff-support by using standard naming
I started to use the variable $diff_support for the boolean that takes
care of diff output support.
Changes include:
- Use Get-AnsibleParam with -type/-validateset
- Replace $result PSObject with normal hash
- Deprecate 'upgrade' parameter by using state=latest
* win_user: Clean up parameter handling and $result hash
Changes include:
- Use of Get-AnsibleParam and parameter types/validateset
- Removed parameter validation
- Replace $result PSObject with normal hash
* Revert to original formatting
* Parameter "groups" is a list
The requests python module is needed, however it is not a dependency of
the python-winrm package. The python-winrm package does require
python-requests_ntlm, which does not seem to pull python-requests.
So for the time being (until Red Hat fixes their package) give a more
informative error message.
* win_file_version: Clean up parameter handling and $result hash
Changes include:
- Replacing $result PSObject with hash
- Use Gt-AnsibleParam using -type
* Revert to original formatting
* win_group: Clean up and check-mode support
Changes include:
- Use Get-AnsibleParam with -type/-validateset support
- Replace $result PSObject with normal hash
- Add check-mode support
* Revert to original formatting
* win_owner: Clean up and check-mode support
Changes include:
- Use Get-AnsibleParam with -type/-validateset
- Replace $result PSObject with normal hash
- Add check-mode support
* Implemented -WhatIf:$check_mode support
* Revert to original formatting
* win_share: Clean up parameter handling
Changes include:
- Use Get-AnsibleParam with -type/-validateset
- Replace $result PSObject with normal hash
* Revert to original formatting
* win_lineinfile: Clean up and check-mode and diff support
Changes include:
- Use Get-AnsibleParam with -type support
- Replace $result PSObject with normal hash
- Remove trailing semi-colons
- Fix indentation (majority is tabs, few lines using spaces)
- Add check-mode support
- Support `r and `n for CR and LF
- Add diff support
* Implement -WhatIf:$check_mode support
* Keep original formatting as requested
* win_stat: Clean up and bugfixes
- Fix an issue where LastWriteTime was actually LastAccessTime
- Return lnk_source = $null for a broken link
- Remove a useless -Replace '\\','\\'
- Make use of new parameter options (-type and -aliases)
* Deprecate get_md5 with checksum_algorithm: md5
As suggested in comments we deprecate get_md5 and internally
replace it with `get_checksum` and `checksum_algorithm: md5`.
We show a warning to the user about this change.
Also remove empty warnings output. This simplifies modules code
(e.g. standard empty list is provided and snippets can add items).
* Adapted to use the new Add-DeprecationWarning() mechanism
* Revert to original formatting
* powershell.ps1: Add str type and ignore $null values
Changes include:
- New "str" type support using -type "str"
- Ensure that $null values are retained (for bool and str types)
(Note: $null means unspecified value for parameters)
- Some minor cosmetic changes
* Also add -type "int" and -type "float"
No modules require this at the moment though.
* win_slurp: Small cleanup
Included changes:
- Rewriting the parameter handling (aliases and type)
- Modified the $result hash for both Exit-Json and Fail-Json
- Changed the Test-Path statement
* Revert to original formatting
* win_get_url: Clean up and check-mode support
Changes include:
- Clean up parameter handling
- Replace $result PSObject with hash
* Revert to original formatting
When parsing the configuration, the wrong indent level was set so the
configurations could not be properly compared. Also noted that
defaults: yes needed to be added to the integration tests to make the
test cases valid, which is also included in this patch
fixes#21828
* Added the aix_inittab module to be able to modify the inittab at AIX systems.
* fixed identation errors
* fixed identations and trailing whitespace
changed if conditions
* repaired tab-identation
* adjusted to long line and identation
* Adjusted the yaml in the example documentation
* Adjusted the documentation yaml
* Repaired return yaml
* repaired typo
* Removed unnecessary parameters from comment
changed action to state, and changed the way to call this module
changed proccessaction to action
* adjusted result['warnings'] to module.warn()
* adjusted the documentation
* changed warning to failed
ran module against autopep8
* added check_mode
* fixed typo
* changed description and short description, to be able to push again after a failure at shippable
Set the `force` flag to false to:
- protect existing Keys from being overwritten
- check if a Key was already existing by evaluating
the returned `changed` status
When retrieving the http_port, https_port values from the configuration
of the device, the values need to cast to int in order to correctly
compare against the argspec values. This patch fixes that problem.
fixes#21832
trying to import from the wrong shared lib, this patch changes
network_common to connection. Also fixes a bug found in the nxos
action plugin to detect transport
fixes#21829
The reverted change (Examples syntax batch7 (#5624), 99de7f0) makes the
example not match its description.
modified: lib/ansible/modules/utilities/logic/set_fact.py
Sending the save command over nxapi requires text mode otherwise nxapi
will reject the command. This commit ensures that the command is always
sent in text mode
fixes#18971
The nxos action handler did not map the nxapi value to the provider
argument properly. There as an additional fix in the nxos shared lib
to properly detect nxapi being set
CentOS's cloud image wiki page (wiki.centos.org/Cloud/AWS) gives an
example of using their product code to search for AMIs. This commit
adds an optional parameter to ec2_ami_find to allow this filtering.
Does't map remote_user back into vars if connection is local to preserve
the user variable. This is done to be able to set connection_user
prop in play_context for the network_cli plugin connection
added new base class for file based cache plugins as 99% of code was common
now also catches unexpected decoding exceptions
allows per module file modes and encoding
moved jsonfile code to base
There as an invalid key in the command dict that would cause failure
using prompts. This changes the key from response to answer which is
what is expected by network_cli
* Fix string formatting
* Provide better tracebacks
* When options is None and extends_documentation_fragment is in use, add an error that options must be a dict
* If options was specified and not a dict, then error
MySQL returns privileges on columns as "PRIVILEGES (column)".
For permissions to be correctly matched, it must be specified exactly the
same in the module argument. A resulting string is like
"dbname.dbtable:PRIVILEGES (column)". Thus, the space before the opening
parenthesis must also be removed when creating the set of privileges for
validation.
* #19587: refactor to PEP8
* Issue: #19587: add skip_broken option to yum module
PNTSYSOPS-1901 - internal reference
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
* Issue: #19587: fix line break, attempt to make readble
things at line 646 look ugly ..
trying to make them look a bit more human readble
though the entire approach should be rewriten
PNTSYSOPS-1901 - internal reference
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
* #19587: fixing typo, skip-broken has to be passed as list
* PR: #21475: peer review changes
relates to: revert comment deletion https://github.com/ansible/ansible/pull/21475#discussion_r101574146
relates to: remove irelevant var https://github.com/ansible/ansible/pull/21475#discussion_r101573388
relates to: reformat https://github.com/ansible/ansible/pull/21475#discussion_r101572840
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
* PR: #21475: peer review changes
relates to: https://github.com/ansible/ansible/pull/21475#discussion_r101573736
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
* Issue: #21475: fixing typo in the Man section
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
* PR: #21475 - Peer review: revert variable a
Relates to: https://github.com/ansible/ansible/pull/21475#pullrequestreview-22404868
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
* Issue: 19587 - small correction
Signed-off-by: Veaceslav Mindru <vmindru@redhat.com> <mindruv@gmail.com>
In order to populate the total and free mem of an IOS device, we run
the 'show memory statistics' command.
The output shows something similar to:
Head Total(b) Used(b) Free(b) Lowest(b) Largest(b)
Processor BEAE880 335215488 64044364 271171124 268918092 268463852
I/O 8DAE880 51380224 41880736 9499488 9461552 9352252
We need to just parse the line containing 'Processor' and get the first and third
number for total and free mem, instaed for first and second as the code wrongly
does.
* Adding Cumulus NCLU module
* Delete incorrect testing folder
* wrong import location for nclu test
* another wrong import location for nclu test
* unittest library doesn't support 'skip', removing 'real' nclu tests
* Don't need stringio since I'm not doing real tests
* got rid of unnecessary shebang in test_nclu
* version set to 1.0
* Documentation fixes
'encrypt_string' only options were being referenced when using
other vault subcommands. That code is moved inside a check
for 'encrypt_string' action now.
This allows getting the Vault token from the `VAULT_TOKEN` env var or
from the file `$HOME/.vault-token`, as both of these are understood by
the Vault CLI and are a common place to put Vault tokens. This allows
avoiding hard-coding a Vault token into playbooks or having to include
lookups.
`HOME/.vault-token` is nice because a user can authenticate with the CLI
using `vault auth` and then the token will be stored in
`$HOME/.vault-token`. If we read this file, then we allow someone to do
`vault auth` "out of band" to set up Vault access.
The following items were implemented:
- Replace PSObject with normal hash
- Replace Set-Attr function with normal hash assignment
- Re-indent code (make sure everything uses 4 spaces)
- Remove trailing semi-colons
* fixes error where eos would close the cli shell
* fixes network_cli connection plugin to check before calling open_shell()
* fixes json commands being sent over eapi
* Add new module aos_logical_device
* Add hard stop to documentation
* Removed required false from documentation
* Add comment before sleep
* Replace IP Pool by Logical Device in the doc
* Add module aos_login
* Cleanup documentation and add hard stop
* Add default value in doc for port and remove required: false
* Fix typo in doc for check mode
* Add module aos_asn_pool
* Add hard stop to documentation
* Remove required: false from doc
* Add pool name in error message when in_use
Change Asn for ASN
* Change the documentation for content
* Initial version of aos_device
* Clean up documentation
* Move try/except closer to device.approve
* Remove non valid characters
* Change option approve to type bool and fix some typo
* Move availability_zone docs to each OpenStack module
This argument is in the central list for hysterical raisins (mostly me
being a doofus) but is used in almost none of them. Document it
explicitly in each module to stop the confusion.
* Fix two docs formatting bugs
This patch adds some checks on the path that is accessed as a container,
making sure it looks like one. It implements the connection method and
add adaptations to the modern way of writing connections for Ansible.
It also rewords docs and vars to use the nspawn terminology instead of
chroot.
This commit adds a connection driver built on top of systemd-nspawn.
This is similar to the existing `chroot` driver, except that nspawn
offers a variety of additional services. For example, it takes care of
automatically mounting `/proc` and `/sys` inside the chroot environment,
which will make a variety of tools work correctly that would otherwise
fail.
You can take advantage of other system-nspawn features to perform more
complicated tasks. For example, on my x86_64 system I have a Raspberry
Pi disk image mounted on `/rpi`. I can't use `chroot` with this because
the binaries contained in the image are for the wrong architecture.
However, I can use the systemd-nspawn `--bind` option to automatically
insert the appropriate qemu-arm binary into the container using an
inventory file like this:
pi ansible_host=/rpi ansible_nspawn_extra_args='--bind /usr/bin/qemu-arm --bind /lib64'
See http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
for more information about systemd-nspawn itself.
* Add a vault 'encrypt_string' command.
The command will encrypt the string on the command
line and print out the yaml block that can be included
in a playbook.
To be prompted for a string to encrypt:
ansible-vault encrypt_string --prompt
To specify a string on the command line:
ansible-vault encrypt_string "some string to encrypt"
To read a string from stdin to encrypt:
echo "the plaintext to encrypt" | ansible-vault encrypt_string
If a --name or --stdin-name is provided, the output will include that name in yaml key value format:
$ ansible-vault encrypt_string "42" --name "the_answer"
the_answer: !vault-encrypted |
$ANSIBLE_VAULT;1.1;AES256
<vault cipher text here>
plaintext provided via prompt, cli, and/or stdin can be mixed:
$ ansible-vault encrypt_string "42" --name "the_answer" --prompt
Vault password:
Variable name (enter for no name): some_variable
String to encrypt: microfiber
# The encrypted version of variable ("some_variable", the string #1 from the interactive prompt).
some_variable: !vault-encrypted |
$ANSIBLE_VAULT;1.1;AES256
< vault cipher text here>
# The encrypted version of variable ("the_answer", the string #2 from the command line args).
the_answer: !vault-encrypted |
$ANSIBLE_VAULT;1.1;AES256
< vault cipher text here>
Encryption successful
* add stdin and prompting to vault 'encrypt_string'
* add a --name to encrypt_string to optional specify a var name
* prompt for a var name to use with --prompt
* add a --stdin-name for the var name for value read from stdin
* removes unneeded supports_multiplexing var
* refactors terminal_prompts_re to terminal_stdout_re
* refactors terminal_errors_re to terminal_stderr_re
* updates network_cli unit test cases
The network_cli plugin would return immediately if an error was
detected. This patch will force the connection plugin to still try to
detect the current prompt even if an error is found.
Moving it to after the blocks where per-item results are calculated,
as it's not used there and causes quite a performance hit being there.
Fixes#21340
* refactors supports_sessions to a property
* exposes supports_sessions as a toplevel function
* adds open_shell() to network_cli
* implements open_shell() in eos action plugin
* Add NetApp SolidFire volume module
* Make requested changes
* Make requested changes
* Set supports_check_mode to True
* Make requested changes
* Change new_account_id to account_id, 512emulation
* Make requested changes
* Add alias for enable512e
* Move byte_map to utils and add exit message
* Update description for ‘attributes’
* refactor postgres,
* adds a basic unit test module
* first step towards a common utils module
* set postgresql_db doc argument defaults to what the code actually uses
* unit tests that actually test a missing/found psycopg2, no dependency needed
* add doc fragments, use common args, ansible2ify the imports
* update dict
* add AnsibleModule import
* mv AnsibleModule import to correct file
* restore some database utils we need
* rm some more duplicated pg doc fragments
* change ssl_mode from disable to prefer, add update docs
* use LibraryError pattern for import verification
per comments on #21435. basically LibraryError and touching up its usage in pg_db and the tests.
fix failing fail_json call in postgresql_schema
- Bugfix Pull Request
modules/database/postgresql/postgresql_schema
```
2.3.0
```
Here's an example of the error that was coming out. Massaged some linebreaks and backslashes to make it more readable:
"module_stderr": "Traceback (most recent call last):
File "/tmp/ansible_3X05GE/ansible_module_postgresql_schema.py", line 274, in <module>
main()
File "/tmp/ansible_3X05GE/ansible_module_postgresql_schema.py", line 265, in main
module.fail_json(msg="Database query failed: %s" %(text, str(e)))
NameError: global name 'text' is not defined
",
Now it triggers with the correct exception and shows the traceback. This duplication of str(e) and traceback seems to be the best design pattern.
Sample of the new output:
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_gp4v1Q/ansible_module_postgresql_schema.py", line 254, in main
changed = schema_create(cursor, schema, owner)
...
return super(DictCursor, self).execute(query, vars)
ProgrammingError: permission denied for database schemadb
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
...
},
"msg": "Database query failed: permission denied for database schemadb\n"
allows user to force persistent connection to close, needed for when
you want to benefit from changes applied to the current play but persistent connections
prevent them from being realized.
If versioning is not enabled, then `get_bucket_versioning`
can return an empty dict.
If that happens, the code to enable versioning should still
run!
The logic for suspending versioning was also incorrect, so
have updated that too.
Fixes#20491
Introduces `ignore_nonexistent_bucket` option that does not require ListBuckets permission, so less permissioned IAM roles can still be used with this module.
Fixes#20501
This change will now check the cli context after a module runs and if
the cli is still in config mode it will exit config mode. Also fixes a
minor issue with converting list of commands to a dict
fixes#21481
* First set of CNOS network modules
Two modules: cnos_vlan and cnos_command. First 2 of 17 CNOS modules
* Revert "First set of CNOS network modules"
This reverts commit 63da68b2a857e622b449f514050eed25fbcf0a35.
* cnos_vlan module
First of 17 CNOS modules
* Modify playbook for cnos_vlan module testing
* fix issue found by shippable in cnos.py
* cnos_backup module
* Fix Python3.5 compilation error
* remove cnos_backup module from this PR
* add aliases file so that testing of the cnos_vlan module will be skipped.
* Use empty aliases file
* utility scripts under module_utils changed to BSD license.
* clean up PEP8 issues, add cnos_vlan tests
* remove blank lines from yml files
* remove more blank lines
* remove even more blank lines
* Revert "remove even more blank lines"
This reverts commit bb3998661ce387260340bca39d5f146f5ec54f44.
* re-submit last commit
* fix blank lines in this file under parsing
* fix yamllint errors in doc section of cnos_vlan
* Fix errors reported by Sanity check using validate-modules
* change test playbook to include tasks for all modules
* fix additional pep8 errors
* more fixes, plus fix for python3
* fix for empty options section, removed unnecessary documentation
* fix up documentation section
* Correct options capitalization
* fix example section, add options
* Fix example section of the documentation
* Bug Fix for win_lineinfile and updated examples.
- changed $backrefs to a bool so it works with true/false/yes/no. This also fixes idempotency.
- Updated Docs with an example of using backrefs.
* Made suggested updates and converted two more parameters to "bool"
* Updated the Exception message
- Now contains the Windows Exception message as well as a custom message to help point in the right direction of a failed write.
* Updated Exception Handling
- Added Exception checks for Creating and removing the temporary files.
- Changed the ErrorAction on the copy tmpfile and remove tmp file to "Stop" to
cause the exception handler to catch all errors so we can fail gracefully
every time.
* resolve#21056 - Add support for full cloning. Fix some issues. Update doc
* Fix condition and update doc. Fixes#28585
* Using built-in helper for argspec, revert ansible metadata, add more control and remove type in documentation
* PEP8 style compliance
I have from time to time a need of random password without
wanting to write them down (one example is mailman list creation,
that requires a password to be given to be sent to the list owner).
But using /dev/null do not return null, but the empty string, which
doesn't generate a password at all and so do not achieve my use case.
* Add tests for `get_fqdn_and_port` method.
Currently tests verify original behavior - returning default `ssh-keyscan` port
Add test around `add_host_key` to verify underlying command arguments
Add some new expectations for `get_fqdn_and_port`
Test that non-standard port is passed to `ssh-keyscan` command
* Ensure ssh hostkey checks respect server port
ssh-keyscan will default to getting the host key for port 22.
If the ssh service is running on a different port, ssh-keyscan
will need to know this.
Tidy up minor flake8 issues
* Update known_hosts tests for port being None
Ensure that git urls don't try and set port when a path
is specified
Update known_hosts tests to meet flake8
* Fix stdin swap context for test_known_hosts
Move test_known_hosts from under basic, as it is its own library.
Remove module_utils.known_hosts from pep8 legacy files list
hashlib hashes operate on byte strings. When given a text string on
Python3, hashlib backtraces. When given a text string on Python2,
hashlib will backtrace if the string contains non-ascii characters.
Encode the text string to utf-8 prior to hashing to avoid this problem.
Fixes#21452
'#' and ';' are both valid comment chars for sysctl.conf files
according to the 'man sysctl.conf':
"Lines which begin with a # or ; are considered comments and ignored."
Fixes#20569
* removes unused code
* removes module_utils/local.py
* removes plugins/action/network.py
* removes action_handler from connection plugins
* removes code to use action_handler in task_executor
* updates action plugins to subclass from normal
The f5 module utils were using a file name that appeared to
conflict with the f5 python SDK's namespace. This patch just changes
the name of the included class to be f5_utils to avoid the issue
of namespace collisions
This completes the refactor of the nxos modules to use the persistent
connection. It also updates all of the nxos modules to use the
new connection module and preserves use of nxapi as well.
* updates all iosxr modules to support persistent socket
* adds iosxr action plugin to connect to device
* adds exec_command() to iosxr shared module
* fixes iosxr_config and iosxr_template local action
* update all unit test cases
* adds base test module for iosxr module testing
Don't try to create tags on a vpc that you've just removed.
Avoids
```
"msg": "An error occurred (InvalidParameterValue) when calling the CreateTags operation: You must specify one or more tags to create"
```
Although not quite sure why the `create_tags` was being called
as `module.params.get('tags')` *should* have returned `None`.
I plan on converting most all f5 modules to use the rest api, so
this is part of that conversion. it adds a factory method to get
the various rest management root apis provided in the f5 sdk
* Refactor E-Series AMG module to use module_utils
Refactor the NetApp E-Series module to utlize the common module_utils
and doc_fragments.
* Resolve a PEP8 issue with a missing newline
* Resolve compatibility issue with json import
* removes connection functions refactored into connection
* updates ComplexDict and ComplexList objects to use with AnsibleModule
* updates modules to add new argument to ComplexList & ComplexDict
* fixes issue with load_provider() not checking for an existing key
* adds updates to eos_config results key
* lots of minor syntax fixes in eos shared module
* adds eos_argument_spec to eos_eapi
fixes#21402
* Marks metadata files as outdated
Eliminates time records of the metadata and mirrorlists download
for each repository. This forces yum to revalidate the cache for
each repository the next time it is used.
* Command arguments in two separate strings to be compatible if run_command implementation changes. Doc explains a little better what is that parameter doing
* Added PubNub BLOCKS management module.
* . increased block start/stop wait to 30 seconds
* . fixed multi-line documentation
* . fixed YAML formatting in documentation section
* . removed multi-line commits
. fixed YAML format in description section
* . updated test script to upload event handler sources if non-local connection used for tests
. changed module configuration parameter from 'block' to 'name' (represent target block name)
. updated module docs regarding 'chanes' configuration parameter. Only block 'name' can be changed using this parameter ('description' can be changed directly in module call configuration)
. changed module configuration parameter from 'pwd' tp 'password'
. migrated 'urlencode' import from try..catch to six module imported from Ansible module utils
. removed custom method which is used to verify whether value is empty
* ^ fixed value for key-path function usage with names of application/keyset/block and handlers.
. reduced unnecessary requests (better pre-procesing of previous results)
. event handler name change won't trigger block restart
* ^ fixed too long documentation lines
* . moved PubNub BLOCKS client code into separate package under PyPi
. updated module code to utilize new package
. changed block start stop state to: started and started
* . small changes in documentation format
* Adding an elasticache snapshot module.
Allows user to create, copy, or delete a snapshot.
* Removing unnecessary function
* Make indentation uniform.
* Making requested changes.
Fixing PEP8
Adding a more graceful fail for delete() if the snapshot's state valid (such as when it is in the process of being created).
* PEP8
* Fixing some formatting
move imports
fix parameter alignment
* move imports to the top of the file below documentation
This patch enhances waiting operation of stateless VM to be down.
Because stateless VM creates a snapshot and removes it after the
VM is shutdown, we must wait until the VM is really prepared to
start again.
When loading the params in the local action, the provider key was
inadvertently being loaded as well. This created the circular
reference. The load_provider() method will now check for the provider
key and skip it when encountered.
fixes#21399
* Added Ordnance network module.
* Tidied up code base as per PR20436
* Whitespace blocking PEP8 test
* Removed acciental addition to VERSION
* Removed acciental addition to VERSION
* Documentation YAML issues
* removed force arg (depreciated)
Including this check in module utils so that it can be done
automatically in all F5 modules. This includes the ones that
do not yet use the f5-sdk because those modules too will move
to the SDK in the future
* updates eos modules to use persistent connection socket
* removes split eos shared module and combines into one
* adds singular eos doc frag (eos_local to be removed after module updates)
* updates unit test cases
* adds conversion to command dict into ios shared lib
* fixes hardware commands in ios_facts
* adds network_os value to play_context in ios action plugin
fixes#21190
Replaces the usage of expanduser with the type 'path' for the
dest and object options as that functionality is available
in that type automatically.
patch related to #12263
The usage of type 'path' for the path option makes the use
of expanduser redundant. This patch removes the expanduser
call because the path type is already used for the path
option
* updates all vyos modules to use socket connection
* adds vyos local action handler
* adds exec_command() to vyos
* updates vyos_config local action
* update unit test cases
* add base class for testing vyos modules
* updates all ios modules to support persistent socket
* adds ios action plugin to connect to device
* adds exec_command() to ios shared module
* fixes ios_config and ios_template local action
* update all unit test cases
* adds base test module for ios module testing
* initial commit of cloudfront_facts.py
* modification as per review from @georgepsarakis
* fixed shippable build error
* fixed shippable build error
* removed wildcard imports and replaced with specific imports from ansible.module_utils.ec2 as advised by @georgepsarakis
* renamed all instances of cloud_front_origin_access_identity to origin_access_identity as advised by @georgepsarakis
* show facts based on alias and distribution id for easy referencing as advised by @ryansb. have done for both distribution and distribution_config
* fixed incorrect logic for default list_distributions, fixed list_distributions_by_web_acl - wasn't passing web_acl_id, fixed list_invalidations keyword args missing DistributionId
* fixed last fact added clobbering all previous facts for an alias or an id
* removed list_ prefix from list keys
* removed unnecessary boto fields. made list_distributions and list_streaming_distributions dictionaries with id/alias as key. fixed list_invalidations.
* initial commit of cloudfront_facts summary
* checks for empty list returned from boto, standardised list naming
* neatened up parameters
* added summary documentation
* refactoring of functions for modularity
* refactoring, neatening code, fix for if cname not present, added try-catch blocks
* more refactoring, cleaning
* more cleaning, allowed streaming distributions to be found by domain name alias
* removed unnecessary line
* fixed tabs
* fixed indentation
* removed trailing whitespace
* removed more whitespace
* more refactoring, modified where invalidations dict is set
* added ETag to summary
* refactored summary list
* moved list out of for loop
* trailing white space
* reverted line lengthening as advised by @willthames
* modified exceptions to multi line as advised by @willthames
* reverted variable spacing to be more pythonic'
* reverted spacing in YAML as advised by @ryansb
* reverted line spacing for parameters for correct blame attribution as advised by @ryansb
* removed white space
* more white space
* reverted line spacings for parameters as advised by @ryansb
* removed spaces between parameters as advised by @ryansb
* Avoid having module documentation links to itself
A lot of modules use M(own_module) in their documentation causing a link
in the documentation to itself.
* Make note more clear now
Add nsupdate module to manage DNS records on a DNS server
This uses dnspython library
It's greatly inspired by https://github.com/mskarbek/ansible-nsupdate with some rework, better feedbacks and documentation addition
Signed-off-by: nerzhul <loic.blot@unix-experience.fr>
* Make access_token type str, remove alias, and make validate_certs default value true
* Remove extra white space and add end of file newline
* Remove comma
* Try removing that whitespace again
* new module for private cert generation
* - changes based on the reviewer's comments
* - changes based on the reviewer's comments
* extra documentation per request
>>> timeit.timeit("uuid.uuid4()", setup="import uuid")
9.518647909164429
>>> timeit.timeit("get_unique_id()", setup="from __main__ import get_unique_id")
0.40436601638793945
This will mainly be beneficial when a very large inventory is being
used, however it may also help with some very large playbooks.
* Removing cmp to be compatible with Python3
* fix syntax
* Added an overlooked return
* Fixing making things overly complicated
* Simplifying since tags will always be hashable. Don't need to use cmp at all.
For F5 modules, the options that are commonly specified can
also be specified in the environment variables. This patch
adds the doc fragments that describe which env var goes
with which module option.
* Add swupd plugin
Add support for ClearLinux update manager (swupd)
Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
* swupd: Document RETURN values
Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
* swupd: Add a meaningful description for failures
Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
* swupd: Clarify documentation
Provide more information about the options supported by the module
since some concepts are new for people not used to clearlinux/swupd
Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
* Add NetApp SolidFire volume access group module
* Minor fixes
* Make requested changes
* Set supports_check_mode to True
* Add Ansible metadata
* Make requested changes
* Minor fix to documentation
* Add a surrogate_then_replace error strategy to keep to_bytes from tracebacking by default
* Port all code that explicitly used surrogate_or_replace to surrogate_then_replace
The default Package Manager for Solaris 11 has been set to the module pkg, but there is no such module. Instead pkg5 exists and will be used from now on.
* Initial version of aos_ip_pool module
* Add examples for IP Pool
* Break down ip_pool into smaller function
* Refactor do_load_resource
* Add get_display_name_from_file
* Add ‘src’ as an option to load ip pool from JSON file
* Rename directory network/apstra to network/aos
* Remove exception handling temporary
* Remove all ‘Exception as XX’ to be python 2.4 compatible
* Replace ‘== False’ with ‘is False’ for PEP8 Test
* Update documentation to be Yaml compatible
* Lisg all method imported from module_utils.aos
* Refactor to align with collection.find() changes
* Update examples by @gundalow’s recommendations
* Update Documentation per @gundalow’s recommendations
* Change the license per @gundalow recommendation
* Add exception handling for get_aos_session
* Change Auth format and add check_aos_version() to check minimum version
* Add a check for minimum version
* Refactor ‘src’ into ‘content’ to allow more options
Remove get_display_name_from_file in aos.py
Add content_to_dict in aos.py
* Fix variable name in do_load_resource
* Add mention of aos.py in module_utilities doc
* Add try/except for import yaml
* Add try/Except around main block of code and function
* Refactor to auto detect content_format, update doc accordingly
* Change create_new_ip_pool inputs
* Remove unused import
* Remove in_use as it’s never used
* Fix doc format
* Add version number in requirement doc
* Adding environment variable support for lambda.py in response to feature idea #20479.
Plus a 1-character bug fix.
* fix yaml syntax
* Fixing option name, adding alias, and fixing a line to allow the user to delete environment variables by setting an empty dict.
* Fix NetApp doc_fragment
* Add NetApp SolidFire Snapshot schedule manager module
* Minor fixes
* Change supports_check_mode to True
* Fix PEP8 issue
* Make requested changes
* Change 'pause' to 'paused'
* Add schedule ID as a returned parameter
* Make requested changes
* replaces persistent connection digest with _create_control_path()
* adds _ansible_socket to _legal_inputs in basic.py
* adds connection_user to play_context
* maps remote_user to connection_user when connection is local
* maps ansible_socket in task_vars to module_args _ansible_socket if exists
* Windows: Add Warn() and Deprecate() mechanisms
Similar to what already exists for python modules.
* Turn deprecations from list of strings, to list of dicts
Since #20884 the internal representations of deprecation messages is
changed from a list of strings to a list of dicts.
* Rename to Add-Warning() and Add-DeprecationWarning()
Implemented as discussed.
* Refactor dimensiondata_network to use shared base class for common functionality.
* Experiment: remove the assignments in the "except ImportError:" block that keep PyCharm happy. If this fixes the build, then I reckon there's a bug in the validate-modules script (https://github.com/ansible/ansible/blob/devel/test/sanity/validate-modules/validate-modules#L322).
* Remove unused imports.
* Changes based on feedback from @gundalow for ansible/ansible#21043.
- Use no_log=True for mcp_password parameter.
- Collapse module parameter definitions.
* Use shared definitions and doc fragments for common module arguments (ansible/ansible#21043).
* Make default network plan "ESSENTIALS", rather than "ADVANCED" (this is consistent with our other tooling).
Tidy up module parameter documentation.
* Simplify dimensiondata module documentation fragments (didn't know you could include multiple fragments).
* Change 'verify_ssl_cert' module parameter to 'validate_certs'.
* fix#19487
* add 'version_added'
* Check for version compatibility, Ignore keys if incompatible
* add comment about version support
* remove 'type' as requested
* fix merge error
* Don't check for var._obj in template._clean_data
AnsibleUnsafe or other unsafe vars used to have a
'_obj' slot but no longer do. This was causing attribute
errors if a object was 'unsafe' but not a string.
Add tests for AnsibleUnsafe, lookups, and AnsibleContext
* Fix 'yum skips updates' bug
When the 'yum check-update' output is parsed, the regex used
to stitch wrapped lines together would fail on the first package.
It would fail because there is an empty line before the first
package, and this triggered the regex. To avoid a more complicated
regex, preprocess the check-update output to strip out any
empty lines.
The regex is also updated to include a group on the non whitespace
match to be used in the sub.
Add test cases based on info provided in the bug reports.
Fixes#20608
In 159aa26b36
the result of _get_serialized_branches when no hosts were matched
changed from [[]] to []. Thus, the v2_playbook_on_no_hosts_matched
callback would not fire. Change the check so we get the error message
again. Fixes#17706
* known_hosts: support --diff
* known_hosts: support --diff also without --check
* Add unit tests and fix incorrect diff in one corner case
Tests are good!
* Refactor for readability
* Python 3 compat
* More Python 3 compat
* Add an integration test for known_hosts
* Handle ssh-keygen -HF returning non-zero exit code
AFAICT this is a bug in ssh-keygen in some newer OpenSSH versions
(>= 6.4 probably; see commit dd9d5cc670):
when you invoke ssh-keygen with -H and -F <host> options, it always
returns exit code 1. This is because in ssh-keygen.c there's a function
do_known_hosts() which calls
exit (find_host && !ctx.found_key);
at the end, and find_host is 1 (because we passed -F on the command line),
but ctx.found_key is always 0. Why is found_key always 0? Because the
callback passed to hostkeys_foreach(), which is known_hosts_hash(),
never bothers to set found_key to 1.
* This test does not need root
* Avoid ssh-ed25519 keys in sample known_hosts file
Older versions of OpenSSH do not like them and ssh-keygen -HF
aborts with an error when it sees such keys:
line 5 invalid key: example.net...
/root/ansible_testing/known_hosts is not a valid known_hosts file.
* Fix Python 3 errors
Specifically, the default mode of tempfile.NamedTemporaryFile is 'w+b',
which means Python 3 wants us to write bytes objects to it -- but the
keys we have are all unicode strings.
* Avi Networks Ansible modules.
Avi Version: 16.3.4
* Fixed Review comments
1. Changed description to be full sentences
2. Fixed Pep8 warnings.
3. Fixed comments and descriptions.
* 1. Fixed descriptions and messages as per review comments.
2. Added descriptions for the missing parameters.
* Fixed the shippable break due to the incorrect description format
* Removed the extra modules so that there is a single module for the first commit
* Updated license to BSD based on review comments
* updated comments based on review feedback
* Refactored code to handle POST and PUT scenarios where playbook does not need to check whether object is present.
Moved ansible helper utilities to module_utils as now roles can be patched with module_utils as well.
* fixed pep8 warnings
commit fails for devices with no candidate config, such as when configuraion is written to running-config store. Commit is set to True in main's call of netconf_edit_config. The simple edit is to add the additional logic around sending the commit. Otherwise you could change commit could be set to (if ":candidate" in m.server_capabilities) in the call of netconf_edit_config. Either way would work. I'll defer for the decision of which.
* cloudstack: cs_portforward: implement vpc support
* cloudstack: cs_portforward: add vpc and network to returns
* cloudstack: cs_portforward: networkid must not be used for rule listing
* cloudstack: fail for get_network when vpc but no network name
This seem to be a global pattern for get_network, we want to enforce a
network name to be set if a vpn param is given.
This is used for cs_portforward.
* cloudstack: cs_portforward: doc: fix defaults for vpc, network
Fixes#20754.
Details: UbuntuSourcesList.add_source() had a quick check for PPAs being
already present in the source lists. The check was looking for the PPAs
URL to be present in self.repo_urls, which should contain all valid and
enabled repositories.
The enabled check in repo_urls was incorrect. It was checking the tuple's
2nd item (which means "valid") and ignoring the 3rd item (which means
"enabled").
self.files contains tuples (line_number, valid, enabled, source_line,
comment_text). Ideally it would be using named tuples instead of
indexing, to avoid bugs like that, but Python 2.4 didn't have named
tuples, so we can't do that (yet).
* Make unused redhat_subscriptions do something
rhsm_baseurl/server_insecure were module params that were
never used previously. Hook them up for register options.
* pep8/style cleanups
* Set a module scope SUBMAN_CMD before we ref it as a global
* move ansible imports to top, remove '*' imports
* remove redhat_subscriptions from pep8 legacy
* Reminder that lookup(‘file’) can be used
Sometimes the block of text does not easily fit into a playbook, so this acts as a reminder (or a prompt for anyone who hasn't used this before) that the content could be stored in an separate file.
I've also included `backup: yes` as I think this is a good example of where a backup might be needed.
* Correct the not so "smart quotes"
* Update blockinfile.py
Replace – with an an ASCII -
- centralized skipping
- also fixed module name broken by previous refactor
- let action modules handle async processing
- moved async into base action class's module exec
- action plugins can now run final action as async
- actually skip copy if base skips
- fixed normal for new paths
- ensure internal stat is never async
- default poll to 10 as per docs
- added hint for callback fix on poll
- restructured late tmp, now a pipeline query
- moving action handler to connection as networking does
- fixed network assumption invocation is always passed
- centralized key cleanup, normalized internal var
- _supress_tmpdir_delete now in _ansible_xxx and gets removed from results
- delay internal key removal till after we use em
- nicer tmp removing, using existing methods
- moved cleanup tmp flag to mking tmp func
* Add Check Mode capability to kernel_blacklist module
* Add suggested changes from @tmshn
* Pass a bool into `Blacklist` that'll just be `module.check_mode`
* Move detection and creation of a file to a separate function within `Blacklist`
* If there's no file on the system and we are running under `Check Mode`, set `self.filename` to `os.devnull` AND mark a change, as the module would have created an empty file.
* Whenever a `self.filename` is being opened in a mode where changes can be made, replace with an if statement that checks `self.checkmode` and if true then open up `os.devnull` instead
* Move gather_facts action outside of vmware_guest module
* Move facts gathering method to vmware.py library
* vmware_guest use some vmware.py library methods
* vmware.py lib: fix some PEP 8 issues
* Move snapshot actions to vmware_guest_snapshot
* Move common snapshot facts to vmware.py library
* the `only_update` param description was kinda vague:
* either install if not installed
* or upgrade if installed
* or both!?
* as a result, remove the "install" statement from this sentence
Resolves:
Related:
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
If same config hierarchy is set and deleted in one playbook
for delete statement add support to check if the config is present
on device or in the playbook. If it is present add delete statement in
updated config list.
* added docs for vault and made trigger shorter: !vault
* added single var valuting
* Update playbooks_vault.rst
Edit pass for spelling and grammar. Ship it!
* Update playbooks_vault.rst
Typo fixes.
At the moment, this change will use EPoll on Linux, KQueue on *BSDs,
etc, so it should alleviate problems with too many open file
descriptors.
* Bundle a copy of selectors2 so that we have the selectors API everywhere.
* Add licensing information to selectors2 file so it's clear what the
licensing terms and conditions are.
* Exclude the bundled copy of selectors2 from our boilerplate code-smell test
* Rewrite ssh_run tests to attempt to work around problem with mocking
select on shippable
Fixes#14143
* returns support for prompt/response over cli
* now sends native dict instead of str command
* fixes issue with run_commands() in ios to jsonify request
* updates unit test cases
* Make the module_utils path configurable
* Add a config value to define the path site module_utils files
* Handle module_utils that do not have source as an error
* Make an integration test for module_utils envvar working
* Add documentation for the ANSIBLE_MODULE_UTILS config option/envvar
* Add it to the sample ansible.cfg
* Add it to intro_configuration.
* Also modify intro_configuration to place envvars on equal footing with
the config options (will need to document the envvar names in the
future)
* Also add the ANSIBLE_LIBRARY use case from
https://github.com/ansible/ansible/issues/15432 so we can close out
that bug.
* Check for the prompt as a substring of the output
sudo sometimes spits out warnings to stdout before getting to the
password prompt. Account for that when trying to match a password
prompt.
Fixes#20858
We need to use ssh_executable instead of hardcoding ssh in the command
we run but we need to use "ssh" when we lookup the value of the
{command}_extra_args variable. Do this by leaving binary as "ssh" and
only expanding when we place it into b_command.
Fixes#20862
* cloud: ovirt: add snapshots module
* Move imports in ovirt_snapshots module to match style & pass CI
* Move ovirt_snapshot_facts imports to comply w/ CI
* Update validate-modules
* Validates ANSIBLE_METADATA
* Ensures imports happen after documentation vars
* Some pep8 cleanup
* Clean up some left over unneeded code
* Update modules for new module guidelines and validate-modules checks
* Update imports for ec2_vpc_route_table and ec2_vpc_nat_gateway
* cloud: ovirt: add function to get id by name
* cloud: ovirt: add instance type parameter
* cloud: ovirt: use param method instead of module.params
* cloud: ovirt: use 'and' at begging of next line
* cloud: ovirt: add description parameter to vms module
* cloud: ovirt: add comment parameter to vms module
* cloud: ovirt: add timezone parameter to vms module
* cloud: ovirt: add serial_policy parameter to vms module
* Rename vyos2 over vyos
* Update vyos_config to LocalAnsibleModule
Change result key 'updates' -> 'commands'
vyos_config is supported by core
* vyos_config tests
* Enable bracket config use
* Sanitize config before use
Boolean options that default as `None` but are set to `False` by the user were ignored on update. This change checks to distinguish None & False so that options like multi_az can be turned off during an update.
* Modifying how optional parameters are handled in rds.py. Fixes#20370
Allowing options to be set to false/no. Previously ignored unless set to true/yes.
Added a conditional for invalid parameters since the default is false instead of null for some options (e.g. force_failover, apply_immediately, upgrade).
* Making requested revision.
* win_shortcut: Add missing $check_mode definition
For some reason this entry was missing, possible a merge-conflict gone
wrong :-(
* Added integration tests and bugfix
Add missing changes.
Those "unused" doc fragments are still referenced
lib/ansible/modules/network/eos/eos_config.py:extends_documentation_fragment: eapi
lib/ansible/modules/network/eos/eos_facts.py:extends_documentation_fragment: eos
This reverts commit 246cd041d8.
* Disassociate subnets from route tables before deletion
If a route table still has subnets associated with it, it will fail
to delete:
```
"msg": "The routeTable 'rtb-abcd1234' has dependencies and cannot be deleted."
```
Avoid this by disassociating subnets before route table deletion
* Fix ec2_vpc_route_table flake8 complaints
* Check if EIP exists before deleting it
After deleting the NAT gateway, the EIP sometimes seems to
cease to exist afterwards. Check if it exists before deleting it.
Otherwise you get:
```
Failed to release EIP eipalloc-abdc1234: An error occurred (InvalidAllocationID.NotFound) \
when calling the ReleaseAddress operation: The allocation ID 'eipalloc-abcd1234' does not \
exist", "success": false}
```
* Fix flake8 errors with ec2_vpc_nat_gateway
* A method to validate and alter the ssh control path automatically.
* First tries %C to use the shortened hash
* On further failure, it removes section by section from the original path
* Fix hostname
* Implement bcoca's suggested changes
* Remove unused option
* Remove unused class var
* Use to_string to avoid unicode error
* Switch from to_text to to_bytes
* Update the example config for the new controlpath feature
* [GCE] External IP Address Module.
This module allows users to create and delete External IP Addresses. Both Regional and Global Addresses are supported.
* Removed whitespace causing pep8 issue
* added ec2_vpc_igw_facts module
* added cr at end of file
* corrected import json in wrong location
* corrected version added
* added snake_case conversion
* updated documentation and fixed for python 3'
* ec2_vpc_igw_facts: simplify logic
Make module arguments more 'Ansiblish'
Remove unnecessary intermediate variables in results generation
Use `ansible_dict_to_boto3_filter_list` rather than duplicating logic
Use `check_mode` rather than pass a `dryrun` argument
Update for flake8 improvements
* updated documentation
* # This is a combination of 6 commits.
# The first commit's message is:
new module to import software or configuration file onto firewall
# This is the 2nd commit message:
changes based on the review comments; remove unecessary if statements; change returned value docstring
# This is the 3rd commit message:
empty checkin to trigger ANSIBLEbot
# This is the 4th commit message:
added additional exception handling
# This is the 5th commit message:
- added new module info to the changelog as requested
# This is the 6th commit message:
removed blank space as tox checks were failing
* new module to import software or configuration file onto firewall
* Support logical or condition in required_if
Add logical 'or' condition support in 'required_if'
for requirements.
* If requirements is a list all parameters within it should
be present.
* If requirements is a set atleast one parameter should
be present
* Fix review comment
* Remove monkeypatching of rhn config in rhn_register
rhn_register.Rhn() was doing some complicated monkeypatching of
the up2date_client.config.Config() class to add a default config
value. Since that was only used in one place, remove the monkeypatch
and handle the single default case.
That case was 'server_url' option, so replace it with a Rhn.server_url
property. Also handle the error case when no server url is provided.
* refactoring
* flatten some indention levels
* add 'enable_eus' to module doc
* set enable_eus var and use it directly
* style/pep8/etc cleanups
* some import cleanups
types was unused, os/re were from module_utils * import
* remove * import from module_utils.redhat
* remove * imports from module_utils.base
* remove unused Rhn._subscribe method
* cleanup pep8 style stuff
* remove a unused default mutable arg from Rhn.subscribe
Rhn.subscribe() only gets called in one place, and thats
with channels from module_params which default to [] and
are typed as a list.
Update exception handling, remove use of iteritems
Update for better flake8 compliance
Use ansible_dict_to_boto3_filter_list rather than
duplicating its implementation
This version just gets the relevant paths from PluginLoader and then
uses the existing imp.find_plugin() calls in the AnsiballZ code to load
the proper module_utils.
Modify PluginLoader to optionally omit subdirectories (module_utils
needs to operate on top level dirs, not on subdirs because it has
a hierarchical namespace whereas all other plugins use a flat
namespace).
Rename snippet* variables to module_utils*
Add a small number of unittests for recursive_finder
Add a larger number of integration tests to demonstrate that
module_utils is working.
Whitelist module-style shebang in test target library dirs
Prefix module_data variable with b_ to be clear that it holds bytes data
added better way of adding warnings to return data
backwards compatible if warnings key already exists
added deprecations made iface more generic
changed to enforce type per item
added logging of warnings/deprecations
also display deprecations by default
Prescribing types is not necessary as the underlying shade library
does not do so, and the Neutron API will inform us if a disallowed
or non existent type is used.
Fixes#20830
* Add support for additional properties when creating new VMs.
All vmadm(1M) options except those specific to SDC(-docker)
are now supported.
* Mark password options as no_log
Change-Id: I9dfd80e7ba5ecfc8f45ecfbe9ec098e66647e9a4
* Set ansible_os_family to 'ClearLinux'
* Set ansible_distribution to 'ClearLinux'
* Add swupd.py plugin
Fixes#20824
Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
This prevents an exception from occurring when an image has no name. While images normally have names it is possible, at least on older versions of Docker, for an image to "lose" its name during a failed `docker rm`.
* Fix service's exec_command() for python3
exec_command() was mixing text and bytes in several places on python3.
Made changes so that we explicitly convert between the two.
Fixes#20818
* Also handle basestring and shlex.split in a python2/python3 compatible fashion
* Cleanup fork
* Add bigmon_policy module
* Remove docker files from commit, fix formatting, add CHANGELOG.md entry
* Put change in CHANGELOG.md in alph order and add the alias to access_token doc
* Fix access_token type, drop the alias, and fix doc
* Capitalize letter, delete redundant notes, make validates_certs True by default
* Add validate_certs to example
* Try fixing trailing space
* Try adding a trailing space
* Try removing trailing space at end of file
* Add newline at end of file and fix trailing space
* provides declarative resource for configuring eos system parameters
* supports network_cli connection plugin only
* adds unit tests for module using mock interfaces
* adds send_config function to handle pushing configuration commands
* adds support for handling multiline banner commands
* adds env var check to enable or disable config sessions
The following changes have been made:
- Added check-mode support
- Added parameter type support
- Replace PSObject by a normal dictionary
- Improve idempotency (only when $dest is provided it is not idempotent (yet)
I intended to update the documentation, but it appears the website docs
are behind the actual documentation (as the website doesn't show the
default values for booleans).
So I ended up adding the missing -type "path" and use the default $null
value for undefined parameters.
The following playbook:
```yaml
- hosts: localhost
tasks:
- file:
path: /tmp/non-existing-foo-bar
state: absent
recurse: yes
```
causes this error:
```
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "recurse option requires state to be 'directory'", "path": "/tmp/non-existing-foo-bar", "state": "absent"}
```
The included fix ensures that when recurse is added, we no longer assume
it is a file, but accept that it is a directory.
- Harmonize the name $params like most modules
- Use `return` consistently for return values (easier to read)
- Implement Get-AnsibleParam internally using -type "bool"
- Use a dictionary for $result
* update eos_config to use eapi exclusively and remove cli transport
* add unit test cases for eos_config
* updates action plugin to handle both eapi and network_cli connections
* Added support for a gce_snapshot module for managing snapshots in the Google Cloud Platform
* Fixed using sys.exit in favor of fail_json. Followed the pattern in gce_pd
* Fixed using sys.exit in favor of fail_json. Followed the pattern in gce_pd
* Fixed an issue when dealing with multiple disks. Added a bit more documentation explaining the disks argument
* Corrected a typo in the multi-disk snapshot example
* Updated module to return list of changed snapshots instead of just a message. Added a RETURN block
* include source file in error message
* win_copy: Fix for idempotency
This patch fixes an idempotency issue with win_copy. Without this patch
files would always be considered changed (unless the copy operation failed).
It also fixes the resulting output cfr. what was deocumented.
Small improvements:
- Remove obsolete comments
- Use $check_mode instead of my own $_ansible_check_mode
- Renamed "default" window style to "normal" (as is used by Windows
documentation)
- A fix for check-mode support (when state=absent)
* eos module now uses network_cli connection plugin
* adds unit tests for eos module
* eapi support now provided by eapi module
* updates doc fragment for eapi common properties
* Fixed issue in gce_net with firewall rules that have protocols that do not have ports.
* Fixed elif in gce_net to include check of the ports variable.
* Google Cloud Pubsub Module
The Google Cloud Pubsub module allows the Ansible user to:
* Create/Delete Topics
* Create/Delete Subscriptions
* Change subscription from pull to push (and configure endpoint)
* Publish messages to a topic
* Pull messages from a Subscription
An accessory module, gcpubsub_facts, has been added to list topics and subscriptions.
* Added docs for state field to DOCUMENTATION and RETURN blocks.
`force` option is not unique for non-activationkey registrations and it should
be parsed separately; it is possible to register host with activation key and
force such process.
* redhat_subscription: enforce the need for org_id when AK is used
also update the documentation to reflect that
Fixes: #20542
* redhat_subscription: check for existence of subscription-manager
After merging the latest update, these were the few remaining
differences with upstream.
(Plus the previous proposed fast match based on unique VM name which is
not longer needed)
- get rid of changed, rc, stderr, stdout juggling
- use get_bin_path() to get 'imgadm' path
- move actual implementation to Imgadm class
- fix 'changed' for imported images
Without this patch, the os_keystone_domain module is not idempotent if
the description is empty because the description parameter is None in
ansible, but the keystone client returns an empty unicode string.
Following the example of other OpenStack modules, this patch fixes the
issue by checking whether the module parameter is None before going on
to check its value.
Instead of populating the platform comment in the default
meta/main.yml with a dict of platforms fetch from the
galaxy REST API, this removes the API call and adds a
commented out example platforms list to the default meta/main.yml
Fixes#18103
The following changes have been made:
- Added check-mode support
- Added diff support
- Corrected HCCC to HKCC (according to windows documentation)
- Updated documentation, and examples
- Added -aliases support to module_utils/powershell.ps1
- Renamed `key > value > data` to `path > name > data`
- Re-indented code and consistency changes
- Added support for expandstring type
This fixes#20595
when using "state: link", and particularly when using
"force: yes".
Symbolic link resolution can be expensive. In our case,
the symbolic links are legacy links to automounts, and
the "file" task was causing all of the legacy links to
be traversed and mounted on every host every time the
task executed, even when the links were correct and there
was nothing to do.
This change avoids the system calls that perform the
symbolic link resolution by taking advantage of the short
circuit behaviur of the boolean "and" operator. The code
behaviour is unchanged except that it no longer performs
unnecessary system calls.
As it turns out, this change is not sufficient to fully
solve the symbolic link resolution problem, as the "file"
module still performs a stat() at the end of execution to
provide the caller with information about the file.
However, this change is very simple, it will eliminate
unnecessary system calls in a number of use cases, and it
gets the "file" module closer to the desired end result.
* update instance image with Debian 8 Jessie
* debian-7 is marked as "DEPRECATED" in Google Compute Engine Images
* as a result, by default use `debian-8` Jessie
Resolves:
Related:
Signed-off-by: Daniel Andrei Minca <danielandrei.minca@gameloft.com>
* update docs regarding latest stable default image
* after speaking with @gundalow, we decided it's better for the users to
know that the default image will follow latest stable debian by GCE
Resolves: #20558
Related:
Signed-off-by: Daniel Andrei Minca <danielandrei.minca@gameloft.com>
self.instance may be overwritten before the user data comparsion which result in a false positive changed state.
With this commit, we make sure we have the userdata when we need to.
* new AWS module for ec2 VPC vgw facts
* fixed documentation as suggested by reviewers
* changed iteritems to items for py 3
* improvements to bring in line with #19787
* corrected documentation
* updated doco and exception path
* win_psexec: execute cmds on remote systems as any user
This module uses the versatile psexec tool to run any command remotely
as any user (incl. domain users).
* Add missing documentation
Now that this module is deemed acceptable for inclusion,
the documentation is an essential part.
* win_psexec: Small cosmetic changes
* win_psexec: add more options (priority, elevated, ...)
* Fixes after more testing
* Renamed 'cmd' to 'psexec_command' + more
- Also replaced PSObject() with a hash table
- Made $chdir of type "path"
- Renamed $args to $extra_args
* Various improvements
- Switched to using booleans for most parameters
- Added type 'bool' to boolean parameters
- Added 'interactive' parameter
- Added 'wait' parameter
- Added an interactive example
* Added -type "bool" support to Get-AnsibleParam
* Fix deadlock
* When using `wait:no` return code is PID of process
The same ssh key may be registered with different names. Before we only looked at the names and marked as changed when names differ. However internally cloudstack seems to ignore the change, if the fingerprints are identical.
As a result we also have to compare the fingerprints and only mark the keys as changed if the fingerprints differ.
* Fix git remote url change detection.
When comparing paths, unfrackgitpath must be called on both sides
of the comparison. Otherwise comparisons involving symlinks will
return incorrect results.
* Re-enable git test on OS X.
* Return None from unfrackgitpath when path is None.
Per official docker document, it support setting `--log-driver=none` to
disable any logging for the container. So let's add it to this module.
Fixes#5337
Per a change in jinja2 2.9, local variables no longer are prefixed
with l_, so this updates AnsibleJ2Vars to pull in all locals (while
excluding some) regardless of name.
Fixes#20063
(cherry picked from commit 4d49b317929b86e1fc1b0cbace825ff73b372dc7)
After much plumbing through the source code, python-gitlab and the Gitlab API I found out why I cannot update my ssh keys through this module - because it expects the user to have admin rights on the server. This could be made clearer in the requirements because the Gitlab API allows one to change his/her own profile, it's just that the module or the underlying library doesn't cover this use case.
* Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes#20098
* Address some of the requested changes
* Quoting
* Print the python path and version
* Be less explicitly verbose, rely on implicit verbosity
* Deprecate ec2_vpc module
The deprecation of ec2_vpc module has been discussed for
2 years and is causing duplication of effort as changes
are implemented for ec2_vpc rather than for the newer
alternatives
* Improve module deprecation documentation
Update the developing modules documentation with the latest
instructions on how to deprecate a module.
* Windows: Fix documentation strings to be raw strings
Especially when using Windows paths they easily get confused as escaped
sequences or unicode characters. So by default use raw strings
This fixes#20295
* Fixed as hinted by @abadger
And some trailing whitespace fixes.
Rather than trying to enumerate tasks or track an ever changing cur_role
flag in PlayIterator, this change simply sets a flag on the last block in
the list of blocks returned by Role.compile(). The PlayIterator then checks
for that flag when the cur_block number is incremented, and marks the role
as complete if the given host had any tasks run in that role.
Fixes#20224
* New module for managing VMs and zones on SmartOS.
Currently allows for creating new instances and state changes.
Updating existing VMs is not supported yet
* Fix identation in DOCUMENTATION
* Add RETURN block
* Apply flake8 recommendations and split up main() into separate functions.
* Be more about the states this module accepts and trim the exposed list
* Be more verbose about states and the implications
* Fail with a more descriptive error messages than just 'stderr'
* Valid all UUIDs before exiting
* Incorporate feedback from bcoca
* Print field name that contains invalid uuid, not the value
* More changes as suggested by bcoca:
- drop save_payload completel
- make 'name' the options with an 'alias' alias
- use get_bin_path() for locating 'vmadm'
* Doc fixes
Change-Id: Ia23704c99d24b7782d8884fd22e11af61cef724c
* More fixes suggested by jtyr
Change-Id: Ia3e65277bf5a499651c70b096e2988d7cc9eceb5
* Drop local changed variable
Change-Id: Ia8beaa615ba4a47004d7af791c28a5a5855bcf61
* Use correct ANSIBLE_METADATA format
Change-Id: I51ded34e543005933c7c739501388e24e5f80c1d
* Re-indent RETURN
Change-Id: I0c266d7a83517be54fc6242dfb0496a0a480f628
* Fix documentation formatting for options and fix an unused variable
* Move imports to their original location again
* Fail if there's invalid json returned instead of trying to continue
* Betterer error handling for json.loads()
This patch add additional filtering of VNIC profiles by the cluster
parameter. It is a must, because there could be same names of the
VNIC profiles in system, as every datacenter can have VNIC profile
same name, which can be in other datacenter.
This patch fixes issue #20246
* Fixes: #3217 - Add a new parameter for the kms_key_id to the ec2_vol module.
* Fixes: #3217 - Correcting comment string as requested.
* Fixes: #3217 - Adding boto version when kms_key_id is used. Also re-adding accidentally removed comment line.
* Cleanup of EBS volume key pull request
* Adding support for Amazon ECR
This patch adds a new module named ecr, which can create, update or
destroy Amazon EC2 Container Registries. It also handles the management
of ECR policies.
* ecs_ecr: addressed review feeback
* Renaming ecr to ecs_ecr
* Fixed docs
* Removed bad doc about empty string handling
* Added example of `delete_policy`
* Removed `policy_text` option; switched policy to `json` type so
it can accept string or dict
* Added support for specifying registry_id
* Added explicit else after returned if clauses
* Added `force_set_policy` option
* Improved `set_repository_policy` error handling
* Fixed policy comparisons when AWS doesn't keep the ordering stable
* Moved `boto_exception` into the module
* Improve ansible-galaxy handling of role versions
Ensure that role versions are considered when deciding
whether or not to (re-)install a role.
Issue a warning when the version of a dependency conflicts
with the version of an already installed role
Display what version of a role is being installed
Show the versions when upgrading/downgrading a role.
Implements #11266
* Improve force logic for galaxy version changes
Ensure that force is required to change role versions
* Add dimensiondata_network module
* Remove shebang
* Use Python-2.4-compatible exception handling.
* Ok, add shebang back in.
* Add 'mcp_user' and 'mcp_password' parameters'.
As suggested by @abadger, these values will now be used for CloudControl credentials, but will fall back to existing behaviour (environment variables and dotfile).
* Minor fixes based on feedback for ansible/ansible#19325.
This PR is based on #20164 functionality to specify the parameter type
(e.g. as done for python modules).
In this case only -type "path" has a specific meaning, as it will expand
environment variables for paths. Which is typically done on Windows.
So you can do:
- win_copy:
src: files/some.doc
dest: '%UserProfile%\My Documents'
* win_shortcut: Create, manage, remove Windows shortcuts
This modules manages Windows shortcuts and all its properties.
The module is idempotent and supports check-mode.
This relates to #19694
* Changes required after @nitzmahone review
* Added -type "path" to parameter definitions
* Small fixes
- Add conversion from window style name to window style id
- Fix error message output (Why didn't the original work ?)
* Tweaks for SmartOS:
- prevent attempting from changing timezone in the global zone (read-only)
- provide meaningful error message in the unlikely case smtools isn't present
* Add support for FreeBSD and NetBSD to timezone module
* vmware_guest: networks definition as a list
Currently the networks definition is a dict, with the network range as
key. This is problematic if the network information is coming from other
sources.
This patch turns the networks definition into a list.
This fixes#19222.
* Remove the option to provide either netmask or network
It is more concise if there's only one way to configure it.
So provide both `ip` and `network`.
(I also re-indented a section due to a useless check)
* Fix bugs reported by @dav1x
Thanks !
Changes missing from a poor merge probably, but also a few new things.
- Reordered the examples from important (often used) to less important
(fewer used)
- Remove the new_name: option and replace it with the uuid/name
combination for renaming + added example
- Added an example using the VM uuid instead of the VM name
- Also check whether the password is non-empty (rogue merge)
- Wait for all tasks to finish (to be sure the new facts reflect the
state)
- Ensure that on failure we still set the change-bit
- Moved a set of functions that are unused (related to transfering
files to guest, or running commands) to module_utils
* Allow the use of paths like ~/.project.json
This makes it easy to manage credentials files outside of the repo
(and/or user specific credentials).
* Fix format string to log credentials_file.
* checks if signal hander is set and sets it if not (will be set if coming
from ansible-connection)
* will now timeout long running commands based on DEFAULT_TIMEOUT setting
The password param conflicts with os-client-config's password grabbing.
The rest of the params really probably should also be popped - but
keeping this just to password for now. Will follow up with a change that
does an audit of all the os_ modules
This patch was previously contributed by @emonty to the former
ansible-modules-core repo however since the merge, it was closed
and not completed. This patch includes the necessary changes cleaned
up to work with the latest release of Ansible. This has been
tested to work internally
In our environment we have custom services that need to be stopped and
restarted very gracefully to not interrupt active sessions.
A stop job, depending on the state, can take up to 20 minutes until the
process exits. It simply reacts to SIGTERM with a graceful shutdown.
By default, systemctl blocks until the job has completed, which leads to
Ansible hanging on this task for up to 20 minutes.
Thankfully systemctl supports the `--no-block` flag which lets the job
continue in the background.
This PR adds support for that flag as the `no_block` boolean option.
From the man page:
--no-block
Do not synchronously wait for the requested operation to
finish. If this is not specified, the job will be
verified, enqueued and systemctl will wait until the
unit's start-up is completed. By passing this argument,
it is only verified and enqueued. This option may not be
combined with --wait.
Not all file-related modules consistently use "path" as the attribute to specify a single filename, some use "dest", others use "name". Most do have aliases for either "name" or "destfile".
This change makes "path" the default attribute for (single) file-related modules, but also adds "dest" and "name" as aliases, so that people can use a consistent way of attributing paths, but also to ensure backward compatibility with existing playbooks.
NOTE: The reason for changing this, is that it makes Ansible needlessly harder to use if you have to remember that e.g. the xattr module requires the name attribute, the lineinfile module requires a dest attribute, and the stat module requires a path attribute.
* removed bad iteration from execute meta
most of the tasks should not be iterated over, others needed to include unreachable hosts
fixes#19673
* corrected host var
* Only add Content-Type if not specified in headers. Fixes#20046
* Update documentation to indicate body_format will not override Content-Type if specified in headers
* Add dimensiondata.py in module_utils
This is required by the Dimension Data modules under
lib/ansible/modules/extras/cloud/dimensiondata
* Implement change requests from PR #17604
Requests are listed in:
https://github.com/ansible/ansible/pull/17604#pullrequestreview-819380
* Changes requested for Ansible PR #16704.
As noted by @abadger:
- Use Py3-compatible import syntax for ConfigParser.
- Use comprehensions instead of filter function.
- Fix buggy comparison of False to 'False'.
- Change b_dict to block_dict.
- Fix invalid syntax for except block that handles multiple exception types.
* Additional changes requested for Ansible PR #16704.
As noted by @abadger:
- Missed a couple of places where we still had invalid exception-handling syntax.
* Remove shebang from dimensiondata.py (Ansible PR #16704).
* Switch to MCP_USER / MCP_PASSWORD.
This is consistent with other Dimension Data Tooling.
* Implement get_configured_credentials.
* Fix typo (missing comma).
* Unify get_credentials implementation (ansible/ansible#17604).
get_credentials will now look in environment, dotfile, and module configuration for credentials (in that order).
* Resolve user Id and password from module configuration before trying environment or dotfile (ansible/ansible#17604).
* new module to check FW readines
* added missing parameter
* changes based on the review comments; remove unecessary if statements; change returned value docstring
* Make ModuleArgsParser more understandable
Both comments and method names for handling new/old
style parameters are switched around
Made comments and method names reflect actual code paths
taken.
* Further improve mod_args.py comments
Ensure output formats are correctly documented,
remove some of the 'opinion' about which formats are
valid, and try and clarify the situations under which
certain code paths are hit.
Stop talking about the YAML command-type form as 'extra
gross' when it's the documented example form for command
etc.!
* Fixes#3539 "win_robocopy does not return changed properly"
Remove .win_robocopy from $result so that ansible can see the values properly. This also matches up with the existing documentation.
* Update documentation to match new return values
* add support for AIX mount facts
* add nfs mount support for AIX mount facts
* make nfs parsing a bit more resilient and correctly parse options if provided
* self.module.xxx call instead of wrong module.xxx
Because we add the names of all filters to the callable whitelist used
by safe_eval, adding a filter named type makes it so code calling "type()"
gets eval'd. We can't think of a way to exploit this but it's
sufficiently sketchy that we're renaming it in case someone smarter than
us can think of a problem.
When you become: with synchronize and docker it sets the rsync-path to
"sudo rsync" to launch rsync on the server as root. Unfortunately due to
docker exec doing stricter argument parsing than ssh this fails to
launch rsync on the server and the sync fails.
For docker though we don't need to launch rsync with sudo we can simply
docker exec -u <user> and rsync as normal to get around the problem.
Closes#20117
- Replace nose usage with pytest.
- Remove legacy Shippable integration.sh.
- Update Makefile to use pytest and ansible-test.
- Convert most yield unit tests to pytest parametrize.
* Small tweaks for timezone module:
- small textual fixes
- ensure the generated docs list either hwclock or name as required
by using a non-generated value for required_one_of
* Update docs with the DOCUMENTATION block about either name/hwclock being required
This refactors the iosxr shared module to make use of the network_cli
connection plugin and removes the dependency on the shared shell
module. This change will break current modules until the modules
are updated.
* Previous fix to this failed to account for open_url returning a filehandle
Fixes the bugs introduced by c6fb355
* read() from HTTPError for python-3.6+
HTTPError is funny. It contains a filehandle to read the response from
and also makes it available via a read() method. On earlier versions of
python (2 and 3) the read() method was enough to make it work with
json.load(). The newer version of json.load() needs a more complete
file interface than this and has stopped working. Read the bytes,
transform to str and pass it in manually to fix it.
* initial commit of cloudfront_facts.py
* modification as per review from @georgepsarakis
* fixed shippable build error
* fixed shippable build error
* removed wildcard imports and replaced with specific imports from ansible.module_utils.ec2 as advised by @georgepsarakis
* renamed all instances of cloud_front_origin_access_identity to origin_access_identity as advised by @georgepsarakis
* added input option requirements where missing. fixed a typo in an error message, added '.' to the end of sentences.
* fixed typo in documentation
* simplified paginated_response method as advised by @georgepsarakis
* set default option to list_defaults when no option specified as advised by @ryansb
* bumped version to 2.3 as advised by @ryansb
* removed double-nesting of ansible_facts as advised by @ryansb
* show facts based on alias and distribution id for easy referencing as advised by @ryansb. have done for both distribution and distribution_config
* made comments clearer
* fixed incorrect logic for default list_distributions, fixed list_distributions_by_web_acl - wasn't passing web_acl_id, fixed list_invalidations keyword args missing DistributionId
* neatened up logic for list_distributions default
* facts now return Etag as well as specific facts. modified paginated_response to handle this. also all requests that use distribution id also list the facts under the corresponding alias now.
* fixed last fact added clobbering all previous facts for an alias or an id
* removed list_ prefix from list keys
* removed unnecessary boto fields. made list_distributions and list_streaming_distributions dictionaries with id/alias as key. fixed list_invalidations.
* fixed incorrectly named list_distributions_by_web_acl to ..web_acl_id. added id/alias dict for list_distributions_by_web_acl_id
* minor doc changes
* removed merge tag
* fixed more of merge
When get_url or other functions receive an SSL failure it prints a
standard message regardless of the failure. Include the actual OpenSSL
message in the error message so alternative failures can be debugged.
Closes: #20024
* Idempotency fix on annotations permitting to change them on reconfiguration
* Permit to set VMware customvalues attributes on VM
* Gather annotation & customvalues and report it into module facts
* vmware_guest: various changes and fixes
Most of my queued changes were already implemented by @aperigault !
This was still open
- Typos
- Various fixes to dict.get() without quotes
- Defaults to fullname and orgname (so they are no longer mandatory)
- Add missing timezone implementation
- Remove the customize flag from the options
- Rename 'customizations' to 'customization' (cfr VMware docs and fora)
* Important fixes for idempotency and customization
- A password is mandatory for customization to work on Windows !
- An important fix for idempotency related to guestId
- Support all types of Windows guestId entries
* Suggestion by @aperigault
* Small documentation fixes
The behavior now matches GNU diff.
Fixes#14094.
Example of output before this change:
TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
changed: [ranka]
--- before: /etc/cron.hourly/mg-healthchecks-dot-io
+++ after: /tmp/tmpOTvXTw
@@ -1,2 +1,2 @@
#!/bin/sh
-curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
after this change:
TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
changed: [ranka]
--- before: /etc/cron.hourly/mg-healthchecks-dot-io
+++ after: /tmp/tmpOTvXTw
@@ -1,2 +1,2 @@
#!/bin/sh
-curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
\ No newline at end of file
+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
The added unit tests contain more examples.
This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings. (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
* updates the ios_config module to use the network_cli plugin
* updates the local action plugin to derive from network
* add unit test cases for ios_config
The add() method was not properly setting childen and parents objects
on instances of ConfigLine. This only applied to the add method. This
change fixes the problem by adding child and parent to the right
attribute.
* Add modules for gathering facts about ZFS datasets and pools
* Move zfs module to storage/zfs subcategory
* Replace dict.iteritems() with iteritems(dict)
* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES
* Add zfs_facts and zpool_facts modules to CHANGELOG.md
* Add facts to return values
* Add module for managing boot environments on FreeBSD/Solaris/illumos systems
* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES
* Add beadm module to CHANGELOG.md
* Update version to 2.3
* Gather device information on Solarish systems
* Gather uptime information on Solarish systems
* Fix typo in variable name
* Add comments and example output from kstat command
Use frozenset instead of set
Make parsing of line a little bit safer
* Adding os_quota support to the OpenStack modules
* Updated descriptions in doc string
* Updated version_added to 2.2 based on CI test feedback
* ready_for_review
* Changed exit_json to remove updating host var facts
* Updated version_added and docs
* Added support for state:absent paramater
This includes:
- Updated the doc string with the paramater information
- Updated the example section showing how to reset a project quota
- Added code support to handle state:absent
- Encountered a bug in delete_network_quota where it returns
an error instead of the current quota. Added support code to
workaround that issue until a proper fix can be added.
* Updated security groups kwarg to reflect Neutron kwargs
* Updated iteritems to be items based on CI feedback
* Updated descriptions and import statements based on code review feedback
* Updated CHANGELOG.md to include os_quota under new mods.
* updates the deprecated ios_template module to use network_cli
* adds unit test cases for ios_template
* adds check for provider argument and displays warning message
The main purpose of this PR is to add the subnet associations to the
dict returned by ec2_vpc_route_table_facts. This commit also
re-formats code to make it PEP8 compliant.
- If an absolute path is provided, ensure it starts with /vm
- Also ensure there are no trailing slashes
This gets rid of a few locations where the same was being done.
It also fixes the cases of multiple trailing slashes, or ending up with
/vm/ instead of /vm.
The `except` block with exception matching throught
`if 'connection refused' in str(e).lower():` is funny,
but is not user-friendly.
Probably related issues:
- #15679
- #12161
- #9966
- #8221
- #7218
... and more
On Ubuntu the scriptdir gets placed into sys.path. This makes some
modules (copy) fail because the ansible module gets loaded instead of
the stdlib copy module. So we remove scriptdir there. Unfortunately,
the scriptdir code uses abspath(). When pipelining, abspath() has to
find the cwd. On OSX, finding the cwd when that directory is not
executable by the user raises an OSError. Since OSX does not suffer
from the scriptdir problem we're able to just skip scriptdir handling if
we get that exception.
Fixes#19729
In modern ansible, parameters default to string type. This causes
issues for polymorphic parameters like this module's value param. note
that this fix restores ansible-2.0 and previous behaviour but it is not
perfect. If a parameter is specified via key=value or given on the
commandline then it will be a string before it reaches the module code.
There's nothing we can do about that.
Fixes#19585
can be per run or per host, also aggregate or not
set_stats action plugin as reference implementation
added doc stub
display stats in calblack
made custom stats showing configurable
* Add new module to manage SmartOS images through imgadm(1M)
* Explain why check_mode is not supported
* Add imgadm module
* Incorporate feedback from abadger
* Reenable yum install root tests
No need for sos to test installroot. Something with less deps works
just as well.
* Fix yum installroot.
Fix module import to use fail_json when the modules aren't installed.
Remove wildcard imports
* Lsat task is supposed to remove sos so make that happen
eval can have security consequences. It doesn't look bad here but it
does introduce unnecessary complexity and would make it harder if we
ever want to use static analysis to detect and prohibit eval. So we
should get rid of it.
Note: this could be even more efficient if we combined the checks into
a single condition instead of looping but that does change the error
messages a bit. For instance:
- for arg in ('name', 'linode_id'):
- if not eval(arg):
+ if not (name and linode_id):
+ module.fail_json(msg='name and linode_id are required for active state')
This PR improves the documentation so that it is clear that this module does
not clean the repository metadata cache on removal, and add an example
notification handler to the removal example as an extra reminder.
This fixes#19730
This patch adds support for all other virtual NICs, including:
- pcnet32
- vmxnet2
- e1000e
- sriov
Without this change, VMs with one of these NICs will fail with a
fault.NicSettingMismatch.summary error as it will only add interfaces,
not edit these.
This fixes#19860
New module by @tedder for handling granting/revoking access to KMS secrets.
For example:
```
- name: grant user-style access to production secrets
kms:
args:
mode: grant
key_alias: "alias/my_production_secrets"
role_name: "prod-appServerRole-1R5AQG2BSEL6L"
grant_types: "role,role grant"
```
* Add --installroot to YUM and DNF modules, issue #11310
This continues ansible-modules-core#1558, and
ansible-modules-core#1669
Allow specifying installroot for the yum and dnf modules
to install and remove packages in a location other than /.
* Remove empty aliases
* Simpler installroot set default logic
This allows the ios_* modules to take advantage of the new network_cli
connection plugin by refactoring the ios shared module. Individual modules
need to be udpated as well
* net_config now subclasses action plugin network
* net_template now subclasses action plugin network
This will break existing modules until those modules have been refactored.
* moves parse() into the instance
* removes old Config instance and supporting code
* adds net_common shared module
* minor tweaks to NetworkConfig class for parsing config files
This commit also adds the module to DEFAULT_SQUASH_ACTIONS which is
possible with this change.
The module still calls the pkg_* tools once per name internally, so the only
difference is less invocations of the module itself when using with_items.
Couldn't find any code that does this now but left a comment so that we
don't change something in the future without seeing that it could be
a problem.
A small collection of fixes and improvements:
- Simplify should_deploy_from_template()
- Bugfix for x.config that can be None
- Bugfix for mandatory guest_id (not when using templates)
- Simplify key testing and defaults
- Fix an incorrect reference to the last network
- Duplicate alias 'folder' removed
When becoming an unprivileged user using non-sudo on a platform where
getlogin() failed in our situation we were not able to detect that the
user had switched. This meant that all of our logic to use move vs copy
if the user had switched was attempting the wrong thing. This change
tries the to do the right thing but then falls back to an acceptable
second choice if it doesn't work.
The bug wasn't easily detected because:
* sudo was not affected because sudo records that the user's have been
switched so we were able to detect that.
* getlogin() works on most platforms. RHEL5 with python-2.4 seems to be
the only platform we still care about where getlogin() fails for this
case.
* It had to be becoming an unprivileged user. When becoming
a privileged user, the user would be able to successfully perform the
best case tasks.
* Issue #19575: Adding Dest Param to win_uri
Added `dest` param to win_uri. Outputs the response body to a specified
file.
Addresses Issue #19575
* Was setting the wrong attribute
* Add a encode() to AnsibleVaultEncryptedUnicode
Without it, calling encode() on it results in a bytestring
of the encrypted !vault-encrypted string.
ssh connection plugin triggers this if ansible_password
is from a var using !vault-encrypted. That path ends up
calling .encode() instead of using the __str__.
Fixes#19795
* Fix str.encode() errors on py2.6
py2.6 str.encode() does not take keyword arguments.