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.