Commit Graph

50014 Commits (323d2adfcce9a53e906c2c4a40f6ac5fb32a0e68)
 

Author SHA1 Message Date
Andrew Klychkov 323d2adfcc
Fix example format in Ansible modules (#69509)
* Fix example format in several Ansible modules
* Update lib/ansible/modules/fail.py
* Update lib/ansible/modules/pip.py

Co-authored-by: Felix Fontein <felix@fontein.de>
4 years ago
Brian Coca d0a25f004c
note that environment is not good for secrets (#69618)
* note that environment is not good for secrets
* Update docs/docsite/rst/user_guide/playbooks_environment.rst
Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Toshio Kuratomi 412af6ae91
Fix docs return formatting. (#69632)
Gets rid of the unknown field names in the return data.
Allows the plugin return docs to format under the new docs pipeline.
* Expect that package_facts will pass return-syntax-error now.
4 years ago
Jeff Geerling 21b65257bf
Fix spacing for playbook collections example. (#69688) 4 years ago
Anatoly Pugachev 09f86c1410
docs: communications update (#69687)
* add some more info on IRC support channels to docs
4 years ago
Jack Scheible 0ce404c4d9
Update intro_inventory.rst (#69718)
Vars in inventory are merged in ASCII order. Change docs to reflect that.
4 years ago
Pilou 59f2174c8b
Doc: playbook keywords are reserved names too (#69585) 4 years ago
Ganesh Biradar 187de7a8aa
Updated CLI help for 'ansible-galaxy' for 'collection' subcommand (#69458)
* Added YAML header line and link to existing github issue
4 years ago
Rick Elrod 4dd0f41270
Update announce script for ansible-base (#69735)
Change:
- s/Ansible/ansible-base/
- Update URLs

Test Plan:
- Hope for the best. (No real way to test this until release day because
  there are no files on releases.a.c for it to hash right now. A staging
  releng environment would fix this.)

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Sam Doran d7618712fd
blockinfile - fix line end regression (#69734)
PR #66461 introduced a regression that resulted in an in correct block in the file
if the block to be inserted did not end with a line separator. Fix this bug and add
tests to cover this scenario.
4 years ago
Matt Clay 65c57a7f5b Update default-test-container to version 1.14. 4 years ago
Riyad Preukschas e5cc12a64f
blockinfile - Preserve line endings (#66461)
Fixes #64966
* Fix "TypeError: splitlines() takes no keyword arguments" on Python2.7
* Add changelog fragment
* Don't use `grep -P` for BSD/macOS compatibility
* Fix sanity checks complaining about test fixtures with mixed line endings
* Update changelogs/fragments/66461-blockinfile_preserve_line_endings.yaml
4 years ago
Rick Elrod 8b6c02fc69
Make connection plugins use password from config (#69670)
Change:
Rather than connection plugins directly accessing play_context and pulling
the password from there, have them pull it from the config system, and
have TaskExecutor store it there for now.

Internally, it still routes through play_context for now, but this is
the first step away from that.

Test Plan:
- Local test with `ansible -c ssh`
- grep -R play_context.pass lib/ansible/plugins/connection/
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Abhijeet Kasurde 564907d8ac
distribution: Refactor test_distribution_version testcases (#69300) 4 years ago
Felix Fontein cb8f645e0f
Allow to deprecate / remove plugins by version. (#69712) 4 years ago
Rick Elrod 304c3e57e8
[ssh] Add new sshpass_prompt option (#68874)
Change:
Allows the user to configure sshpass (1.06+) to look for a different
substring than the default "assword" that it comes with.

Test Plan:
Set a custom ssh password prompt on a VM with PAM and tried connecting to
it. Without `ansible_sshpass_prompt` set in inventory: experienced hang.
With `ansible_sshpass_prompt` in inventory: connected successfully.

Tried setting `ansible_sshpass_prompt` with an older `sshpass` in PATH
and got a loud error, as expected.

Tickets:
Fixes #34722, fixes #54743, refs #11565.

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Felix Fontein ea04e0048d
Allow to deprecate options and aliases by date (#68177)
* Allow to deprecate options and aliases by date instead of only by version.

* Update display.deprecate().

* Adjust behavior to conform to tested behavior, extend tests, and improve C# style.

* Parse date and fail on invalid date.

This is mainly to make sure that people start using invalid dates, and we eventually have a mess to clean up.

* C# code: improve validation and update/extend tests.

* Make sure that deprecate() is not called with both date and version.

* Forgot to remove no longer necessary formatting.

* Adjust order of warnings in C# code.

* Adjust unrelated test.

* Fix grammar (and make that test pass).

* Don't parse date, and adjust message to be same as in #67684.

* Sanity tests: disable date in past test.

* Validate-modules: validate ISO 8601 date format.

* Validate-modules: switch schema declaration for deprecated_aliases to improve error messages for invalid dates.

* Use DateTime instead of string for date deprecation.

* Validate that date in deprecated_aliases is actually a DateTime.

* Fix tests.

* Fix rebasing error.

* Adjust error codes for pylint, and add removed_at_date and deprecated_aliases.date checks to validate-modules.

* Make deprecation date in the past error codes optional.

* Make sure not both version and date are specified for AnsibleModule.deprecate() calls.

* Stop using Python 3.7+ API.

* Make sure errors are actually reported. Re-add 'ansible-' prefix.

* Avoid crashing when 'name' isn't there.

* Linting.

* Update lib/ansible/module_utils/csharp/Ansible.Basic.cs

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Adjust test to latest change.

* Prefer date over version if both end up in Display.deprecated().

Co-authored-by: Jordan Borean <jborean93@gmail.com>
4 years ago
Rick Elrod 341a6be78d
fix debian control file copypaste fail (#69715)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 1ed5b587c8
More fixes for debian ansible-base builds (#69714)
Change:
Fix files that got missed in 04ec72160

Test Plan:
Local Ubuntu 20.04 VM

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Matt Davis fa81cc6a0c
fix delegated loading when path is not a directory (#69713)
* find_module can't pop ImportError- we need to just translate to `None` since this is a normal condition with files on sys.path (eg `/usr/lib/python36.zip`)
* added test
4 years ago
Matt Clay 5fc01c0a1d
Use a custom build container on Shippable. (#69660)
* Use a custom build container on Shippable.

This supports key generation before git_sync, to avoid issues with pre-migration PRs.

If the node pool is switched to another version, a matching build container should be built and used.

* Don't kill our own custom container.
4 years ago
Brian Coca c987c0c8a1
provides per host/plugin world readable temp opt (#69393)
fixes #46174
4 years ago
Rick Elrod 4aff87770e
[yum] Make package removal confirmation strict (#69592)
* [yum] Make package removal confirmation strict

Change:
After removing packages, the yum module does a final check to ensure the
packages are really installed. The check would include packages that
were RPM `Provides:` values of another package.

This means that, for example, if a third-party kernel RPM spec had
`Provides: kernel` in it, removing the stock kernel would be successful
but the check to see if it was really removed would fail and cause
Ansible to report a failure.

Test Plan:
Tested on local CentOS 7 VM with kernel from elrepo which is known to
`Provides: kernel`.

Tickets:
Fixes #69237
Refs #35672
Refs #40723

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Matt Davis f7dfa817ae
collection routing (#67684)
* `meta/` directory in collections
* runtime metadata for redirection/deprecation/removal of plugin loads
* a compatibility layer to keep existing content working on ansible-base + collections
* a Python import redirection layer to keep collections-hosted (and otherwise moved) content importable by things that don't know better
* supported Ansible version validation on collection loads
4 years ago
Helder Garcia fdfa6fec75
Module Find returns empty list when setting path to "/" and depth to 1 (#69650)
* Fix bug on find module when path is / and depth 1.
4 years ago
Nilashish Chakraborty dae3ba71a8
Add FQCN mappings for network facts modules (#69601)
* Add FQCN mappings for network facts modules

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Add unit tests

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* update entry for ironware

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
4 years ago
Rick Elrod fe9696be52
Fix `ansible -K` become_pass regression (#69629)
* Fix `ansible -K` become_pass regression

Change:
- This fixes a breaking change introduced in
  2165f9ac40

Test Plan:
- Local VM for now, with plans to add an integration test for -K going
  forward.

Tickets:
Refs #69244
4 years ago
Brian Coca de3f7c7739
fix delegated interpreter discovery (#69604)
* fix delegated interpeter
* allow returning fact if it is 'the right host'
* added note for future fix/efficiency
 as it stands we rerun discovery for the delegated host
unless its saving facts to itself
 * fixed test lacking delegate_to mock
4 years ago
Rick Elrod dc63b36501
Spelling: dependant -> dependent (#69661) 4 years ago
James Cammarata a4072ad0e9
Split regular and handler results into their own queues (#69498)
When mixed with the free strategy (or any custom strategy that does not behave in
a lock-step manner), the linear methodology of _wait_on_handler_results may cause
race conditions with regular task result processing if the strategy uses
_process_pending_results directly. This patch addresses that by splitting the queues
used for results and adding a flag to _process_pending_results to determine which
queue to check.

Fixes #69457
4 years ago
Sam Doran cd8920af99
file - return 'state': 'absent' when a file does not exist (#66503)
This was changed in ansible/ansible#51350.
4 years ago
Matt Martz e0f25a2b1f
Strip no log values from module response keys. Fixes #68400 (#69653) 4 years ago
Matt Clay cfd301a586 Restore CentOS on Power in CI. 4 years ago
David Soper eb5147e57b
intersight_info and intersight_facts routed to cisco.intersight (#69648)
Co-authored-by: “dsoper2” <“dsoper@cisco.com”>
4 years ago
Martin Krizek 1ee70fc272
ansible.utils.vars.isidentifier improvements (#58278)
ci_complete
4 years ago
Brian Coca 9281148b62
correctly merge multiple facts results (#68987)
* correctly merge multiple facts results

  fixes #68532
4 years ago
Sam Doran fe941a4045 Pin Docker version at 19.03.1 4 years ago
Matt Clay 8fe812b212
Remove conflicting plugin from test/support/ dir. (#69628) 4 years ago
Matt Martz b748edea45
Add multipart/form-data functionality (#69376)
* Add multipart/form-data functionality

* Fix some linting issues

* Fix error message

* Allow filename to be provided with content

* Add integration test

* Update examples

* General improvements to multipart handling

* Use prepare_multipart for galaxy collection publish

* Properly account for py2 vs py3, ensuring no max header length

* Address test assumptions

* Add unit tests

* Add changelog

* Ensure to use CRLF instead of NL

* Ignore line-endings in fixture

* Consolidate code, add comment

* Bump fallaxy container version

* ci_complete
4 years ago
Matt Clay 08da8f49b8 Remove AIX from CI. 4 years ago
Martin Krizek ecd986006e
Properly handle unicode in safe_eval (#68576)
* Properly handle unicode in safe_eval

Fixes #66943

* Update lib/ansible/template/safe_eval.py

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Sam Doran 889da811d7
Pin docker-ce-cli version in tests (#69620)
Installing docker-ce has a dependency of docker-ce-cli. If the version of docker-ci-cli is not specified, it installs the latest version.
4 years ago
Toshio Kuratomi 9780d3db18 Remove "keywords" field in DOCUMENTATION.
This doesn't seem to be used by config although it came in with the
config PR.  It's not displayed in docs.  Removing it as this is the only
place where it's present.
4 years ago
Brian Coca 06ecdaa7b1
comment heavy playbook (#68981)
* create examples/play.yml


Co-authored-by: flowerysong <junk+github@flowerysong.com>
4 years ago
Brian Coca df4e83deda
added 'task timeout' feature (#69284)
* added 'task timeout' feature


Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Felix Fontein ac533403e3
Google gcp_*_facts modules were symlinks to gcp_*_info modules in 2.9. (#69566)
Since it doesn't make sense to have extra copies of the _info modules in community.general only so that the _facts
symlinks are not in google.cloud, let's simply redirect the _facts modules to their google.cloud _info counterpart.

See also ansible-collections/community.general#351.
4 years ago
Sam Doran f01de15d25
ansible-galaxy - remove warning during collection install (#69541)
* ansible-galaxy - remove warning during collection install

If existing collections do not contain a MANIFEST.json, which is common
for collections under development that were not installed from Ansible
Galaxy, fall back to inspecting galaxy.yml rather than displaying a
warning.

A warning will still be displayed in neither a MANIFEST.json nor
galaxy.yml are present.

* Update unit tests
4 years ago
Monty Taylor dd4219184b
Update openstack module redirections (#69562)
The openstack related modules moved to the openstack cloud
collection. Update the target pointers.
4 years ago
Felix Fontein 43acd61901
ansible-test local change detection: use --base-branch if specified (#69508) 4 years ago
Jordan Borean ecea15c508
Unify ansible-galaxy install -r (#67843)
* Unify ansible-galaxy install -r

* Minor nit fixes for docs

* Re-align warnings

* Fix up integration test

* Fix up test where no roles/collections were in file
4 years ago