The tests are unstable when running the setup_mysql_db dependency.
Since the stable-2.5 branch is security fixes only and will be EOL
in a little more than one month, it makes sense to disable these
tests instead of trying to fix them.
In pyyaml versions before 5.1 the default_flow_style for yaml.dump
was None. Starting with 5.1 it is now False. This change explicitly
sets the value to None to maintain the original to_yaml behavior.
The change to pyyaml was made in the following commit:
507a464ce6
(cherry picked from commit 7f0e09aa31)
Co-authored-by: Matt Clay <matt@mystile.com>
* Disallow use of remote home directories containing .. in their path
* Add CVE to changelog
(cherry picked from commit b34d141)
Co-authored-by: Matt Martz <matt@sivel.net>
* fix tempating issues with no_log and loops (#44468)
* fix tempating issues with no_log and loops
- task is no log if any item is
- added test cases
fixes#43294
(cherry picked from commit bda074d34e)
* use play context to avoid bug when jinja2+py3
(cherry picked from commit b0678e71a8)
* recent changes to args for hosted template file broke the test; changed test to use a specific known-working commit instead of `master`.
* long-term may want to consider hosting the template in httptester or just embedding a local copy
(cherry picked from commit 46bf387)
Co-authored-by: Matt Davis <mrd@redhat.com>
* Fix subversion integration test on Fedora 29.
This upgrades the sqlite-libs and subversion packages to make sure
that the version of sqlite expected by subversion is installed.
* Fix compatibility with RHEL and CentOS.
(cherry picked from commit d4dbc7f2e0)
Co-authored-by: Matt Clay <matt@mystile.com>
Download package from S3 since the previous location no longer exists.
(cherry picked from commit fd56788a14)
Co-authored-by: Matt Clay <matt@mystile.com>
The API docs state that both `branch` and `branchName` are valid,
but only `branchName` appears to work.
(cherry picked from commit 31c1bdd6a8)
Co-authored-by: Matt Clay <matt@mystile.com>
* Add `env` command to ansible-test and run in CI.
* Avoid unnecessary docker pull.
(cherry picked from commit 01833b6fb1)
Co-authored-by: Matt Clay <matt@mystile.com>
Hopefully this will work around the intermittent CI failures due
to NullReferenceException, which then succeed on a retry.
(cherry picked from commit 4bd60c313b)
Co-authored-by: Matt Clay <matt@mystile.com>
This fixes tests which are failing due to unavailable SKUs:
GP_Gen4_2 -> B_Gen5_1
westus -> westus2
Both changes result in lower costs to run tests as well.
Changes derived from: https://github.com/ansible/ansible/pull/45444
Also switch from uswest to uswest2.
GP_Gen4_2 is more expensive and is no longer available in all regions.
The uswest location is also more expensive than uswest2.
This is a bug fix since GP_Gen4_2 is no longer available in uswest.
Applying this fix directly to older stable branches as the tests have
changed significantly in devel.
(cherry picked from commit e5b2b2ff2b)
* create local subversion server for tests (#49047)
* create local subversion server for tests
* fix sanity issues
* don't touch system config when bringing up site
* removed original setup files
* fix opensuse config
(cherry picked from commit 0420d606de)
* manually add setup_passlib for 2.5
-Add: Mention bitbucket dropping TLSv1 and TLSv1.1 support as per 01 Dec 2018, potentially causing issues with older clients.
(cherry picked from commit a6db7f7abd)
Co-authored-by: Xaroth <xaroth+github@xaroth.nl>
* Switch tests from RHEL 7.5 to 7.6.
(cherry picked from commit 6745ee7cc8)
* Remove CI platform: freebsd/10.4
(cherry picked from commit e6ffc4f89a)
* Add `--raw` option to ansible-test shell command.
It is currently supported only with the `--remote` option.
This makes it easier to troubleshoot new instances which are not
yet supported by the setup scripts used by ansible-test.
(cherry picked from commit 0826a00803)
* Support skip of platforms by version in tests. (#48826)
* Support skip of platforms by version in tests.
Previously a remote platform could be skipped completely using the alias:
`skip/{platform}` such as `skip/rhel`
Now a specific platform version can be skipped using the alias:
`skip/{platform}{version}` such as `skip/rhel7.6`
This feature is available for platforms specified with the `--remote` option.
* Add skip by version to the docs.
(cherry picked from commit 8066acc90c)
* Fix ansible-test skip warning message.
(cherry picked from commit 3b705efc93)
* Fix lookup_passwordstore test skipping. (#49178)
* Fix lookup_passwordstore test skipping.
Skip all of RHEL instead of specific versions.
Skip all of CentOS < 7 instead of specific versions.
This makes the test more robust when testing newer versions.
Tests could be executed on RHEL if EPEL was installed during the test.
(cherry picked from commit 704dae2cda)
* Download hello package from S3 for apt test.
(cherry picked from commit 83fd82ca7e)
* Fix passing of env vars to Shippable.
(cherry picked from commit 9979a32e5c)
* Use correct interpreter for ansible-test injector.
(cherry picked from commit eec21a3d12)
* Correct ansible-test injector python behavior.
Inject a symlink to the correct python into the copied injector
directory instead of altering the shebang of the injector. This
has the side-effect of also intercepting `python` for integration
tests which simplifies cases where it needs to be directly invoked
without collecting code coverage.
(cherry picked from commit d6bf45cd9d)
* Fix ansible-test merge change detection.
(cherry picked from commit aa7fe919d3)
* Fix ansible-test interpreter tracking.
Track the interpreter for each copy of the injector by the interpreter
path instead of the interpreter version. This avoids the possibility
of mixing different interpreters with the same version.
(cherry picked from commit fa53b4805b)
* Use `state: latest` for `dpkg_selections` test.
We don't need to test with `upgrade: dist`, since we're not trying
to test the `apt` module. We just need to make sure the hold set
by the `dpkg_selections` module is working.
This change will avoid updating all the packages on the system,
which is slow, unnecessary, and can cause the installed python
to be changed.
(cherry picked from commit 136a2cca2f)
* filesystem: fix test to work on newer Fedora (#47176)
(cherry picked from commit ae5aeb9a67)
* test: filesystem update note on test comment (#47260)
(cherry picked from commit 5d2927c9a0)
The mysql-server package on Ubuntu16.04 was recently updated to disallow
unauthenticated root user login over tcp/ip. This, coupled with pymysql
using tcp/ip whenever host and port is specified causes us to fail to
connect to the database when testing Python3 on Ubuntu16.04.
The fix is to use the unix socket instead..
(cherry picked from commit 748ea39ecd)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* user: do not pass ssh_key_passphrase on cmdline
* user: do not pass ssh_key_passphrase on cmdline
CVE-2018-16837
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
(cherry picked from commit a0aa53d1a1)
* Ignore user module use of subprocess.
(cherry picked from commit 8d00afc013)
* Fix python3 problem in user module cve fix
(cherry picked from commit 9088671c4e)
* Fix changelog entry for user module CVE fix
(cherry picked from commit 210a43ebeb)
(cherry picked from commit b618339c32)
* zap ignore entry
* ansible-test: add skip/windows/... alias to skip tests on specific Windows versions
* show what tests were skipped
* changes to logic to only skip if all Windows targets are set to skip
* codestyle improvements
* change warning message based on review
* check args type before running the Windows path
(cherry picked from commit 0f5331645f)
* Fix unit test parametrize order on Python 3.5.
(cherry picked from commit 53b230ca74)
* Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
(cherry picked from commit 379a7f4f5a)
* Run unit tests in parallel. (#45812)
(cherry picked from commit abe8e4c9e8)
* Minor fixes for unit test delegation.
(cherry picked from commit be199cfe90)
* add support for opening shell on remote Windows host (#43919)
* add support for opening shell on remote Windows host
* added arg completion and fix sanity check
* remove uneeded arg
(cherry picked from commit 6ca4ea0c1f)
* Block network access for unit tests in docker.
(cherry picked from commit 99cac99cbc)
* Make ansible-test available in the bin directory. (#45876)
(cherry picked from commit f3d1f9544b)
* Support comments in ansible-test flat files.
(cherry picked from commit 5a3000af19)
* Fix incorrect use of subprocess.CalledProcessError (#45890)
(cherry picked from commit 24dd87bd0a)
* Improve ansible-test match error handling.
(cherry picked from commit 2056c981ae)
* Improve error handling for docs-build test.
(cherry picked from commit 2148999048)
* Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports.
* Clean up ConfigParser usage in ansible-test.
* Fix bare except statements in ansible-test.
* Miscellaneous cleanup from PyCharm inspections.
* Enable pylint no-self-use for ansible-test.
* Remove obsolete pylint ignores for Python 3.7.
* Fix shellcheck issuers under newer shellcheck.
* Use newer path for ansible-test.
* Fix issues in code-smell tests.
(cherry picked from commit ac492476e5)
* Fix integration test library search path.
This prevents tests from loading modules outside the source tree,
which could result in testing the wrong module if a system-wide
install is present, or custom modules exist.
(cherry picked from commit d603cd41fe)
* Update default container to version 1.2.0.
(cherry picked from commit d478a4c3f6)
(cherry picked from commit 21c4eb8db5)
* Fix ansible-test docker python version handling.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.
(cherry picked from commit 54937ba784)
* Reduce noise in docs-build test failures.
(cherry picked from commit 4085d01617)
* Fix ansible-test encoding issues for exceptions.
(cherry picked from commit 0d7a156319)
* Fix ansible-test multi-group smoke test handling. (#46363)
* Fix ansible-test smoke tests across groups.
* Fix ansible-test list arg defaults.
* Fix ansible-test require and exclude delegation.
* Fix detection of Windows specific changes.
* Add minimal Windows testing for Python 3.7.
(cherry picked from commit e53390b3b1)
* Use default-test-container version 1.3.0.
(cherry picked from commit 6d9be66418)
* Add file exists check in integration-aliases test.
(cherry picked from commit 33a8be9109)
* Improve ansible-test environment checking between tests. (#46459)
* Add unified diff output to environment validation.
This makes it easier to see where the environment changed.
* Compare Python interpreters by version to pip shebangs.
This helps expose cases where pip executables use a different
Python interpreter than is expected.
* Query `pip.__version__` instead of using `pip --version`.
This is a much faster way to query the pip version. It also more
closely matches how we invoke pip within ansible-test.
* Remove redundant environment scan between tests.
This reuses the environment scan from the end of the previous test
as the basis for comparison during the next test.
(cherry picked from commit 0dc7f38787)
* Add symlinks sanity test. (#46467)
* Add symlinks sanity test.
* Replace legacy test symlinks with actual content.
* Remove dir symlink from template_jinja2_latest.
* Update import test to use generated library dir.
* Fix copy test symlink setup.
(cherry picked from commit e2b6047514)
* Fix parametrize warning in unit tests.
(cherry picked from commit 1a28898a00)
* Update MANIFEST.in (#46502)
* Update MANIFEST.in:
- Remove unnecessary prune.
- Include files needed by tests.
- Exclude botmeta sanity test.
These changes permit sanity tests to pass on sdist output.
(cherry picked from commit cbb49f66ec)
* Fix unit tests which modify the source tree. (#45763)
* Fix CNOS unit test log usage.
* Use temp dir for Galaxy unit tests.
* Write to temp files in interfaces_file unit test.
* Fix log placement in netapp_e_ldap unit test.
(cherry picked from commit 0686450cae)
* Fix ansible-test custom docker image traceback.
(cherry picked from commit 712ad9ed64)
* ansible-test: Create public key creating Windows targets (#43760)
* ansible-test: Create public key creating Windows targets
* Changed to always set SSH Key for Windows hosts
(cherry picked from commit adc0efe10c)
* Fix and re-enable sts_assume_role integration tests (#46026)
* Fix the STS assume role error message assertion when the role to assume does not exist.
(cherry picked from commit 18dc928e28)
* Fix ACI unit test on Python 3.7.0.
The previous logic was only needed for pre-release versions of 3.7.
(cherry picked from commit c0bf9815c9)
* Remove placeboify from unit tests that are not calling AWS (i.e. creating a recording) (#45754)
(cherry picked from commit 2167ce6cb6)
* Update sanity test ignore entries.
* Ensure that the value of PLUGIN_FILTERS_CFG is treated as type=path, and that we use the standard section of 'defaults' instead of 'default'
* deprecate the default section
* Don't add version_added for the corrected section
(cherry picked from commit 172137c)
Co-authored-by: Matt Martz <matt@sivel.net>
* Return correct version on installed VyOS (#39115)
* Return correct version on installed VyOS
Previously existing regexp will shows only "VyOS" without numeric output of router version.
For example: from "Version: VyOS 1.1.6" only VyOS will be written in ansible_net_version variable
For more informative output numeric value should be returned as well
* Fixed unittests
(cherry picked from commit 235b11f681)
* Added changelog
* [stable-2.5] [stable-2.7] Fix logic to not re-download existing files when force=no (#45495) (#45509)
* [stable-2.7] Fix logic to not re-download existing files when force=no (#45495)
* Fix logic to not re-download existing files when force=no. Fixes#45491
* Reduce logic complexity.
(cherry picked from commit 5785de582f)
Co-authored-by: Matt Martz <matt@sivel.net>
* Backport of get_url fix cannot use result
result was only added in 2.8+.
(cherry picked from commit 99171a9c6f)
Co-authored-by: Matt Martz <matt@sivel.net>
* Update get_url.py
* Don't pass file_name to DataLoader.load in script inventory plugin. Fixes#34164
* Add changelog fragment
(cherry picked from commit 263b9fa)
Co-authored-by: Matt Martz <matt@sivel.net>
* Documentation change for resizefs (#43224)
Changed documentation to match the default value of resizefs set in the code.
Added a note on the resizefs use on the example utilizing it.
- Limit virtualenv version on Python 2.6.
- Limit pyopenssl version on Python 2.6.
- Pin pyfmg version to keep unit tests passing.
(cherry picked from commit b3a3e8ba7b)
* [stable-2.5] Don't allow import_tasks to transition to dynamic when file is missing. See #44822 (#44836)
(cherry picked from commit cd2f66f)
Co-authored-by: Matt Martz <matt@sivel.net>
* Look in task_ds, as we don't have action var in 2.5
There should be no warning if there is no ansible.cfg file i nthe
current working directory.
(cherry picked from commit f46c943)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* strip additional comments from /etc/default/passwd
Strip trailling comments from /etc/default/passwd like
MINWEEKS=1 #MINWEEKS=2
MAXWEEKS=12 # MAXWEEKS=8
Which otherwise cause failures with "failed to read /etc/default/passwd: too many values to unpack"
* fix carriage return typo in commit
* yet another typo in commit
* Fix indent problem
* add changelog fragment for PR 43931
(cherry picked from commit 5c1e620504)
* essential fixes in 2.5
* one more fix
* disable try to see whats the problem
* fix indent
* try to fix msrest version
* fixed test
* undo try-except commenting out
* updated tests
This also allows the test to run on newer containers by not
manipulating any of the pre-configured repositories.
(cherry picked from commit cac51e6da8)
This allows the use of variables in vars_prompt fields but allows variables entered in the prompt to affect play vars rather than throwing an undefined error.
Add tests for vars_prompt
(cherry picked from commit 6d38167d49)
The bundled selectors library which is used by the local and ssh
connection plugins had a bug which caused a traceback in a cornercase.
If selectors were in use and a syscall was interrupted, selectors would
attempt to restart the syscall after the interrupt was processed. if
the attempt determined that the timeout for running the syscall had
already expired, the code attempted to raise OSError. The raise was
using a Python3-ism and needed to be ported to work on Python2.
Fixes#41630
(cherry picked from commit e2e44f8)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Only print warning when ansible.cfg is actually skipped
* Also add unittests for the find_ini_config_file function
* Add documentation on world writable current working directory
config files can no longer be loaded from a world writable current
working directory but the end user is allowed to specify that
explicitly. Give appropriate warnings and information on how.
Fixes#42388
(cherry picked from commit 30662bedad)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* openvswitch_db: Split key-value pairs correctly (#33335)
Map values can contain commas, e.g.
- name: Configure OVN bridge mapping
openvswitch_db:
state: present table: open_vswitch record: . col: external_ids key: ovn-bridge-mappings
value: '"vmnet-static:br-vmnet-st,vmnet-dynamic:br-vmnet-dyn"'
Previous behaviour was splitting the value and raised an exception.
(cherry picked from commit 3c53e2f8ea)
* openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is
required only for columns with type of a 'map'. This patch makes 'key'
an optional parameter to allow setting values for other column types
like int.
Fixes#42108
(cherry picked from commit 26b0908270)
(cherry picked from commit 01097715fd9466c64bfb37d7604d095275a5e9d8)
* Update JSON Query filter examples
Correct syntax on one example
Add more examples of escaping
Change example to show joining list to string
(cherry picked from commit 7b0dea45e9)
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
(cherry picked from commit 4e489d1be8)
* Make ios_vlan identify vlans starting with 9 (#42247)
* Make ios_vlan identify vlans starting with 9
* Add unit test for vlan id start with 9
(cherry picked from commit 70e33ef92c)
* Added changelog for ios_vlan fix
* [2.5] Update ios tests (#42509)
* 192.168.0.1/24 conflicts with management IP
* Images don't have the hostnames we expect
(cherry picked from commit 399d13d)
Co-authored-by: Nathaniel Case <this.is@nathanielca.se>
* ios test cleanup pt 2 (#42570)
* Remove local from ios_config to avoid needing to add provider
* ios_smoke should test all with local to pick up the slack
(cherry picked from commit 381263ad99)
* Use separate variables for stdin and stdout file descriptors
* Do not set stdout to raw mode when output is not a TTY
(cherry picked from commit 1d1595b990)
* Revert "Account for empty string regexp in lineinfile (#41451)"
This reverts commit 4b5b4a760c.
* Use context managers for interacting with files
* Store line and regexp parameters in a variable
* Add warning when regexp is an empty string
* Remove '=' from error messages
* Update warning message and add changelog
* Add tests
* Improve warning message
Offer an equivalent regexp that won't trigger the warning.
Update tests to match new warning.
* Add porting guide entry for lineinfile change
(cherry picked from commit fb55038d75)
* influxdb_query: fix use of common return results (#39626)
(cherry picked from commit aa874c3c36)
* changelog: influxdb_query fix use of common return
* [stable-2.5] ignore ansible.cfg in world writable cwd (#42070)
* ignore ansible.cfg in world writable cwd
* also added 'warnings' to config
* updated man page template
(cherry picked from commit b6f2aad)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
* Update wrcwd_ansible.cfg.yml
Fixes#40626
* Due to issue in ncclient commit() method for Juniper
device (ncclient/ncclient#238)
add a workaround in junos netconf plugin to generate proper
commit-configuration xml and execute it using ncclient
generic `rpc()` method.
* Update junos_config doc
* Update changelog
(cherry picked from commit 88b966e23b)
* service_facts correct meaning of state for systemd service units
Fixes#40809
Previously this module used the commend `systemctl list-unit-files
--type=service` to query state of services but list-unit-files only
shows enabled vs disabled which is not what we want for "state"
Signed-off-by: Adam Miller <admiller@redhat.com>
* make sure to define service_name before referencing it
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit bf1cc2f1f4)
This commit: fa5c0282a4 relied upon
features present in Jinja-2.10 and above. The changes here allow us to
build the *rst* with older versions of jinja2.
(cherry picked from commit ad2e8dd)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* Skip if insertbefore BOF until later (#41767)
If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF.
Add tests for this scenario.
(cherry picked from commit eaae1318f8)
* Add changelog fragment
* Use inventory.get_host instead of direct access to inventory.hosts (#41860)
* Use inventory.get_host instead of direct access to inventory.hosts. Fixes#32152
* Prevent potential side effect, by using self._inventory.localhost directly instead of get_host
(cherry picked from commit 1a2ef0922f)
* Add changelog for #41860
* fix minor issues with debug and item labels
- no more `item=None`, we always have a label now
- debug should only show expected information, either msg= or the var in var=
- also fixed method name, deprecated misleading _get_item
(cherry picked from commit 27c43daab8)
When parsing the distribution files such as /etc/os-release, we extract
the full distribution version but not the major version. As such, the
ansible_distribution_major_version ends up being 'NA' whereas the
ansible_distribution_version contains the full version.
Before this patch we get this on openSUSE Leap 15
ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "NA"}, "changed": false}
After this patch we get this
ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "15"}, "changed": false}
This also fixes the Tumbleweed distribution test to report a proper
major version and also adds a test for openSUSE Leap 15.0 to avoid
potential future regressions.
Fixes: #41410
(cherry picked from commit 1737b7be3e)
* Fixes#34893 (#40166)
Fixes several bugs exposed in #34893
* Fixes relative path handling in copy so that it splits directories and
reconstructs the correct file path
* Return failed in the proper circumstances
(cherry picked from commit ca4147f2cc)
* Add changelog for recursive copy fix
(cherry picked from commit cab0f21564)
The module name, missmatch in documentation.
ISSUE TYPE
- Documentation
COMPONENT NAME
bigip_configsync_action
ANSIBLE VERSION
stable-2.5
Signed-off-by: Rosiney Gomes Pereira <rosiney.pereira@agilitynetworks.com.br>
* Add helpful failure message if target_type=ip is not supported
Create test case for target_type=ip not supported
* Update elb_target_group module to latest standards
Use AnsibleAWSModule
Improve exception handling
Improve connection handling
(cherry picked from commit 29770a297a)
On rabbitmq 3.7 using `force: yes` fails because outputs of rabbitmqctl gives an empty line
```
root@rabbitmq-vm1:~# rabbitmqctl -q list_user_permissions john
root@rabbitmq-vm1:~#
```
Provoking an error on
456af458fc/lib/ansible/modules/messaging/rabbitmq_user.py (L185)
Because `perm.split('\t')` does not find any `\t`
Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
(cherry picked from commit 8ddca3e6cfd906f0ff48a2c08410a9f82d195deb)
* no_log even when task_result doesn't provide key
- now also checks task property
- added reproducer to tests for unreachable status on item loop
(cherry picked from commit 336b3762b2)
* Add changelog entry for the no_log fix
(cherry picked from commit 5fdd101a3e)
* cherry-picked from 89cea78e30 and fixed merge conflicts from restructuring the integration tests in devel
Fix async for aws_s3
Add a test that async is able to be used on aws_s3 tasks
(cherry picked from commit cef92e3942cdd76866c47d25f903625e6d7eb6ed)
* changelog format tweak
* Fix ec2_ami block_device_mapping volume_size to be int in 2.5 (#40938)
* fix ec2_ami block_device_mapping size to be int
* fixed cr issues
renamed `type` to `attribute_type`
reused `new_item` instead of creating new variable `value`
(cherry picked from commit ab96a84154)
* changelog
(cherry picked from commit e6cd727181cb6c7e08f9cbad44dc7d625e78406a)
* changelog format tweak
* aws_s3: don't decrypt file before uploading - fixes#39287 (#39634)
* aws_s3: do not decrypt file before uploading to bucket
* changelog
(cherry picked from commit 387c37e255)
* changelog format tweak
* Do not gather mem facts if command invalid (#40820)
* Do not gather mem facts if command invalid
In some firmwares, 'show memory statistics' fail, thus
do not populate mem if we got a failure after running that command.
* Fix pep8
* Warn if got error when running 'sh memory statistics'
* Fix pep8
(cherry picked from commit 669949e6a3)
* Update ios_facts.py (#40928)
Account for upper/lower case match occurrences of "[Nn]umber" and "[Ss]erial"
Model Number : WS-C3850-12X48U
System Serial Number : <removed>
(cherry picked from commit 12d221152b)
* Expand ios password prompt regex (#41131)
(cherry picked from commit 49fddb6f28)
* Fixes to ios_logging (#41029)
* Logging size may not show up in config
* This is much simpler
* Avoid repetition in tests
* Both options of buffered are optional
(cherry picked from commit 92a95368fe)
* Added changelog
Iterating an object and changing it at the same time is unsecure and no longer permitted in Python >= 3.6
Provisioning an instance fail with the Python error: "RuntimeError: dictionary changed size during iteration"
The current example configuration is not
quite right, so this patch implements a
fix which corrects it
The 'inventory_hostname' argument is removed
as it's the same value as the default.
(cherry picked from commit 12218f33a5c429676da8f3db0f91553c63a0314f)
* os_project_access: correct example tasks
The example task does not work. Fix it so that it does.
(cherry picked from commit 028b5965b66656ffe7810cea3bcc0e505339ebc2)
* os_project_access: Remove unused function
The _get_allowed_projects function is not used anywhere,
so we can remove it and be free of nova_client for this
module.
(cherry picked from commit c190a2826d6935848278867c67f36f2b56728f94)
The os_server module uses the deprecated nova_client function, and
therefore ends up requiring python-novaclient installed. In this
patch we switch the ip detachment to make use of a shade function,
removing the need for python-novaclient.
(cherry picked from commit 055d89cd32385fa891e17a24aadc2c68397f307d)
* Fix formatting error in rst plugin template (#38956)
The hyperlink syntax used is wrong and the resulting
rendered documents have broken links.
(cherry picked from commit aaf2ff629d)
* Add missing > to fix 'edit this document' link (#39067)
(cherry picked from commit ebdf6d0fab)
* Fix problems in documentation generation (#40050)
* Treat C(...) as inline literal (as opposed to interpreted text).
* Making test for true and false more precise, to avoid matching 1, 1.0, etc.
* The 'is sameas' test already takes care of definedness.
(cherry picked from commit f16933492d)
* Namespace the aliases ref target by plugin type (#38925)
(cherry picked from commit 7ce1afebf0)
* Use colspan on td instead of divs for hierarchical tables (#39948)
Address Firefox table-rendering issues in docs. Refactor to use colspan to provide table cells which can vary in width and indentation; the outermost has the greatest colspan, and each nested key has a colspan of one less than the parent, with padding cells for indentation.
Apply styling to table cells to get the table height to work without hacks or browser-specific
styling. Simplify the markup and CSS by removing extra divs. Use two passes over the options, return values, and return facts in the Jinja2 module-docs template: one to determine the maximum nesting depth to compute the maximum colspan needed, plus one to lay out the rows.
(cherry picked from commit fa5c0282a4)
* Use _remote_is_local=True for local connection in synchronize (#40833)
* All instances of local connection should use _remote_is_local=True. Fixes#40551
* Switch to instance attribute for synchronize
* Add test that shows that synchronize _remote_is_local addresses tmpdir building
(cherry picked from commit ad7ba91f75)
* Add changelog entry for #40833
* fix become_method 'doas' support by properly specifying becomecmd
a repatch of https://github.com/ansible/ansible/pull/13451/ which was never committed to 'devel' branch.
* fix play_context test for become_method doas to match new becomecmd
(cherry picked from commit be3670f528)
* Fix failing aws_ses_identity integration tests (#39560)
* Fix failing aws_ses_identity integration tests
Reduce boilerplate with yaml anchor
* remove unstable test alias
* Update feedback forwarding check to use desired state rather than
repeated API calls.
(cherry picked from commit 571c183f59)
* changelog
* Fix legacy Nexus 3k integration test and module issues. (#40322)
* Add setup ignore_errors for nxos_config test
* Fix parse_fan_info for n3k
* Skip bidir tests for N3k
* Omit vni config for n3k
* Skip unsupported nxos_vrf_af test on N3K
* Add legacy N3K platform tag
(cherry picked from commit 63e16431b7)
* Skip N35 and N3L platforms for nxos_evpn_global test (#40333)
(cherry picked from commit ad69ef88e7)
* add normalize_interface in module_utils and fix nxos_l3_interface module (#40598)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 0b7932db30)
* nxos_interface: Disable switchport for loopback/svi (#40314)
* nxos_interface: Disable switchport for loopback/svi
* Replace interface_type with get_interface_type(name)
(cherry picked from commit d04a989bd2)
* fixes bug with matching nxos prompts (#40655)
This change addresses an issue where the prompt matching regular
expressions would not match a prompt if the hostname starts with a
numeric value. Before this change, the connection would fail with a
socket.timeout() error. This change updates the termnal_stdout_re
values to now check for a number.
See Github issue #38639
(cherry picked from commit d829ff6993)
* fix nxos_vrf and migrate get_interface_type to module_utils (#40825)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit b4baa2d484)
* nxos_vlan fix
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* changelog nxos bugfixes 2.5.4
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* Update jenkins_plugin.py
When setting state=latest, plugin are always updated because old sha1 is bytes and and is compared to new sha1 which is str (so it always detecting a sha1 change)
* Add changelog
* Ios test fixes (#40503)
* Return messages generated from edit_config to module
* This does not seem to work that way
* Change test IP addresses to not conflict with device config
(cherry picked from commit eb818df1ec)
* Search all assigned ipv6 addresses instead of just the first (#40533)
* Search all assigned ipv6 addresses instead of just the first
* Add test for idempotency with multiple ipv6 addresses assigned
(cherry picked from commit e8d02a3a0f)
* Fix ios test pt. 2 (#40628)
* Add missing idempotence assert
* Remove dhcp with other addresses on ipv6
(cherry picked from commit f88412b7cd)
Change the command to get the interface in a vlan "show vlan" => "show vlan brief"
Change the parsing of the return command of the switch.
The return of the ios command is fixed so i cut with fix number of carracter.
Adding looking for the next line to add the forgeted interfaces.
(cherry picked from commit 3903ca5)
Co-authored-by: pierremahot <pierre.mahot@orange.fr>
* winrm: add better exception handling for krb5 auth with pexpect
* Added changelog fragment
* Added exception handler in case kinit path isn't valid, added test cases
* fixed for Python 2 compatibility
(cherry picked from commit 5e28e282a5)
* Get the str value of xmlrpc.client.DateTime
* get_all_records should be used instead of get_all
* Facts returned with 'ansible_facts'
* Remove some redundant code
* Add cheese as maintainer
* Add changelog entry
(cherry picked from commit d45b044992)
* Ios test fixes (#40503)
* Return messages generated from edit_config to module
* This does not seem to work that way
* Change test IP addresses to not conflict with device config
* Add test for idempotency with multiple ipv6 addresses assigned
* Do not join flag parameters
This put a comma between every character of the tcp flag parameters, resulting in a bad iptables command.
Fixes#36490
* Use suboptions to ensure tcp_flags options are lists
* Add unit tests for tcp_flags
* Add example of how to use tcp_flags
(cherry picked from commit c9d3bb59a4)
With python 3.6 spwd.getspnam returns PermissionError instead of
KeyError if user does not have privileges
(cherry picked from commit 0023b1ee9eca1286493c56ce5e1aa1b2272c3e39)
* winrm: source user from options than remote_user (#40467)
* winrm: source user from options than remote_user
* fixed up mock for kerberos import
* Added changelog fragment
* get hostname from option as well
(cherry picked from commit 1ac180c74d)
* Also removed uneeded method that wasn't backported
* Don't rewrite remote paths when remote is secretly local
* Remote overriding is configurable in connection
* Use c.DEFAULT_LOCAL_TMP instead of remote_tmp
* Remove remote_is_local from ConnectionBase
* remote_is_local->_remote_is_local
* Add warning signs to _remote_is_local and explanatory comments to its use
* Add fallback check for IAM role temp creds (#40240)
* Add fallback check for IAM role temp creds
(cherry picked from commit d5a5e37fcf)
* changelog
* Fix changelog
* Fix fix changelog
* ec2_vpc_route_table: Update matching_count parsing on find_subnets function and tests
* ec2_vpc_route_table: Update matching_count parsing on find_subnets function
(cherry picked from commit 1905a6e8fb)
* Fixing lack of failure when uploaded source is invalid (#37461)
Checking the response status for 400 and throwing exception.
Unit tests updated.
Fixes#37406
(cherry picked from commit 5e990301bb)
* changelog
on networktocode slack there was a user that wanted an example of how to add a switch vlan interface. This will work and was tested on a 3850 cisco ios switch
(cherry picked from commit 0dc73e7822)
* Changing Lenovo Inc to Lenovo and update License file to be consistent.
* Editing cli commands to expanded form. Changing username and password fields as per Ansible standards.
(cherry picked from commit f60731e27e)
Previously the test framework (DCI, Zuul) were installing the various
dependencies, this meant the list of what was required was duplicated.
Having everything defined in ansible-test makes it easier for people to
run tests locally.
Also this allows the test to work correctly on Python 2 & Python 3
(cherry picked from commit 27942d937f)
* Add check to skip lldp neighbors if lldp doesn't exist or isn't enabled.
* Re-enable check_rc on ios' run_commands
(cherry picked from commit 39bed45baf)
* [aws_s3] Fix uploading src option on the target machine to a bucket (#39023)
* Fix backward compatibility for uploading src option on the target machine to a bucket
* Allow the module to handle errors for nonexistent files
(cherry picked from commit b8a93c12e2)
* changelog
* Fix nested noop block padding in dynamic includes (#38814)
* Fix nested noop block padding in dynamic includes
* Address issues from the review
* Fix typo
(cherry picked from commit 5dd8977cfa)
* Add changelog/fragment for 38814
* [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975)
* Stabilize ec2_vpc_route_table
Wait for route table to be present before attempting to use it
Sleep before getting the final state of the route table in case modifications are incomplete
* Conditionally wait if changes were made
* Simplify logic
(cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef)
* Route custom waiter (#36922)
This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet.
The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code.
(cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237)
* Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356)
(cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629)
* [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes#36083 (#37534)
* stabilize ec2_vpc_subnet module
* Add waiters for ec2_vpc_subnet
Clean up integration tests
* Reenable CI for stabilized ec2_vpc_subnet tests
* rename waiters
* Use module_json_aws where applicable
Handle WaiterError first if waiting failed
* Fix traceback when tagging with keys/values that look like booleans
* Fix check mode with tags
* Add integration tests for tags that look like booleans and check mode
* Add waiter for deleting subnet
* Sleep a few seconds after using aws command line
(cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269)
* Fix sporadic errors in ec2_vpc_subnet integration tests (#38473)
(cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac)
* [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171)
Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter
(cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c)
* [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960)
(cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e)
* changelog
* Exit admin mode properly on iosxr_config (#39594)
Fixes#38811
When using 'admin' in iosxr-config, we need to pass an end
to config terminal session but also pass exit so we exit admin
mode.
(cherry picked from commit 56c5567912)
* Add bugfix fragment
* Fixes to improve ios_system idempotency (#38303)
Added detection of additional formatting for domain_name, domain_search,
lookup_source, and lookup_enabled on some software versions. In each
case they failed to detect existing commands with a '-' in it.
Fix: #38301
(cherry picked from commit 67acffb5f2)
* Nxos fixes (#40117)
* Alter nxos_nxapi tests to test the right thing
* Defend #40027
(cherry picked from commit f04c876ecd)
If a file disappears when you are removing it, this will ensure it
doesn't fail and continues as expected.
(cherry picked from commit 6a08b16c37)
Add changelog for file removal race
(cherry picked from commit 7c9122a89d)
<!--- Your description here -->
Edit to the notepadplusplus example.
Removed `.install` as per chocolatey documentation, the package is just notepadplusplus.
docs found here: https://chocolatey.org/packages/notepadplusplus
+label: docsite_pr
(cherry picked from commit 7d221c4663)
* "route" has to be the first option in ufw command (#31756)
For supporting deletion of ufw routes, route option has to be placed before delete option
(cherry picked from commit 21004d86f9)
* Changelog
* nios lookup errors out when there are no results #37970 (#39027)
* Update nios.py
* Update nios.py
* Update nios.py
* nios lookup errors out when there are no results #37970 Open
Indentation failure issue resolved
* Returning empty list instead of None
In case of no results, res will be returned as an empty list instead of None (implementing ganeshrn comment)
(cherry picked from commit fd50248463)
* Adding changelog mesage for nios lookup error
* [cloud] ec2_asg: wait for the lifecycle hooks - Fixes#37281 (#37282)
Wait for the lifecycle hooks by matching states `Terminating:Wait` and `Terminating:Proceed` in addition to `Terminating`.
(cherry picked from commit ffd1200948)
* Add changelog fragment
- Works with the --remote option.
- Can be disabled with the --disable-httptester option.
- Change image with the --httptester option.
- Only load and run httptester for targets that require it.
(cherry picked from commit c1f9efabf4)
Issue : NameError: global name ‘cnos_devicerules’ is not defined. while running cnos modules.
Device Rule file validates the range and type of data going into each CLI based on device type it is executed against.
This has to be backported to 2.5
(cherry picked from commit 3c32b483bc)
<!--- Your description here -->
Typo in the example of `domain_search`, was `domain-search`should be `domain_search`
+label: docsite_pr
(cherry picked from commit 75304bd121)
<!--- Your description here -->
The examples were apparently pasted from panos_object and the module name wasn't updated.
+label: docsite_pr
(cherry picked from commit 5f0e6b2dc3)
* Only change expiration date if it is different
Modify user_info() method to also return the password expiration.
Compare current and desired expiration times and only change if they are different.
* Improve formatting on user tests
* Add integration test for expiration
* Add changelog fragment
* Improve integration test
Skip macOS and use getent module for validating expiration date.
* Fix expiration change for FreeBSD
* Don't use datetime since the total_seconds method isn't available on CentOS 6
* Use better name for expiration index field
Use separate tasks for verifying expiration date on BSD
* Use calendar.timegm() rather than time.mktime()
calendar.timegm() is the inverse of time.gmtime() and returns a timestamp in UTC not localtime
Add tests that change the system timezone away from UTC
* Mark tests as destructive and use test for change status
* Fix account expiration for FreeBSD
Use DATE_FORMAT when setting expiration date on FreeBSD. Previously the argument passed to -e was an integer of days since epoch when the account will expire which was inserted directly into master.passwd. This value is interpreted as seconds since epoch by the system, meaning the account expiration was actually set to a few hours past epoch.
Greatly simply comparing desired and current expiration time by using the first three values of the struct_time tuple rather than doing a whole bunch of manipulations of the seconds since epoch.
(cherry picked from commit 5a6bdef76b)
debian:9
`apt-get install python-apt` - this will install python2.7 and python3
After this operation, *88.4 MB* of additional disk space will be used.
`apt-get install --no-install-recommends python-apt` - only python2.7
After this operation, *35.0 MB* of additional disk space will be used.
(cherry picked from commit c542e62)
(cherry picked from commit 58261a42e9)
* Remove provider (and transport, where applicable) from consideration
* Add tests that misplaced transport does not fail task
(cherry picked from commit c6270e15a6)
* show version brief does not work on iosxr virtual (#37609)
* show version brief does not work on iosxr virtual
* ci failures fix
(cherry picked from commit 66b389a00d)
* changelog entry
* Handling of configurations blocks with end-* at the end of the block (#39673)
* handle end-policy issue
* revert changes in iosxr cliconf
* fix trailing parents not included in difference
* Moving fix to platform specific fix
* pep 8 issues
(cherry picked from commit ef577b71cc)
* changelog entry
If default option is eanbled fetch the current
running configuration by adding `all` or `full`
flag
(cherry picked from commit 09e3b5c92b)
Update Changelog
* document our deprecation (#37788)
* document our deprecation
fixes#37779
* Copy edit.
(cherry picked from commit 8b45cab3c1)
* Update docs and version definitions for the 2.4.4 and 2.5.0 releases
(cherry picked from commit 73c80862c8)
* Fix 2.5 changelog link
(cherry picked from commit 4165bb308b)
* Update vars for loop_control on each loop iteration (fixes#38899) (#39818)
(cherry picked from commit 01e8139d74)
* Changelog snippet for cherry-pick of #39818
* facts: Detecting NVME partitions under Linux (#39730)
In the current state of the code, the nvme partitions are returned as empty as in :
"ansible_devices": {
"nvme0n1": {
"model": "SAMSUNG MZVLW256HEHP-000L7",
"partitions": {},
The parsing of the /sys/block/<diskname> try to find a disk named like :
<diskname><x> as in sda1 for sda
But in the nvme context, the partition of nvme0n1 is named nvme0n1p1.
This add a possible 'p' between the diskname and the partname.
This patch simply add the option of having a 'p' between the diskname
and the partname.
The patch works on my host :
"model": "INTEL SSDPEDMD400G4",
"partitions": {
"nvme0n1p1": {
...
"size": "93.13 GB",
}
Fixes#38742
Signed-off-by: Erwan Velu <erwan@redhat.com>
(cherry picked from commit 2214c747a2)
* Use a more exact regex (#39811)
The pattern we're matching can have zero or one p. Be more careful to
match exactly that.
Slight revision of #39730
(cherry picked from commit 75283983f6)
* Make sure that the implicit async_status gets the env from a task with async. Fixes#39699 (#39764)
(cherry picked from commit 3b496db4d8)
* Add changelog for #39764
`network['vlan']` should be a VLAN ID
Integers passed around using jinja variable references are
converted to strings (see # 9362)
The # 32738 PR should allow using 'NativeType' in ansible
Explicitly converting to integer will make the module works
as expected with or without the NativeType support
`network['vlan']` can also be a VLAN NAME (fallback)
Explicitly converting to string will make the module works
as expected with or without the NativeType support
Signed-off-by: Matthieu Fronton <m@tthieu.fr>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit a0b4462aea)
* Fixes 30786 - add server response to the failure
(cherry picked from commit 0ac885f1c7546caa5b9178b142f490d211167f5a)
* replace str(e) with to_native(e) according to code review
(cherry picked from commit e2e3bf6b9ae44d565baeaa7d7d1ab853888d8c7a)
* add changelogs/fragments
* Fix eos_vlan associated interface check
Fix eos_vlan associated interface check by comparing
the interface in want and have without converting the
interface name to lower
* Update eos_vlan docs
* Update changelog
(cherry picked from commit afdc2364f2)
Fix ios integration test failures in CI. Since the packet transfer and receive rate
on the interface is not determined to remove the tx_rate and rx_rate test conditions
to prevent intermittent failure.
(cherry picked from commit 4c5ac16447)
There was a traceback when setting permissions on a directory tree when
there were broken symlinks inside of the tree and follow=true. chmod -R
ignores broken symlinks inside of the tree so we've fixed the file
module to do the same.
Fixes#39456
(cherry picked from commit 6b159fdb03)
* Fix for file module with symlinks to nonexistent target
When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.
Fixes#39558
(cherry picked from commit 4f664f8ff6)
* vyos_interface require multiple network nodes to run
We don't have the ability to run these currently, so disable them.
The original logic was also incorrect, the tests don't pass on lab, DCI
nor single instance nodepool, so disable
https://github.com/ansible/ansible/issues/39667 tracks getting these
enabled again
* eth0 -> Gi0/0
* Correctly detect if we should run lldp
* Correctly detect if we should run lldp
(cherry picked from commit 923a81e9e5)
* removed additional check for name parameter
(cherry picked from commit 91357d07f4f9eb3714f582c1959ff54d25129500)
* Added empty default
Fix for issue https://github.com/ansible/ansible/issues/38482
(cherry picked from commit 60a32771039c190a7e9f6e0eb4d0f6bf4c356fd4)
* [ec2_ami] Ensure name or image_id is provided for state=present (#38972)
Add integration tests for backward compatibility and ensuring name or image_id is provided
(cherry picked from commit e2aa1155ba)
Fixes#27262
(cherry picked from commit 81b2529159)
Add tests for template with non-ascii filenames
This is a test in response to #27262 but I could not provoke the error
so it only shows that the current code is working with non-ascii
filenames in this case. It doesn't show whether there's some other bug
somewhere.
(cherry picked from commit f91d961cb4)
* ensure 'home' translations
* removed slash as it created issues on diff plats
(cherry picked from commit cc1c7c63db)
* fixed bug introduced by orig commit, this should only affect single ~ paths
Also use a lock file per host, rather than one global file lock.
Commit 9c0275a879 introduced a bug where the lock file was only being
unlocked by the child PID of the resulting fork done in ansible-connection.
This causes delays when a large inventory causes a lot of contention on
that global lock. This patch fixes the problem by ensuring the lock is
released regardless of the fork condition, and also to use a lock file
based on the remote address of the target host, removing the global lock
bottleneck.
Fixes#38892
(cherry picked from commit 7ce9968ce1)
Currently, the module fail with a error saying that --acme-dir is mandatory.
Looking at the commandline:
/usr/sbin/acme-tiny --chain --account-key /srv/letsencrypt/acme_key/acme.key
--csr /srv/letsencrypt/nginx_certs/www.example.org.csr--acme-dir /srv/letsencrypt/webroot",
We can see that the space before --acme-dir is missing.
* Fix ios and iosxr terminal prompt regex (#39063)
Fixes#38732
Make matching leading newline for cli prompt
optional as there are cases when returned repsonse
for ios/iosx remote host doesn't have newline before
cli prompt.
(cherry picked from commit eebfa66c2b)
* Adding changelog for ios and iosxr terminal prompt fix
avoids some repetitive loading
- read config file only once
- now cache the ini parser per file
- optimize shell plugin loading
tried to 'optimize' vars_plugins loading but it creates issues with precedence,
probalby due to iterator not being reset, will look into it in subsequent fix/PR
(cherry picked from commit 42912e1ac8)
* ignore version when deciding callback loading
The code already defaulted to load the callback if the properties are not present
there was no need for us to also check the version
fixes#38270
* fix error msg on set optoins to use correct name
(cherry picked from commit 1850bb752f)
Updated GitHub Repos section to better explain what ansible-network@redhat.com is for (not an email list, but adding to the network-automation github repo.
(cherry picked from commit 9773157da6)
Under a non-utf-8 locale (for instance, LC_ALL=C), passing a non-ascii
filename to many APIs will traceback. Fix that by explicitly converting
to byte strings before passing to external APIs.
May fix#27262
(cherry picked from commit 2976b653ce)
Add a changelog for filename encoding in template action fix
(cherry picked from commit d90c36e320)
* [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock
Add module warnings rather than silently skipping
* Permit warnings for routes tables containing vpc endpoints to be turned off
* Add tests to ensure a VPC endpoint associated with a route table does not result in a traceback
(cherry picked from commit da3f7a8db1)
* should not need <>, but fails without
* adds anchor to keywords page, uses it on plugins pages
* fixes envvar link errors
* harmonize file name and ref name as python_3
(cherry picked from commit c8a9b411bc)
Don't round the parameter 12.04 in the explanatory paragraph unless `version()` rounds the parameter
(cherry picked from commit 5cf544e03e5f833e1614fa940849976550d55448)
(cherry picked from commit 56967497d5)
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)
Fixes#29818
(cherry picked from commit e7db3c0eba)
* win_file: Handle [] in paths, fix touch in check mode (#37901)
* win_file: Handle [] in paths, fix touch in check mode
* Fixed typo for p/invoke command
(cherry picked from commit 4b57fa91d0)
* Added changelog fragment for win_file special char fix
(cherry picked from commit 61bcf4740f)
* ovirt_disks: Fix fail condition for LUN disk
Fixes: https://github.com/ansible/ansible/issues/38661
* ovirt_host_networks: Fix removing of network attachments
* ovirt: Support removing unmanaged networks
* ovirt: FCP storage domains don't have to have target
Exceptions need to use native strings. We need to make sure we're
combining native strings with native strings.
(cherry picked from commit 0b643009db)
Add changelog entry for winrm encoding fix
(cherry picked from commit a5e33969b1)
Node port field is not populated on K8S pods, and it's certainely the most useful port to use in pod when we need to interact with ansible outside of the cluster
* Ansible.ModuleUtils.FileUtil - Add ability to test non file system provider paths (#39200)
(cherry picked from commit b6afe6946d)
* Added changelog fragment
* fixes links on plugins pages
* fixes links in community pages
* fixes links in user guide
* adds anchors on playbooks pages
(cherry picked from commit 408e29cbd2)
Fixes#38732
Make matching leading newline for cli prompt
optional as there are cases when returned repsonse
for ios/iosx remote host doesn't have newline before
cli prompt.
(cherry picked from commit eebfa66c2b)
* Attempt 4: Prevent reparenting a block with itself (#38747)
* More concisely reparent, ensuring we don't go too shallow or too deep in this process. Fixes#38357
* More explicit reparenting, with a short circuit for a common case
* We need new_block to have a parent, otherwise we lose context with this approach
* Remove duplicate parent assignment
* Change callers of Block.copy to not use exclude_parent=True, when including the parent, exclude tasks
(cherry picked from commit f474195a3b)
* Add changelog for #38747
* Skip self._parent on dynamic, defer to grandparent for attr lookup (#38827)
* Skip self._parent on dynamic, defer to grandparent for attr lookup
* Revert _inheritable
* Add tests for include inheritance from static blocks
Fixes#38037#36194
(cherry picked from commit 354aa8d602)
* Add changelog for #38827
* Consider parent also when comparing IncludedFile (#37083)
* Consider parent also when comparing IncludedFile
* Add new tests for IncludedFile and convert to pytest
(cherry picked from commit cdb79b0e3a)
* Add changelog for #37083
* Error if docker and docker-py are simultaneously (#38884)
* Error if docker and docker-py are simultaneously installed over top of each other. Fixes#36125
* Remove duplicate installed
(cherry picked from commit 68e3ff80a7)
* Add changelog for #36470
If recursive is set to yes, the module changes the attributes of the directory recursively even though state: directory is not set.
(cherry picked from commit 785c660432)
* File module: correct description of "state"
It was probably intended to say "intermediate subdirectories will be created" and not "immediate subdirectories will be created".
(cherry picked from commit a81c6668eb)
* Update the documentation to list Python 3 as official
* Add some reference targets for inventory variables so we can link to docs
* Add a platform FAQ section
Populate it with
* virtualenv info (previously on the python3 support page)
* BSD (Link to the working with BSD page)
* Solaris (Document how to work around the non-POSIX shell on some
Solaris hosts)
Fixes#21594
* Fix some refs in the release_and_maintenance document
* Fix unindent error in module template
Fix for the module/plugin template unintentionally unindented inside of
a raw block, leading to errors like:
ERROR: docs/docsite/rst/modules/redshift_facts_module.rst:289:0: Explicit markup ends without a blank line; unexpected unindent.
* Make wording for Solaris troubleshooting better.
(cherry picked from commit a08459a814)
Fixes#36063, fixes#37323, fixes#36078 (#37354)
* Add AWSRetry when describing VPCs to help stabilize integration tests
* Add retry on create_tags because it is possible to reach this API call before the VPC is finished creating
* Increase delay and tries for ec2_vpc_net backoff
* Wait for DHCP option to be created in ec2_vpc_dhcp_option
* Wait for all modifications to the VPC
* Use the vpc_available waiter because is uses Filters
* Optimize retries to only occur if the functionality is available
Cherry-from:
- 16f8a993a0
- e9c57e732f
The docs suggest that `port` parameter is the default port upon
which targets listen. As such, a target need only provide a `Port`
key to override the default.
(cherry picked from commit dc09ddfbd5)
As per docs, the current set of values is
```
'SSLv3'|'TLSv1'|'TLSv1_2016'|'TLSv1.1_2016'|'TLSv1.2_2018'
```
Fixes#38642
(cherry picked from commit 6b970348b1)
* Clean up Grafana docs a bit
But more is needed, default values, missing choices, proper
descriptions, actual sentences :-)
* Remove validate-modules entries
(cherry picked from commit 51662acc6c)
The example regarding `include_*` is a bit unclear. First it seems like the v2.4 and v2.5 examples are the same. So I attempted to make the relevant change in the examples more obvious.
label: docsite_pr
(cherry picked from commit 55fd3d62fb)
The big one is that we needed to set plugin_type when we processed the by_support template.
Also added to list_of_CATEGORY_plugins page (which might not be used)
and corrected a place where I did module_name instead of name_module
(cherry picked from commit 8cdd75a09f)
* docs: Document disabling diff on task level
Tasks that deal with secrets may leak sensitive information when
running in Check Mode. This change updates the documentation explaining
that the diff can be deactivated on task level.
The feature was requested in #14860 and got introduced in Ansible 2.4
with #28581.
* Updated for clarity
(cherry picked from commit 9cca9a9c10)
* module_common: set required parameter templar
Fix the following error (related to b455901):
$ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python
Traceback (most recent call last):
File "./hacking/test-module", line 268, in <module>
main()
File "./hacking/test-module", line 249, in main
(modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename)
File "./hacking/test-module", line 152, in boilerplate_module
task_vars=task_vars
File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module
environment=environment)
File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils
shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar)
File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang
interpreter = templar.template(task_vars[interpreter_config].strip())
AttributeError: 'NoneType' object has no attribute 'template'
* module_common.modify_module: templar is required
(cherry picked from commit 7908f78fa6)
When the URI module returns complex JSON objects, the YAML callback
fails while trying to represent these objects. The problem arises
because the filter method returns an iterator in Python 3, rather than a
str object. Therefore, the str method expandtabs() is not available,
and the callback fails with the following error:
[WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible.plugins.callback.yaml.CallbackModule object at 0x7f7c7ed8aa20>): 'filter' object has no attribute 'expandtabs'
Issue can be replicated by running this playbook:
- hosts: localhost
gather_facts: false
tasks:
- uri:
url: https://jsonplaceholder.typicode.com/posts
ansible-playbook tmp.yml -v
(cherry picked from commit 5839f07e0f)
* fix inventory plugin source caching
- avoid caching invetnory sources in loader in base
- same fix for yaml plugin
- idem for 'auto' plugin
fixes#37162
* fix mock dataloader func sig
(cherry picked from commit 886c4edfb9)
* Set `raw=True` when reading passwords from ConfigParser files.
The assumption is that no one is actually doing interpolation on the
password value, even if they may for other configuration values, and
passwords are far more likely to contain '%'.
* Add vmware_inventory as well.
(cherry picked from commit 15b6ec66bb)
This offers an optimization that allows loading larger
inventories of various structure by improving the
scaling laws involved for adding hosts and groups.
The primary speed benefit is the elimination of duplicate
recusion from traversing converging paths.
(cherry picked from commit 153c9bd539)
* made missing cli tools non fatal
* remove bare exceptions
these shoudl not be there as they can prevent 'wanted' exits
(cherry picked from commit 0c2e7fd841)
The :ref: syntax is for linking to targets which are defined for the
whole document tree. `link`_ is for linking to targets which are inside
of the document. We want the latter for deprecated sections because
otherwise we'd have to create namespaced link targets for them.
Also fix expansion of version a deprecated module will be removed in
(cherry picked from commit 25523666ce)
* Tolerate win line endings on windows module_util load (#37291)
* tolerate windows line endings when loading windows module utils. Helpful for old custom windows modules.
* add test modules to demonstrate win line ending module load behaviour.
* attempt to fix sanity check failures
* pep8 fix
* explict skip of test modules from shebang check (core modules must still have expected unix style line endings)
* switch to rstrip() following core team meeting feedback
(cherry picked from commit ad94d03ba1)
* Added changelog fragment
* Added ignore rules to older sanity tests
* Removed test files due to old shebang not being possible without bigger change
* Update win_certificate_store.py
Improvements to describe the different destination stores.
+label: docsite_pr
* Update win_certificate_store.py
Whole line needs to be quoted -- lingfish YAML fail.
(cherry picked from commit d684c51815)
This fix adds exception handling which is raised when user
does not have correct set of permissions/privileges to read virtual machine
facts especially host system configuration.
Fixes: #37056
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit efc3f4f824)
This fixes documentation related to datacenter in vmware_guest_find
module.
Fixes: #38290
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 2367130ba3)
* Add supported connection in junos module documentation
Add supported connection type in junos module doucmentation.
* adds link to platform docs
* makes recommended connection a code snippet
* does this fix banner and command?
* does this fix the rest of the errors?
(cherry picked from commit 67d561b0c8)
* centralize doc/config plugin lists
also update list for generation in docsite
added note to ensure they are in sync
* updated shell page to list plugins
added some more docs hinting at plugins being configurable
* fix edit link for plugins
(cherry picked from commit bdbb89378f)
If user does not specify any network type then set network type
to dhcp. There are additional checks around 'ip', 'netmask' and
'type' in network spec.
Fixes: #38466
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 9b139baacb)
There was discrepancy between documentation and actual code.
Fixes: #38671
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit f1cd254265)
If format is passed as None to get_config api, wrong command is
genereted ie. `show running-configuration | None | section interface`.
Add format type in command only if format value is either not `text`
or `None`.
(cherry picked from commit 88662d0c56)
Update changelog
* Add troubleshooting URL for persistent socket path related issue
socket path timeout related error messages are not displayed on the
console as the ansible-connection process does not have access to it.
Until this is fixed need to point to troubleshooting URL so that
users can take corrective actions.
* Fix CI issue
* Update changelog fragments
(cherry picked from commit 53d3e7e306)
* restore showing stderr on script success
accidentally removed during transition to plugin, with toggle for those
who prefer the quiet way
fixes#33776
* stderr display if no other errors capture first
* fixed issue with error encoding
(cherry picked from commit eef70d028f)
* Convert README from Markdown to ReStructured Text and use as longdesc
Discussion in #13758 led to deciding to switch README to rst and having
setup.py consume it as the long_description.
* Fix long string in setup.py for pep8 compliance
* Open README.rst as read-only
* Update usages of root README.md to README.rst
Unsure about the file ./packaging/debian/docs as it (only) contains the
text README.md. I believe it's referencing ./packaging/debian/README.md
but maybe someone who knows debian packaging could review it?
* Pick up fixes that had been merged into README.md after the initial conversion to rst
(cherry picked from commit 7afa34ae8a)
junos_netconf works only with connection=network_cli
Add check to report appropriate error if any other
connection type is used.
(cherry picked from commit 16c2d3717e)
Update Changelog fragments
* consul_kv: decodes kv values from Consul to utf-8 (#35894)
* Decodes kv values from Consul to utf-8.
* Switches to using module utils to perform text decoding.
* Adds self to authors list to help community maintenance.
(cherry picked from commit a4a2b4a381)
* Add a changelog fragment for consul_kv python3 fix
* eos_vlan: Modified logic to allow for more than 6 interfaces to be assigned to … (#35568)
* Modified logic to allow for more than 6 interfaces to be assigned to a vlan
* arista output to json. removing logic for string size.
(cherry picked from commit 99627ab99d)
* Add changelog fragment
* winrm: added flag handler for kinit to request forwardable ticket when delegation is set (#37815)
(cherry picked from commit 22f2388ef1)
* Added changelog fragment
* fix for when status codes are provided as a comma separated list (#38080)
* fix for when status codes are provided as an array of strings
* convert status codes to int, additional tests
(cherry picked from commit c38617a736)
* Added changelog fragment
* Fix 'New Vault password' on vault 'edit'
ffe0ddea96 introduce a
change on 'ansible-vault edit' that tried to check
for --encrypt-vault-id in that mode. But '--encrypt-vault-id'
is not intended for 'edit' since the 'edit' should always
reuse the vault secret that was used to decrypt the text.
Change cli to not check for --encrypt-vault-id on 'edit'.
VaultLib.decrypt_and_get_vault_id() was change to return
the vault secret used to decrypt (in addition to vault_id
and the plaintext).
VaultEditor.edit_file() will now use 'vault_secret_used'
as returned from decrypt_and_get_vault_id() so that
an edited file always gets reencrypted with the same
secret, regardless of any vault id configuration or
cli options.
Fixes#35834
(cherry picked from commit 6e737c8cb6)
* ovirt_host_networks: Fix idempotency
* ovirt_hosts: Fix failed_state after PM fence
* ovirt_host_networks: Fix of bond assignment (#38054)
* ovirt_host_networks: Fix of bond assignment
* ovirt_host_networks: Fix bond modes
* ovirt_host_networks: Fix incorrect prefix documentation
* ovrit_cluster: fix for CPU arch entity #37425 (#37436)
* ovrit_cluster: fix for CPU arch entity #37425
* Corrected Indentation
* Condition to check if `architecture` is defined
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step
Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:
time ansible-playbook foo.yml 1>/dev/null
real 0m12.614s
user 0m10.880s
sys 0m0.683s
After this patch:
time ansible-playbook foo.yml 1>/dev/null
real 0m4.193s
user 0m2.560s
sys 0m0.575s
see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 5234b78b5f)
* fix typo (#38131)
(cherry picked from commit 1c00a14c31)
* add changelog fragment for 38131 backport to 2.5
Signed-off-by: Adam Miller <admiller@redhat.com>
* Fixes#37700 Azure image can be created with tag (#37981)
* image can be create or add
* update tags
* can remove all tags
* Update azure_rm_common.py
For connection=local check only if the transport value in
provider is cli and the respective module support cli
transport. If not report back appropriate error message.
(cherry picked from commit e10e0d42d8)
* openssl_certificate: Handle dump() in check_mode (#38386)
Currently, when ones run the module in check_mode it tries to retrieve
values from the actual certificate generated in the generate() function.
Since in check_mode we call dump() without calling generate(), self.cert
is None, leading to self.cert.get_notBefore(), self.cert.get_notAfter()
and self.cert.get_serial_number() raising an error.
> NoneType' object has no attribute 'get_notBefore'
The solution is to have two way to handle dump() method, whether its run
in check_mode=True or check_mode=False leading to different way the
information is retrieved.
(cherry picked from commit 99497ce54c)
Since the note was about 2.0 versus 1.x, this has been removed. The
file implementing it is gone so we need to stop referencing it.
(cherry picked from commit f1b63f435e)
* added eos_smoke tests
* removed left over file
* added note to uncomment broken eapi test when #36919 is fixed
* uncommented fixed test, added unbecome test
* skip become tests when connection=local
(cherry picked from commit 712d30f46c)
* Eos :do not push config to device if check_mode is enabled (#37287)
* eos can not check config without config session support
* add testcase for check_mode without config session
* fix eos eapi to read use_session env var
(cherry picked from commit a1026dbce5)
* Backport/2.5/37287 - Eos do not push config is check_mode is enabled
* fixes issue when netconf would report ios is not supported
This change now will map ansible_network_os=ios to the correct netconf
plugin implementation. This will resolve an error where the netconf
connection plugin will report that ios is unsupported.
(cherry picked from commit 91a748e33b)
* Close & remove paramiko connection where appropriate (#37528)
* Update unit test
(cherry picked from commit 594840c1d6)
* Put back $PATH checking in ansible-connection call (#37933)
(cherry picked from commit 169209c32a)
`get_options` is an undefined method from CallbackBase
As a result, remove the trailing `s` letter.
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
* ISSUE-37945 output not populated on failure
This always includes output, but it is empty on failure.
* handle the other failcases as well
(cherry picked from commit 509f52a8ed)
* demonstrates best practices for group vars
* removes vm-specific var from example
* adds brackets to all [group:vars] refs
(cherry picked from commit 380c074808)
* issue:38167 add support for onyx version 3.6.6000 for onyx_linkagg (#38191)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
(cherry picked from commit 72d42bd065)
* fragment
* issue:37307 Add support for changes in pfc output in onyx 3.6.6000 (#37651)
* issue:37307 Add support for changes in pfc output in onyx 3.6.6000
Signed-off-by: Samer Deeb <samerd@mellanox.com>
(cherry picked from commit 9dfb665e43)
* fragment
* issue:37306 Fix issue with vlan support for onyx version 3.6.6000
Signed-off-by: Samer Deeb <samerd@mellanox.com>
(cherry picked from commit a89bafce2e)
* nso_verify handle leaf-list in 4.5 and identityref (#37393)
NSO verify did not handle leaf-list value verification in 4.5 and
later due to changes made for configuration writing made.
map prefix for identityref types in verification.
(cherry picked from commit 6308047dc9)
* Remove timeout
* Add CDP support for the neighbors option (#37655)
(cherry picked from commit 0f90853f67147d68ad5899407e96a53eed8e4d46)
* Add ios_interface CDP support to changelog
* Add error handling for junos in case wrong connection type
Fixes#37990
If a junos module doesn't support given connection/transport type
return appropriate error message.
* Fix CI issues
* Fix review comment
(cherry picked from commit 3a4fc4af08)
* win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets (#37897)
* win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets
* compare username in lowercase for test
(cherry picked from commit f37a44430f)
* Added changelog fragment
* azure_rm_networkinterface: fixed issue when public ip address should not be created (#36824)
* fixed issue when public ip address should not be created
* adding test for public ip address
* fixed samples
* another fix to sample formatting
* fixed test
* fix test
* fixed test
* another attempt to fix test
* maybe it works now
* still wrong
* improved check per customer request
* removed stupid semicolon
* updated test to match main scenario
* changed ip configurations to list
* another attempt
(cherry picked from commit 89401f13f7)
* Added changelog fragment
include_vars and set_fact are already updating hostvars in strategy
no need to 're add again' with lower priority the same data.
fixes#37535, mostly by avoiding reprocessing and 'cleaning'
(cherry picked from commit 3bec76fc85)
* Fix redundant yaml error blurbs on ModArgs parse errors
Some of the AnsibleParserErrors from parsing.mod_args
are created with the obj=some_yaml_ds options but
some are not.
If they were, we don't want to add another yaml_ds to
it, because that will result in double yaml error blurbs.
And since we dont need to add info, we can just re raise it.
But if there is no ._obj, add it here so we get the extra
detail in the error message (see issue #14790) and raise
a new AnsibleParserError instance.
Fixes#36848
* cleanup existing test_tasks pep8/sanity issues
(cherry picked from commit e166946a0a)
* Compare byte strings to byte strings
* Fix a traceback in ansible-pull on python3 comparing output from
subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
not text strings.
* Use to_text() to transform variable that's being displayed as it's
less fragile than str().
Fixes#36962
(cherry picked from commit b98ad3a12b)
* Add changelog entry for python3 ansible-pull fix
* Fix use of user_data field with spot_price in ec2 module (#37628)
The user_data field is base64 encoded inside of the boto library. In
Python3, base64 must be used with byte strings. So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.
Fixes#34978
(cherry picked from commit 0d55081ba8)
* Python3 ec2 fix added to changelog
* Fix csvfile traceback on Python3 (#37625)
* Fix csvfile traceback on Python3
The csvfile lookup uses some custom iterators. These needed to be
ported to handle the python3 iterator protocol. In addition, the
csvfile module takes an iterator of byte strings in Python2 and an
iterator of text strings in Python3
Fixes#36808
(cherry picked from commit 09325b619e)
* Add changelog entry for csvfile python3 fix
This fix adds environment variables for connection in vmware_*
modules.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 0ae7a0e88c)
* Fix dynamic inventory for vagrant does not work on python3 (#37631)
* Fix dynamic inventory for vagrant does not work on python3 #35129
(cherry picked from commit 1b121fc9e4)
* Add vagrant python3 fix to the changelog
* Fix python3 interpreter issue (#34811) (#35176)
* Fix python3 interpreter issue (#34811)
* Update ansible.module_utils._text (#34811)
* Convert to text later to account for multibyte characters
(cherry picked from commit 340064bfb9)
* Add a changelog fragment for haproxy python3 fix
* continue fact gathering even without dmidecode
If dmidecode is not available we still wan to continue with fact
gathering.
On certain platforms dmidecode just won't work
(cherry picked from commit cbe2915ba5)
Fixes#37911
The generated file was completely unusable by the system
therefore the fix which ensures that diffing the file
prior to changes and after only shows diffs
Furthermore the code did not work for Python 3.6
> f.writelines(to_bytes(lines, errors='surrogate_or_strict'))
E TypeError: a bytes-like object is required, not 'int'
The other modifications (lambda variable renaming) is to
comply with default flake8 rules
(cherry picked from commit 612d0d6634)
Fixes#37208
If check_mode is enabled instead of committing th config need to
discard all the chnages to cnadidate db
In case of cli to discard changes issue `rollback 0` command
and for netconf execute `discard-changes` rpc call
(cherry picked from commit 8eaa9cc938)
Fixes#36979
If `abort` is not issued in the top level session prompt
the existing session goes to pending state.
The fix is to come out of config mode by issuing `end` command
and again to same config session and execute `abort` which
`abort` is issued at the top level session prompt.
(cherry picked from commit 017ea018d0649b8b6f392f9505992f39e99943fa)
SGs created when a VPC ID was not specified would not necessarily
get the default egress rule, even when no explicit egress rules
were set.
Add some checks for egress rules in results from existing tests
(cherry picked from commit 98b29f8ad6)
Fixes#35993 - Changes to update_size in commit eb4cc31 made it so
the group dict passed into update_size was not modified. As a result,
the 'replace' call does not see an updated min_size like it previously
did and doesn't pause to wait for any new instances to spin up. Instead,
it moves straight into terminating old instances. Fix is to add batch_size
to min_size when calling wait_for_new_inst.
Fixes#28087 - Make replace_all_instances and replace_instances behave
exactly the same by setting replace_instances = current list of instances
when replace_all_instances used. Root cause of issue was that without lc_check
terminate_batch will terminate all instances passed to it and after updating
the asg size we were querying the asg again for the list of instances - so terminate batch
saw the list including new ones just spun up.
When creating new asg with replace_all_instances: yes and lc_check: false
the instances that are initially created are then subsequently replaced.
This change makes it so replace only occurs if the asg already existed.
Add integration tests for #28087 and #35993.
(cherry picked from commit a2b3120e85)
* Fix name parameter templating in include_role module (#36372)
An IncludedFile() object built using the original_task will have
its _task bound to the original_task. The iterative reassignment of
original_task._role_name during with_item loops leaves all returned
included_files with the same ._task._role_name (the final name from
the with_items list). This commit builds IncludedFile() objects
from an original_task.copy() to avoid the problematic binding.
(cherry picked from commit 54e70fc783)
* Test include role with items in name #36372 (#37001)
* Tests for #36372
* Tests for #36372
* Tests for #36372
(cherry picked from commit 8c4f349743)
* Add changelog for #36372
This PR includes:
- A fix for multiple-choice defaults
- A fix for messed up dictionary samples
- Cleaner defaults when they don't appear part of choices
(cherry picked from commit 80ba7b7402)
* Connection error messages are unsafe: wrap them (#37329)
* Check that connection error msg are not unsafe
* Connection error messages are unsafe: wrap them
For example, in case of error, docker connection plugin returns exception
message containing Go template. These messages weren't tagged as unsafe
and were consequently rendered:
The conditional check 'result is failed' failed. The error was:
{
'msg': u'Docker version check ([\'/usr/bin/docker\', \'version\', \'--format\', "\'{{.Server.Version}}\'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied\n',
'failed': True
}:
template error while templating string: unexpected '.'.
String: Docker version check (['/usr/bin/docker', 'version', '--format', "'{{.Server.Version}}'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied
(cherry picked from commit 4378542ac7)
* Add a changelog for the no-template error message fix
In Python2, `map` returns list whereas Python3, `map` function
returns iterator. This fix typecast map function for Python3.
Fixes: #37114
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8f3f7f104f)
When commit revisions are disabled, there will be no revision items returned.
Add note about setting ANSIBLE_PERSISTENT_COMMAND_TIMEOUT to a higer value to avoid timeouts.
(cherry picked from commit 3134ba6bee)
* win: handle non string as an environment value (#37215)
* win: handle non string as an environment value
* Changed powershell environment handler to use .net function instead for special chars
(cherry picked from commit 708869edd6)
* Added changelog fragement for powershell environment handler fix
* typo in changelog
* zfs: Fix handling of parameters passed via check_invalid_arguments
cc7a5228 had a typo, so the merged set of arguments was shoved into the
wrong parameter and ignored.
`origin` is an actual module parameter and should be processed like one.
pop()ing makes debug output misleading.
* zfs: fix command generation for `zfs snapshot`
Creating a snapshot and supplying an origin are mutually exclusive,
but were not treated as such. We should throw an error instead of
running an invalid command (`zfs snapshot origin foo@snapname`.)
This fix adds missing argument parameter called 'state'
and its documentation.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 77b903bd85)
* Using correct content type (as per version 10 of ACME draft).
* Another incompatibility with ACME v2: body must be {} and not contain v1 data (Pebble fails otherwise).
(cherry picked from commit 155adb1631)
* PY3 = dnf
Red Hat are unlikely to provide a Python 2 version of the yum bindings
as they are moving to `dnf`.
If Ansible can't find the yum Python library give the user a hint about
dnf and Python 3
(cherry picked from commit 6c8d40f653)
* Fix unarchive with strip-components in extra_opts (#37048)
* Fix unarchive with strip-components in extra_opts
When unarchive is given extra_opts to strip all leading directories, it
could end up trying to change the permissions on the root directory.
Tar archives shouldn't contain absolute paths anyways so make sure that
all paths are relative as we handle them.
Fixes#21397
(cherry picked from commit cca0ccaf97)
* win_uri: return response info on non 200 responses, convert DateTime values to ISO 8601 (#37104)
(cherry picked from commit c1f5e11cdf)
* Added changelog fragment for win_uri return value fix
* win_wait_for: use loopback IP instead of hostname if 127.0.0.1 is used (#36762)
* win_wait_for: use loopback IP instead of hostname if 127.0.0.1 is used
* removed reverse dns lookup in port check
(cherry picked from commit 67ffde4ac1)
* Added changelog for win_wait_for local port fix
* Win lineinfile fix (#35100)
* win_lineinfile: fix#33858. Removed conversion from \r\n
* win_lineinfile: added test for #33858
* win_lineinfile: added documentation and more tests for change
* win_lineinfile: fixed wrong hash in testing
(cherry picked from commit e15a903bdf)
* Added changelog for win_lineinfile fix
* fix typo in changelog
* Network modules to link to network guide
* Make it clear what's deprecated
* enable -> become
* Detail when provider is still needed (eAPI/NX-API)
* Link to specific sections
* rx_rate & tx_rate to link to conditional docs
(cherry picked from commit ebc71bcb16)
older versions of Tower (3.1) don't have a concept of CredentialTypes
(this was introduced in Tower 3.2). This change detects older versions
of pre-3.2 tower-cli that *only* support the deprecated `kind`
attribute.
(cherry picked from commit 641f8b4ef6)
* Remove default admin_distance and fix the idempotence thereof
Fixes#33290
* Fix tests and use yaml anchors to shorten tests
* Add test for undefined admin_distance
* Read config from `show run` if `show ip static route` fails
* Restore flags to ios.get_config & use get_config where appropriate
(cherry picked from commit 7016b3b9ca)
Fixes#36204
* tostring() input string shoulb be in byte string format
* to_ele() input is required in unicode format
(cherry picked from commit 41d75783b5)
As stated by fellow contributors, update the slicing example
Resolves:
Related: #36625
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
(cherry picked from commit 8362ddd107)
False assumption that values can not have cyclic dependencies. Fix by
removing dependency on self and look for cycles, if found remove
dependency to get a partial sort done.
(cherry picked from commit 042c111563)
* Explain what the Ansible Quickstart video does
Rewrote what video does. The video is really not teaching you how to do the work. It explains why you'd want to use Ansible and shows you what it takes (some sample code) . Video also introduces you to other products in the Ansible ecosystem.
(cherry picked from commit de7692b1c9)
This commit fixes up the get_config method to match the minimum method
signature as defined by the base class. Without this patch, the
get_config method calls will fail in some cirumstances.
(cherry picked from commit fb6a8c0133)
Fix issues in ValueBuilder used in nso_config and nso_verify so that it
can handle leaf-list in NSO 4.5 and detect identityref types from
unions.
Fail gracefully if a type is not found.
(cherry picked from commit 2789cc5c09)
* allows ib_spec attrs to be filtered in update
This change will allow the ib_spec entries to be be filtered on a change
object by setting the update keyword to false. The default value for
update is true. When the update keyword is set to false, the keyed
entry will be removed from the update object before it is sent to the
api endpoint.
fixes#36563
* fix up pep8 issues
(cherry picked from commit 93b795baf0)
* Decouple config and state check in {network_os }_vlan and { network_os }_vrf modules
Fixes#35567Fixes#34754
`interfaces` option is used for configuration as well as operational state
check. If interface is configured to given vlan or vrf but if
operational state of interface is disabled it results in module failure.
Fix is to decouple same option usage for config and state.
With this fix `interfaces` is used as config option and a new
option named `associated_interfaces` will be used for intent check
for assigned interfaces.
* Fix CI failures
* Fix review comment
* Fixed integration test failure
(cherry picked from commit 5a6b893240)
The error message as it was confused me when the value was 'enabled' and
there was also a module parameter named 'enabled'.
enabled is not a valid boolean. Valid booleans include: yes, on, 1, true, ...
So by clearly describing it as a value, the confusion would have been
avoided.
The value 'enabled' is not a valid boolean. Valid booleans include: yes, on, 1, true, ...
(cherry picked from commit 487cf0ee8d)
* win_feature: better error handling to make it easier to debug issues (#36491)
* win_feature: better error handling to make it easier to debug issues
* removed ignroed pslint rules that are no longer needed
(cherry picked from commit ef4f8851dc)
* Added changelog for win_feature error handling fix
* Fix types when evaluating interpreter (#36541)
* Fix types when evaluating interpreter. Fixes#36536
* Rename variables that contain bytes to b_*
* Get rid of to_text() and to_bytes() calls that do nothing (because the
data is already the proper type)
(cherry picked from commit a4df4d33ac)
* Changelog entry for the ansible_*_interpreter fix
* Add example on how to use a here document with shell module
* Remove here doc example and add note to use script module instead
(cherry picked from commit 5e7ee9df0a)
* If inventory file isn't able to be parsed by aws_ec2, return an empty dict instead of None
* Raise an AnsibleParserError instead
* remove extra lines
* aws_ec2 inventory plugin - fix path matching logic
* Re-use logic from StrategyBase._load_included_file in StrategyModule.run for free and linear (#36470)
This improves include_role performance and recursion limits
(cherry picked from commit 10fefc7156)
* Add changelog for 36470
* Better handling of absent AWS SES identity notification information.
Fixes#36065
aws_ses_identity module now handles the cases where information about
the notification setup for the identity isn't returned by the AWS api.
This seems to happen in an edge case, believed to be eventual
consistency on registering new identities. So this case is treated
as if has been no notification setup for the identity yet.
Also fix 2 flake8 warnings in the module, a missing newline and unused
import.
* Increase the Boto Retries on SES APIs to deal with throttling.
This should address the unstable integration test failing due to
parallel runs in shippable hitting AWS throttling.
* Add retries loading SES details for inclusion in successful response.
There seems to be an eventual consistency behaviour with identity
registration. It's possible to still get no identity back after
registration.
This can cause failures in the shippable builds. This should fix that by
creating a retry of retrieving the identity information after
registration.
A similar retry loop has been added to notification attributes to ensure
this doesn't suffer from the same failure.
* Add missing sleep in get_notification_attributes to avoid busy loop.
* Add force option to systemd module
* Use multi-line YAML syntax in examples
* Add version_added for new option
(cherry picked from commit 2bffcfa63b)
* fetch: set fail_on_missing: True as default as per docs
* Updated docs for fetch to say behaviour was changed in 2.5 and updated tests
(cherry picked from commit df8a5d7a4f)
* Bug in del(list) logic. Say you have a list of 4 elements a[0-3]
and you have to remove index 1 and 3, if you remove index 1 first
then list is cut short a[0-2] and does not have index 3
Fix: Remove indexes in reverse sorted order e.g. 3 and 1 in above
example so that order of indexes remain preserved even after deleting
fix is to remove indexes in reverse sorted order
* Add test cases for failed case
(cherry picked from commit 0bbea9a579)
* now get_url and other modules default to module temp dir
also fixed 'bare' exception
* allow modules to work with older versions
* updated docs per feedback
(cherry picked from commit c119d54e4a)
Unified tmp accidentally removed the containing tmpdir from the list of
files to fix the permissions on when we're becoming a different
unprivileged user. This resulted in a visible bug for script but not
for patch. This is because patch also uploads the module to the same
temporary directory and the uploaded module also ends up calling
fixup_perms2() which includes the temporary directory. So by the time
patch needs to access the temporary patch file, the directory is
appropriately set.
script's breakage was visible because script does not upload a module
(it's akin to raw in this way). Therefore, we only call fixup_perms2()
once in script and so leaving out the tmpdir in script means that the
containing directory never has its permissions set appropriately.
Fixing both because it does not cause an extra round trip for patch so
any speedup would be minimal and it's better to fix the perms as close
as possible to where we know we need it. Otherwise, changes to
seemingly unrelated code later could end up breaking it.
Fixes#36398
(cherry picked from commit edaeb69a35)
* Update network debug troubleshooting guide
Fix#35914
Command timeout and connection timeout error messages
are dsiplayed in log file instead on console.
Update the same in troubleshooting guide.
* Update example error
* Fix CI issues
* Fix more CI failures
* More fixes
* Fix review comments
* Fix more review comments
* Copy edit
(cherry picked from commit b57cc7cf31)
* Fix nxos_system tests (#36201)
* Fix nxos_system tests
* Add debug connection plugin info
* Move sanity test under common
(cherry picked from commit 5b5d24631a)
* Fixes for the N3500 platform that uses the A8 image (#36261)
* fix nxos_l3_interface tests as n35 doesn't support ipv6
* add terminal dont-ask to nxos_feature and nxos_lldp
* put interfaces in L2 mode for N35
* fix nxos_feature unit-tests
(cherry picked from commit e24c547a3a)
send_command already performs the to_bytes safely on prompts (checking
for None). Without this check the literal 'None' became a subprompt trigger!
Fixes#35662
(cherry picked from commit f2818caa61)
ansible-console was calling setup_vault_secrets
twice. Once directly and once via _play_prereqs()
The direct invocation was not setting auto_prompt=False.
However, the direct invocation isn't need at all so
this removes it so only _play_reqs() is used.
That fixes the unrequested vault password
prompting.
Fixes#33027
(cherry picked from commit 810fa7046b)
This PR includes:
- Rename 'protocol' parameter to 'url_protocol'
- Add limited integration tests (as we have no public firmware access)
- Add missing examples
(cherry picked from commit e1b5bc049c)
When ACI modules are being used for querying MOs, we should not return
the previous state, as there is no previous state, there's only the
current state.
This impacts a lot of tests that were used to testing the current state
as 'previous'.
(cherry picked from commit dba561efa7)
This fixes, cloning operation where template or existing VM
does not have network or DVPG. Also, adds some strict type checking in
network parameters.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit a377302d6b)
This PR includes:
- A fix to the module where domain_type without domain caused havoc
- A fix to the integration tests when querying all binding objects
- Improvements to integration tests
(cherry picked from commit 7897558b95)
This PR includes:
- Adding more resources to each section
- Improving wordings
- Add links to the Ansible ACI community pages
(cherry picked from commit a875363e35)
Since we pass information directly to ACI, we sometimes get error messages back to the user that require some additional information or context.
This PR includes:
- Changes to the default error output so the error is easier to find
when searching in e.g. Google
- 3 specific error messages that we have encountered and has confused
our users before
(cherry picked from commit 218f008dab)
This PR includes:
- Fixes related to the recent merge of #31637 and #34537
- A generic fix for a reference for assignment issue
- Fixes to aci.boolean() in order to catch exception
(cherry picked from commit 01ba3a4efc)
* Assorted set of fixes
* Cosmetic changes to lists
* Add more information related to connection throttling
* Changes to TOC
* Document return values
* More improvements
* Fix casing in title
(cherry picked from commit 80e1e0b017)
* CHANGELOGs are now per-version
* CHANGELOGs are now RST format
* CHANGELOGs are now generated via reno from YAML fragments located in changelogs/fragements. This allows feature/bugfix changelog fragments to be cherry-picked alongside the code changes
* each version's CHANGELOG_vX.Y.rst is generatd at release-time and can be easily copied/cherry-picked into other branches
* Add eos_command doc with more examples
* More examples using cli and eapi transport
* Example on how to handle json output
* Example on handling result output in wait_for
* Fix typo
(cherry picked from commit cb52509775)
The modules in this patch include waits that need to happen to ensure
something is correctly configured on a BIG-IP. These waits were
raised as an issue in a recent ansible-testing meeting.
This patch eliminates the waits by mocking time.sleep
(cherry picked from commit 77fa41795e)
* Update ios_ping.py to allow for count > 70.
Find 'Success...' output rather than relying on list index. Index -1 won't pass unit test.
(cherry picked from commit fed20b825f)
* Normalize usage of temp and tmp on tmp
* Rename system_tmps system_tmpdirs
* Add ANSIBLE_REMOTE_TMP spelling of environment variables
(cherry picked from commit 06f73ad578)
Start using this to construct shade OpenStack Cloud objects in a
consistent manner. This will let us centralize things like dealing with
password arguments and whatnot. It also allows us to introduce the
ability to pass a fully formed config dict directly to the module.
Migrate all OpenStack modules to use openstack_cloud_from_module.
Have it return the shade library since it's responsible for
importing shade and shade is needed for the exceptions.
Only pull specific OpenStack arguments for the constructor
Rather than passing **module.params to the shade constructor, pull out
only the values that make sense. This should prevent the issues with
module parameters stepping on shade parameters.
Replace module.params.pop with module.params.get
We don't need to pop these anymore since the shade constructor is now
using opt-in values.
Using real urls is ungood. Use example.com domains. Also, get rid of the
antiquated port numbers.
(cherry picked from commit 0f893027c4)
* added support for --testcase flag in ansible-test
* fixed command format
* added tab completion
* fixed sanity issues
* added documenation for --testcase
* don't autocomplete when multiple modules are selected
(cherry picked from commit 3f5caf659e)
* fix loop_control templating
- properly template ALL properites for loop_control
- loop_control inherits from base, it should not, but needs validate/attribute functionality
fixes#24719
(cherry picked from commit 8de4f7cd9f)
* add export option
* added 'export mode' to ansible-inventory
this optimizes the output for exporting inventory vs representing the 'ansible view'
fixes#30877
* added group priority when needed
(cherry picked from commit b403653bd2)
This fix adds an additional check if there is no snapshot available
in VM. `rootSnapshotList` is None, if no snapshot is taken.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 52f79fa5a4)
* adding support for loopback interface
currently the loopback interface lo is not supported with vyos_l3_interface, this commit fixes that. Right now there is a limit of loopback interfaces to just lo, if you want more interfaces you need to use a dummy interface https://wiki.vyos.net/wiki/Dummy_interfaces
* fixing spacing as per pep8 test
fixing issues for sanity test
* ugh, missed on spacing issue
* getting rid of continuation lines, the CI system does not like it
(cherry picked from commit a52a7d2065)
* Followup to docs refactor pull request #36067 - fixes gitignore and cleanup in makefile; removes some generated files; moves a straggler to the appropriate subdirectory.
* Fixed some stragglers
* Removed redundant module entries
* Delete generated RST files.
(cherry picked from commit c10080bfba)
* Docs refactor as outlined in https://github.com/ansible/proposals/issues/79. Moves content into 'guides'; refactors TOC; fixes CSS; design tweaks to layout and CSS; fixes generated plugin, CLI and module docs to fix links accodingly; more.
* Adding extra blank line for shippable
(cherry picked from commit 373b1dcf59)
* Revert "commented out check tests (#35788)"
This reverts commit 3df2561405.
* `discard_changes()` now uses `exit discard`
instead of just `discard`. Also a slight tweak to avoid a second `exit` after
`exit discard`
(cherry picked from commit 6cdf91fd35)
* Change wording of Going Further section
The original wording was confusing with its non-devel branch part.
Made it much clearer for people to understand what to do.
Also removed the git command for creating branches, I believe a
develop should be aware of how basic git commands work.
(cherry picked from commit d5ae63c0ea)
* Fix vrf parsing in eos_vrf and eos_eapi module
Fixes#30250
Fix logic to parse vrf when interface value in `show vrf`
command output spans on multiple lines
* Add idempotent test case
(cherry picked from commit 6a223d5576)
* hardcoded API profiles in azure_rm_common
* changed azure_rm_securitygroup module to use api_profiles, dynamic models, kwargs on all SDK methods
* changed azure_rm_containerinstance module to use api_profiles, dynamic models, kwargs on all SDK methods
* fixed polling performance issue in azure_rm_securitygroup (default poll interval was 30s)
(cherry picked from commit 26f551d1c3)
* Exclude parent when copying included task to avoid memory issues. Fixes#35796
* Simplify implicit block squashing to pre-group, instead of post re-parenting
(cherry picked from commit 7d1eb88ecf)
tar -C deb-build/$${DIST} -xvf dist/$(NAME)-$(VERSION).tar.gz ;\
cp -a packaging/debian deb-build/$${DIST}/$(NAME)-$(VERSION)/ ;\
sed -ie "s|%VERSION%|$(VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ;\
sed -ie "s|%VERSION%|$(DEB_VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ;\
Ansible is a radically simple IT automation system. It handles configuration-management, application deployment, cloud provisioning, ad-hoc task-execution, and multinode orchestration - including trivializing things like zero-downtime rolling updates with load balancers.
Read the documentation and more at https://ansible.com/
You can find installation instructions [here](https://docs.ansible.com/ansible/intro_installation.html) for a variety of platforms. Most users should probably install a released version of Ansible from `pip`, a package manager or our [release repository](https://releases.ansible.com/ansible/). [Officially supported](https://www.ansible.com/ansible-engine) builds of Ansible are also available. Some power users run directly from the development branch - while significant efforts are made to ensure that `devel` is reasonably stable, you're more likely to encounter breaking changes when running Ansible this way.
Design Principles
=================
* Have a dead simple setup process and a minimal learning curve
* Manage machines very quickly and in parallel
* Avoid custom-agents and additional open ports, be agentless by leveraging the existing SSH daemon
* Describe infrastructure in a language that is both machine and human friendly
* Focus on security and easy auditability/review/rewriting of content
* Manage new remote machines instantly, without bootstrapping any software
* Allow module development in any dynamic language, not just Python
* Be usable as non-root
* Be the easiest IT automation system to use, ever.
Get Involved
============
* Read [Community Information](https://docs.ansible.com/community.html) for all kinds of ways to contribute to and interact with the project, including mailing list information and how to submit bug reports and code to Ansible.
* All code submissions are done through pull requests. Take care to make sure no merge commits are in the submission, and use `git rebase` vs `git merge` for this reason. If submitting a large code change (other than modules), it's probably a good idea to join ansible-devel and talk about what you would like to do or add first and to avoid duplicate efforts. This not only helps everyone know what's going on, it also helps save time and effort if we decide some changes are needed.
* Development list: [ansible-devel](https://groups.google.com/group/ansible-devel)
* Announcement list: [ansible-announce](https://groups.google.com/group/ansible-announce) - read only
* irc.freenode.net: #ansible
Branch Info
===========
* Releases are named after Led Zeppelin songs. (Releases prior to 2.0 were named after Van Halen songs.)
* The devel branch corresponds to the release actively under development.
* Various release-X.Y branches exist for previous releases.
* We'd love to have your contributions, read [Community Information](https://docs.ansible.com/community.html) for notes on how to get started.
Authors
=======
Ansible was created by [Michael DeHaan](https://github.com/mpdehaan) (michael.dehaan/gmail/com) and has contributions from over 1000 users (and growing). Thanks everyone!
Ansible is sponsored by [Ansible, Inc](https://ansible.com)
- EOS can not check configuration without use of config session (ANSIBLE_EOS_USE_SESSIONS=0). Fix is to throw error when hiting into this exception case. Configs would neither be checked nor be played on the eos device.
- azure_rm modules - updated with internal changes to use API profiles and kwargs for future Azure Stack support and better stability between SDK updates. (https://github.com/ansible/ansible/pull/35538)
- azure_rm_networkinterface - fixed examples in module documentation and added fix to allow an IP configuration with no public IP (https://github.com/ansible/ansible/pull/36824)
- Apstra's ``aos_*`` modules are deprecated as they do not work with AOS 2.1 or higher. See new modules at `https://github.com/apstra <https://github.com/apstra>`_.
- docker modules - Error with useful message is both docker and docker-py are found to both be installed (https://github.com/ansible/ansible/pull/38884)
- edgeos_config - check for a corresponding set command when issuing delete commands to ensure the desired state is met (https://github.com/ansible/ansible/issues/40437)