Commit Graph

1565 Commits (498edda60390d546d59456d1e5fb2380eedbcd16)

Author SHA1 Message Date
Benjamin Leber 52c4c1b00d docker_login: Use with statement for accessing files (#64382) (#64392)
* docker_login: Use with statement for accessing files (#64382)

* Update changelogs/fragments/64382-docker_login-fix-invalid-json.yml

Co-Authored-By: Felix Fontein <felix@fontein.de>
5 years ago
Matt Clay adcf9458f1
Fix ansible-test collections sanity import test. (#64467)
* Fix ansible-test collections sanity import test.

Resolves https://github.com/ansible/ansible/issues/64466

* Fix get_source implementation also.

* Fix is_package function.
5 years ago
Felix Fontein f4ff45dcd4 ansible-test: bumping ACME test container version (#64424)
* Bumping ACME test container version.

* Add changelog.
5 years ago
Jordan Borean 7acae62fa8 Fix up role version pagination for Galaxy install (#64373)
* Fix up role version pagination for Galaxy install

* Fix sanity issue
5 years ago
Med a1ab093ddb synchronize - remove unused block (#64344) 5 years ago
Andrey Klychkov 04c999f0f8 postgresql_idx: add stat mode support (#64138)
* postgresql_idx: add stat mode support

* postgresql_idx: add stat mode support, add changelog

* postgresql_idx: add stat mode support, fix CI
5 years ago
Mark Chappell 819ba2259d Sanity test fixups for AWS ec2 modules (#64230)
* ec2_ boilerplate

* Deprecate unused options.

* ec2_vol: Perform explicit type checking on volume_size and iops when parsing the args

Boto would through a type exception if the string couldn't be converted to an int.

* ec2_lc_find: remove duplicate definition of region

It's defined in ec2_argument_spec and ec2 doc fragment

* ec2_lc_info: Move responsibility for type checking/conversion of sort_start and sort_end into arg parser

* General sanity test related doc fixups

* Remove EC2 related sanity/ignore.txt entries

* Add changelog fragment
5 years ago
Sloane Hertel c1f1b2029c
Support vars plugins in collections (#61078)
* Move var plugins handling to a separate file

* Allow var plugins to require whitelisting

* Add global configuration ('demand', 'start') for users to control when they execute

* Add 'stage' configuration ('all', 'task', 'inventory') for users to control on a per-plugin basis when they execute

* Update ansible-inventory and InventoryManager to the global and stage configuration

* Update host_group_vars to use stage configuration and whitelisting

* Add documentation for using new options and to the developer's guide

* Add integration tests to exercise whitelisting and the new configuration options, using vars plugins in collections, and maintain backward compatibility

* Changelog

Co-Authored-By: Brian Coca <brian.coca+git@gmail.com>
Co-Authored-By: Sandra McCann <samccann@redhat.com>
5 years ago
Mads Jensen 39bf09517a wait_for - remove an obsolete fallback for Python 2.6 (#63988) 5 years ago
Mark Chappell 8c8077b5be Amazon related Sanity test fixups (remaining batch 1) (#64368)
* Remove Sanity test ignore.txt entries

* Fixup boilerplate

* Remove use of blacklisted _ variable name

* cloudformation: Add an explicit removal version for template_format

This option's been ignored since ansible 2.3

* General docs cleanup to clear sanity errors

* elasticache_parameter_group: Add list of choices

- matches documented choices
- other values wouldn't have worked

* data_pipeline: Deprecate 'version' - always ignored

* Add deprecation documentation
5 years ago
Mads Jensen 3126c38f8a Replace import of pycompat24.literal_eval with ast.literal_eval. (#64088) 5 years ago
Sam Doran c67c23234a
clean_facts - use correct variable when evaluating the string (#64284)
A regexp object has no .startswith() method, which caused an unnecessary
try/except block to be added to handle this.
5 years ago
Andrey Klychkov 73526b9d65 mysql_variables: add mode parameter (#63547)
* mysql_variables: add mode parameter

* mysql_variables: add mode parameter, add changelog fragment

* mysql_variables: add mode parameter, fix

* mysql_variables: add mode parameter, fix

* mysql_variables: add mode parameter, fix

* mysql_variables: add mode parameter, fix sanity

* mysql_variables: add mode parameter, remove warns

* mysql_variables: add mode parameter, refactoring

* mysql_variables: add mode parameter, fix logic
5 years ago
Sloane Hertel 371d7aae31
Use templating in HostVarsVars __repr__ (#64282)
* Fix HostVarsVars templating

* Add some tests for HostVars and HostVarsVars templating

* changelog
5 years ago
Pierre Prinetti 2444fae208 Add a named parameter to the filter to_uuid (#64057)
Let the caller choose a namespace for `to_uuid` and document the
behaviour of both the default case, and the new explicit case.

This PR does not change the existing behaviour of the `to_uuid` UUIDv5
filter.
5 years ago
Patrick O'Brien c76e074e4c Callback: removing args from task_fields from Sumologic and Splunk plugin(#63527)
CVE-2019-14864 Ansible: Splunk and Sumologic callback plugins leak sensitive data in logs

Fixes #63522

Signed-off-by: Patrick O’Brien <patrick.obrien@thetradedesk.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Mads Jensen c3838b5d73 Replaces deprecated usage of functions in ansible.module_utils.basic (#63990) 5 years ago
Sam Doran d5fbe6573b
paramiko_ssh - Improve authentication error message (#64157)
The error is not always an invalid username/password. It could be a connection timeout or refusal.
5 years ago
Pavan Bidkar 548fa65ac6 VMware: Allow dash in Windows server dnsname (#64052)
Fixes: #62810
5 years ago
Felix Fontein fed267df03
openssl_csr and openssl_certificate: fix support for Ed25519 and Ed448 private keys (#63984)
* Move X25519, X448, Ed25519 and Ed448 feature tests to module_utils.

* Correctly sign with Ed25519 and Ed448 keys.

* Fix public key comparison. Ed25519 and Ed448 do not have public_numbers().

* Add tests.

* Add changelog.

* Give better errors for cryptography 2.6.x and 2.7.x.

* Test for new errors.

* Forgot one.

* Used wrong private key.

* Use private key password for CA key. Add more stuff to its certificate.
5 years ago
parmsib a5d69f2a26 Make docker_stack adhere to standard ansible return values (#63467)
* Make docker_stack adhere to standard return values

The names of the various fields returned from ansible modules are e.g defined here https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#msg.

Adhering to this improves usability and makes use of functionality for e.g stdout_lines etc.

* Update lib/ansible/modules/cloud/docker/docker_stack.py

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Fix under-indentation of continuation line (pep8)

Issue exposed in test here https://app.shippable.com/github/ansible/ansible/runs/146667/1/console

* Don't break old playbooks/roles

Made sure the changes are only adding new variables, not removing anything existing yet.

* Added comment

* Minor fixes

* Update lib/ansible/modules/cloud/docker/docker_stack.py

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/cloud/docker/docker_stack.py

Co-Authored-By: Felix Fontein <felix@fontein.de>

* minor change to docker_stack.py

* Add changelog fragment for PR 63467

* Format changelog fragment

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Add fragment about docker_stack return val depr

* Add docker_stack doc note about deprecated vals

* Remove whitespace in empty line

* Add docker_stack depr notice to porting guide

* Update changelogs/fragments/63467-docker-stack-return-fix.yml

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Update docs/docsite/rst/porting_guides/porting_guide_2.10.rst

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Update lib/ansible/modules/cloud/docker/docker_stack.py

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Added back a missing new line
5 years ago
Matt Clay e9f8a34dce
Fixes for validate-modules import handling. (#63932)
* Fix validate-modules support for collections.

- Relative imports now work correctly.
- The collection loader is now used.
- Modules are invoked as `__main__`.

* Remove obsolete validate-modules code ignores.

* Handle sys.exit in validate-modules.

* Add check for AnsibleModule initialization.

* Remove `missing-module-utils-import` check.

This check does not support relative imports or collections.

Instead of trying to overhaul the test, we can rely on the `ansible-module-not-initialized` test instead.

* Fix badly named error codes with `c#` in the name.

The `#` conflicts with comments in the sanity test ignore files.

* Add changelog entries.
5 years ago
Alexander Korsunsky b7e38dfa52 copy - check for changes beyond first level of subdirectories (#58323)
Add integration test for copy: deep recursive with remote_src=True
5 years ago
Sandra McCann 26236f474b fix spelling issues (#64103) 5 years ago
Edoardo T 0d905a0496 ACMEAccount.get_request check status code value lower boundary (#63140)
* check status code value lower boundary

Any HTTP code below 200 cannot be considered a success, should be
handled like a failure instead.

This is particularly true for below zero status codes.

Fixes #63139

* provide changelog fragment

* ensure connection errors are handled in Acme module

* add fetch_url check to ACME.send_signed_request

* remove module.fail_json

* move _assert_fetch_url_success out of ACMEAccount

* fix ansible-lint errors

* use simplified syntax status checking
5 years ago
Robert Osowiecki 3c978a3225 lineinfile - don't run os.makedirs on empty dir path (#63921)
* Fix #63919: don't run os.makedirs on empty dir path

* integration test for lineinfile create: yes without path
5 years ago
Bill Dodd 14eedb2956 Do not PATCH Account Enabled prop if not supported (#62617)
* do not PATCH Account Enabled prop if not supported

* add changelog fragment
5 years ago
Felix Fontein 5c973dd147 docker_container: get rid of defaults (#63419)
* Add container_default_behavior option to get rid of some defaults.

* Add changelog.

* Fix option.
5 years ago
Gonéri Le Bouder 039c770a95 vmware_host_firewall_manager: fix #61332
Since https://github.com/ansible/ansible/pull/56733, we were not able to apply
firewall rules with no `allowed_hosts` key.

closes: #61332

In addition, this patch ensures the `allowed_hosts` key accepts a dict,
instead of a dict in a single entry list.

```yaml
vmware_host_firewall_manager:
  esxi_hostname: "{{ esxi1 }}"
  rules:
    - name: NFC
      enabled: True
      allowed_hosts:
        - all_ip: False
          ip_address:
            - "1.2.3.4"
```

Should be written:

```yaml
vmware_host_firewall_manager:
  esxi_hostname: "{{ esxi1 }}"
  rules:
    - name: NFC
      enabled: True
      allowed_hosts:
        all_ip: False
        ip_address:
          - "1.2.3.4"
```
5 years ago
Andrey Klychkov defccd1d44 postgresql_db: allow to pass users names with dots (#64007)
* postgresql_db: allow to pass users names with dots

* postgresql_db: allow to pass users names with dots, add changelog fragment

* postgresql_db: allow to pass users names with dots, fix ci
5 years ago
Mark Chappell 8d7580a59f AWS S3 : Fixup sanity test issues and deprecate 2 unused options (#63989)
* S3 module Sanity check fixes.

* s3_lifecycle: deprecate unused 'requester_pays' option

* s3_sync: deprecate unused retries option

* Add changelog fragment
5 years ago
Mark Chappell fd54c54b51 AWS IAM Sanity test cleanup and deprecate unused 'fail_on_delete' option (#63961)
* AWS IAM Sanity test cleanup

* Changelog and porting guide updates

* Review recommendations
5 years ago
Andrey Klychkov 88af9f6470 mysql_replication - accept empty string to the module's parameters (#63546) 5 years ago
Matt Martz cdb7ab61a0
Introduce context manager for temporary templar context changes (#60513)
* Introduce context manager for temporary templar context changes. Fixes #60106

* Rename and docstring

* Make set_temporary_context more generic, don't hardcode each thing you can set, apply to template action too

* not None

* linting fix

* Ignore invalid attrs

* Catch the right things, loop the right things

* Use set_temporary_context in a few extra action plugins
5 years ago
Abhijeet Kasurde af0d70cb6f user: Handle exception when /etc/shadow file is missing (#63888)
Added exception handling when module tries to modify user details,
and /etc/shadow file is missing or not found.

Fixes: #63490

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Kyle Umstatter fb38c9cea9 Support PostgreSQL Custom Format (#63806)
* Support PGC Restores

* Fix whitespace

* support pgc both dump and restore
5 years ago
Adam Miller ed86907587 DNF Handle Empty AppStream stream definition (#63819)
* DNF Handle Empty AppStream stream definition

Fixes #63683

Signed-off-by: Adam Miller <admiller@redhat.com>

* Switch Fedora dnf test target modularity to stratis

In Fedora 29, the metadata was not properly set for a default stream
for ripgrep even though there is a profile called "default", however
that's an arbitrary string and the module maintainer must set the
default stream (which it never was for the ripgrep module, thus
failing the "empty stream" install test)

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Adam Miller 8c43697e3b yum - only instantiate YumBase once (#63713)
* yum - only instantiate YumBase once

Previously, this code was re-instantiating the `YumBase` object
many times which is unnecessary and slow. However, we must do it
twice in the `state: absent` case because the `yumSack` and
`rpmSack` data of the previously instantiated object becomes
invalid and is no longer useful post transaction when we verify
that the package removal did in fact take place. Also, this patch
removes the repetitive re-processing of enable/disable of repos in
various places.

Here's a display of the speed increase against a RHEL7 host:

```yaml
- hosts: rhel7
  remote_user: root
  tasks:
  - name: Install generic packages
    yum:
      state: present
      name:
        - iptraf-ng
        - screen
        - erlang
  - name: Remove generic packages
    yum:
      state: absent
      name:
        - iptraf-ng
        - screen
        - erlang
```

Before this patch:
```
real    0m52.728s
user    0m5.645s
sys     0m0.482s
```

After this patch:
```
real    0m17.139s
user    0m3.238s
sys     0m0.277s
```

Fixes #63588
Fixes #63551

Signed-off-by: Adam Miller <admiller@redhat.com>

* add changelog

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
Matt Clay 0923ed56c7 Changelog entry for ansible-test sanity fixes. 5 years ago
Kevin C b52d715567 add change_set_id to cloudformation output (#63752)
* Add change_set_id to the cloudformation module output when a change set is created

* Add module return documentation for change_set_id

* changelog
5 years ago
Stefan Horning 7aac7a56da Added missing param to lambda module to pass it through to boto3 (#58822)
* Added missing param to lambda module to pass it through to boto3

* Allow updating of runtime, because there is no reason why not

* Updated version_added to 2.10 to make tests green again

* Updated RETURN docs of Lambda module

* Added tests to aws_lambda test-suite.
5 years ago
Sam Doran 92cd13a2cf
lineinfile - use correct index value when inserting at the end (#63696) 5 years ago
Sam Doran 29d4d318a5
lineinfile - properly insert line when line exists and backrefs are enabled (#63763)
Use a separate variable for the boolean test rather than having the same variable sometimes be a boolean and sometimes be a regular expression match object

Add integration tests to cover this scenario
5 years ago
Xu Yuandong e4b6dd1862 ce_config/bug/jingdong: a bug from jingdong. (#62872)
* update to fix "`quit` may make seesion closed."

* update to fix "`quit` may make seesion closed."

* 274:49: E272: multiple spaces before keyword

* add a changelog fragment.

* Update ce_config.py

using run_command for prompts.

* Update ce_config.py

* Update ce_config.py

typo error

* update to use get_prompt

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py

* Update ce_config.py
5 years ago
Bob Boldin 40975cd436 fix 61907 - auto_attach yes option not honored in ec2_transit_gateway (#61993)
* fix 61907 - auto_attach yes option not honored in ec2_transit_gateway

* add changelog fragment
5 years ago
phongle1205 331d51fb16 Attach an attached/detached volume from OpenStack VM’s should return similar information (#21558)
Currently, attach an attached volume from OpenStack VM’s returns only
argument data. It is better to return full data as attaching a detached
volume.

In my use case, I need the extra data to mount and format the volume.
5 years ago
Toshio Kuratomi cc1ff57c5b
AH servers include automation-hub as part of the server configuration. (#63700)
* AH servers include automation-hub as part of the server configuration.

So we don't need to add it here.

Fixes #63699

* Update unittests for the fix to galaxy wait_import_task
5 years ago
Gary Williams 3f0479279e VMware: Add a parameter wait_for_ip_address_timeout in vmware_guest (#63557)
* Added a parameter (wait_for_ip_address_timeout) to allow a longer timeout than the default.
* Removed the wait_for_vm_ip function in this module as one in module_utils is already being used elsewhere.
5 years ago
Sam Doran dcec3d000e syslogger - disable check mode (#63646) 5 years ago
Felix Fontein 4b1fdee119
docker_container: deprecate trust_image_content (#63420)
* Deprecate trust_image_content.

* Add changelog.

* Mention it has never been used; removed test stub.
5 years ago