* "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
* 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)
* 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
* Update vars for loop_control on each loop iteration (fixes#38899) (#39818)
(cherry picked from commit 01e8139d74)
* Changelog snippet for cherry-pick of #39818
* 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 0ac885f1c7)
* replace str(e) with to_native(e) according to code review
(cherry picked from commit e2e3bf6b9a)
* 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)
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)
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
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)
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)
Don't round the parameter 12.04 in the explanatory paragraph unless `version()` rounds the parameter
(cherry picked from commit 5cf544e03e)
(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)
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)
* Ansible.ModuleUtils.FileUtil - Add ability to test non file system provider paths (#39200)
(cherry picked from commit b6afe6946d)
* Added changelog fragment
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
* 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
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)
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)
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 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
* 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)
* 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
* 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
* 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