Commit graph

29447 commits

Author SHA1 Message Date
Ricardo Carrillo Cruz
5744abfe4e Fix eos_banner cli basic_motd integration test (#23158)
A task was lacking the provider variable, causing the test to fail.

Fixes #23130
2017-03-31 00:28:37 +02:00
Alex Willmer
07ea6a6adf Include '/' & '.' when password_hash generates a new salt
The password_hash filter will generate a salt value if none is supplied.
The character set used by Ansible

(upper & lowercase letters, digits)

did not match that used by libc crypt

(upper & lowercase letters, digits, full stop, forward slash).

This resulted in a slightly smaller key space, and hence hashes would be
slightly easier to attack (e.g. by dictionary, brute force).

(cherry picked from commit f5aa9df1fd)
2017-03-30 12:47:34 -07:00
John R Barker
1ba7e6b6f6 Ansible 2.3 feature support for dellos6. (#23084) (#23147)
* Ansible 2.3 feature support for dellos6.

- With the new Ansible 2.3 infra changes, the dellos modules doesn't work
  (the new infra changes are not backward compatible), so added the below
  changes support it.
- Added the new terminal plugin for DellOS6
- Added the new action plugin for DellOS6
- Modified the modules to work with the new infra.
- with that it adds support for DellOS6 Persistent Connection support.

* Remove pep8 confirming files from dellos6.py and dellos6_config legacy-files

(cherry picked from commit a0344acd78)
2017-03-30 17:42:11 +01:00
Peter Sprygada
7afc9ac899 fixes error parsing lldp neighbors when running nxos_facts (#23134)
(cherry picked from commit 2e476e64cd)
2017-03-30 11:31:53 -04:00
John R Barker
1b188c1fb9 updates log messages in ansible-connection (#23076) (#23125)
(cherry picked from commit 53c52cf65f)
2017-03-30 13:24:47 +01:00
Ricardo Carrillo Cruz
af83d4d4df Fix ios_config return on python 2.4 (#23094) 2017-03-30 00:22:33 +02:00
Ricardo Carrillo Cruz
18dedd985a Do not re.search show configuration stdout if empty (#23087)
If the banner is not set, the stdout of 'show configuration | begin banner <banner>'
returns empty string thus the re.search raises an exception.

Fixes #22216
2017-03-29 23:02:46 +02:00
Ricardo Carrillo Cruz
664b27aaf0 Introspect flag to use on 'show run' when using defaults in ios_config (#22903)
When the ios_config module has 'defaults' param it runs in the device the command
'show running-config all' but 'all' may not be available in older devices.
This change makes introspection by using the help command and run 'full' in case
'all' is not available.

Fixes #22747
2017-03-29 22:53:14 +02:00
Ricardo Carrillo Cruz
3859551eb3 Fall-back to show configuration on old IOSXR devices (#22900)
In old IOSXR versions, 'show commit changes diff' does not work.
Fall-back to 'show configuration' if that command fails so execution
can move forward.

Fixes #22235
2017-03-29 22:52:00 +02:00
Peter Sprygada
53934702ce restores pre 2.3 behavior with respects to keys (#23083)
This removes the requirement to configure look_for_keys=False and
restores the behavior to disable key lookup if no key was provided.
(cherry picked from commit 88ce6fd273)
2017-03-29 15:13:33 -04:00
Toshio Kuratomi
4a9c5d9574 Split on newlines when searching for become prompt
The fix for leading junk in sudo output: fee6e29 causes problems with
ssh + sudo.  On the initial connection using ControlPersist, the output
that we scan for the prompt contains both the command we're sending to
configure the prompt and the prompt itself.  The code in fee6e29 ends up
sending the password when it sees the line configuring the prompt which
is too early.

Switch to a version that splits on lines and then checks whether the
first or last line starts with the prompt to decide if it's time to send
the password.

Fixes #23054
References #20858

(cherry picked from commit 6f77498700)
2017-03-29 12:11:57 -07:00
jhawkesworth
c528d8b17d changed parameter name from forest_root_dns_domain to dns_domain_name (to match documentation and other win_domain* modules) and fix example which has win_domain_controller instead of win_domain for module name. (#23081)
(cherry picked from commit 4eba248a8e)
2017-03-29 11:35:23 -07:00
jhawkesworth
c8dc993fb4 correct examples to match correct _password module parameter names (#23067)
(cherry picked from commit a3e2280e62)
2017-03-29 11:32:59 -07:00
Artem Zinenko
7c84593eb0 Fix #22126 (#22128)
(cherry picked from commit a5da638d34)
2017-03-29 11:30:58 -07:00
Pavel Glushchak
657fd1dfd1 Added Virtuozzo distribution support
Virtuozzo Linux is based on CentOS sources. Thus OS family
should be recognized as 'RedHat'.

Signed-off-by: Pavel Glushchak <pglushchak@virtuozzo.com>
(cherry picked from commit 097173c6f5)
2017-03-29 08:47:48 -07:00
Fabrizio Colonna
4465171e89 Fixed issue #22996 and issue #22955. 2017-03-29 08:29:10 -07:00
Victor Perron
9ee2065477 paramiko_ssh: fix crash upon pass prompt in py3
The pass prompt expects an answer and compares a `str` to a binary buffer, thus crashing.

It's an obvious fix to help transitioning towards Python3 and hopes it does not need a specific test.
(cherry picked from commit bc44175d8d)
2017-03-29 07:47:48 -07:00
Jeremy L. Gaddis
ca497b43e4 Update requirements for seboolean module (fixes #23028)
(cherry picked from commit b52dbddc17)
2017-03-29 07:25:27 -07:00
Toshio Kuratomi
bb0b90783c Fix for tests run with no .ssh user dir
When building in automated build systems, there are sometimes cases
where the user doing the building does not have a .ssh directory.  In
this case, we need to mock out some os.path functions so that the
add_host_key() function we're testing won't complain or try to create
one.

(cherry picked from commit ade3fc2893)
2017-03-28 19:28:15 -07:00
Dag Wieers
d9a6714cb9 win_chocolatey: Fix state=latest when absent (#23041)
When using state=latest with the package not being installled, Ansible complains that the package is not installed and fails the task.
Whereas the expected behaviour is to install the package when it is missing.

This PR fixes this behaviour.
(cherry picked from commit 521fa9b458)
2017-03-28 17:50:17 -07:00
Toshio Kuratomi
9785d5b2fb Fix synchronize tests for the updated quoting change between action and module
(cherry picked from commit b0d75a0ecb)
2017-03-28 14:15:42 -07:00
Toshio Kuratomi
da10768b10 Fix a couple issues in synchronize with docker (#23047)
* Fix a couple issues in synchronize with docker

* Make the rsync_opts parse as a list using the same criteria as
  module_utils argumentspec parsing
* Do not quote arguments in the action plugin.  The module will quote as
  it knows whether it will invoke rsync with a shell or via exec.

Fixes #23046
(cherry picked from commit d3a1aea7c5)
2017-03-28 11:39:18 -07:00
John R Barker
48f6af4907 updates sample ansible.cfg (#23045) (#23050)
* adds host_key_auto_add to paramiko section
* adds look_for_keys to paramiko section
* adds terminal_plugins to defaults section
* adds persistent_connection section and key/value enteries
(cherry picked from commit ccfa464464)
2017-03-28 19:08:32 +01:00
Peter Sprygada
0c0d949c47 minor updates to network connection plugins (#23043)
* removes unused log() function in network_cli
* adds method comments to terminal plugin base
(cherry picked from commit 768cb437ab)
2017-03-28 13:00:09 -04:00
Evgeni Golov
7c9c8396d1 cron: don't force changed=True when old crontab was empty
The cron module forces changed=True when there was no real change,
but the original crontab did not contain a final newline, which is
mandatory.

When the user has no crontab or the user does not exist at all,
crontab -l exits with 1 and the cron module correctly interprets
this as "no crontab" and stores the old crontab as "".

However this triggers changed=True, even if we're not going to
change anything, e.g. when removing a crontab entry from a user
who has no crontabs at all.

Let's special-case the fact that the old crontab is empty and not
force changed=True in that case.

(cherry picked from commit 61579aebb2)
2017-03-28 07:45:45 -07:00
James Cammarata
f001646f2c New release v2.3.0.0-0.2.rc2 2017-03-27 16:25:02 -05:00
John R Barker
f3c839b35f Ansible 2.3 feature support for dellos9 and dellos10 (#23010) 2017-03-27 20:32:18 +01:00
John R Barker
80c4a02c5f Network module docs 2.3 (#22454) (#22995)
Network module docs 2.3 (#22454)
Cherry pick of https://github.com/ansible/ansible/pull/22454 into stable-2.3

* Tidy up docs for network 2.3 modules

* Use suboptions

* Correct indentation

* more tidyup

* bulk updates

* more tidyup

* Bulk changes

* nxos_mtu is dead

* revert

* NXOS_mtu is dead, also better layout

* rebase

* rebase

(cherry picked from commit f82239e1f7)

* metadata_version - merge error
2017-03-27 13:18:36 +01:00
Peter Sprygada
01abc097ee removes unused code in eos action plugin (#22986)
(cherry picked from commit ab4b8cb104)
2017-03-27 00:51:57 -04:00
Peter Sprygada
63812b0a2c roll up of fixes for sros modules (#22972)
* fixes action handlers for sros
* fixes sros_config module execution to use AnsibleModule
* fixes sros_command module to use socket connection
* adds sros to constants

(cherry picked from commit 3169cbd493)
2017-03-25 10:40:23 -04:00
Peter Sprygada
ba49443532 fixes junos_package module to use junos_pyez (#22973)
This allows junos_package to use junos_pyez directly instead of the
persistent connection.  This is a workaround fix for 2.3
(cherry picked from commit 33624fe96f)
2017-03-25 10:22:59 -04:00
Gabriele
66481d3d2f Fixing module behavior when route_target_both is used (#20076)
(cherry picked from commit 9b2bdf2df6)
2017-03-25 08:02:58 -04:00
Peter Sprygada
d1ed72ad37 fixes issue where nxos module will fail due to KeyError (#22966)
Updates nxos action handler to handle deleting provider key if exists or
silently continuing if a  KeyError is raised.
(cherry picked from commit 6a414371a1)
2017-03-25 07:45:59 -04:00
Peter Sprygada
75d19442e3 fixes log message in junos action handler (#22965)
(cherry picked from commit e93cdecef1)
2017-03-25 00:39:29 -04:00
Peter Sprygada
f0bd79d41b fixes ansible-connection working directory (#22964)
When ansible-connection forks the process, it changed the working
directory to /.  This patch will prevent ansible-connection from
changing the working directory in the forked process.
(cherry picked from commit 77ce83fe22)
2017-03-25 00:36:00 -04:00
Matt Clay
15695ea3bc Associate systemd module with service test. (#22847)
(cherry picked from commit 318445fe19)
2017-03-24 13:30:12 -07:00
Toshio Kuratomi
58f002d8f0 Handle the case where HTTPError.info() returns an object that aren't (#22894)
dict-like enough (can't be used with **).

This should give a better error message for #22872
(cherry picked from commit 29f623571e)
2017-03-24 12:25:45 -07:00
Erwin Lang
c16622b072 synchronize: Convert cmd to list and fix handling of the copy_links argument (#22573)
* synchronize: Convert cmd to list and fix handling of the copy_links argument

Converting cmd from str to list stops the pain of argument quoting/escaping.

* synchronize: Update imports according to #pullrequestreview-28758614

(cherry picked from commit f7c9f44aab)
2017-03-24 09:26:11 -07:00
Toshio Kuratomi
422baea136 base64 functions must be given byte strings
The base64 stdlib functions require byte strings.  So we have to
transform the strings into bytes before handing to the stdlib and then
transform them back into text before handing back to ansible.

Fixes #22873

(cherry picked from commit 589e217278)
2017-03-24 09:23:25 -07:00
Matt Davis
631eaccc64 force Windows to always use preamble-free UTF8 input encoding (#22934)
* fixes #15770
* When running under the UTF-8 codepage, Powershell subprocesses will fail (eg, Start-Job, others) if the input encoding is using the default BOM preamble. This fix forces it to use no preamble in leaf_exec and win_shell, and includes tests to verify that Start-Job works.
(cherry picked from commit e084e8809e)
2017-03-24 00:03:16 -07:00
Dhivyap
43310bb7b7 Fixes#21557-Handled dellos9_facts crash with IPV6 configs (#21652)
(cherry picked from commit cd662efd2b)
2017-03-23 23:07:58 -04:00
Artem Zinenko
7f1a7a4372 win_firewall_rule doesn't fail when profile is "any" or remoteip is IPv4 and the task runs more than once. (#22555)
* Fixed #22554

* Wrote tests for win_firewall_rule module

* Fixed #22786

* Fixed review comments

* Fixed #22799

* Added test when RemoteIP containt a netmask

* Revert comment

(cherry picked from commit f4b34a4c3b)
2017-03-23 20:02:16 -07:00
Peter Sprygada
2cfe8b95de fixes a number of issues with nxos_facts (#22923)
* updates command runs to return warning if command fails
* fixes variable issues from recent refactoring
* removes provider from return of module
(cherry picked from commit 866f67e213)
2017-03-23 22:58:57 -04:00
Gabriele
30734d178c Fixing nxos_vrf_interface when interface name is not full (#22769)
(cherry picked from commit d7d76f3aaf)
2017-03-23 22:58:38 -04:00
Dag Wieers
8b9ccc15f7 win_scheduled_tasks: Improve example test framework (#22833)
Updated as discussed in previous Test Working Group.
(cherry picked from commit ef36d7de68)
2017-03-23 19:44:02 -07:00
Matt Davis
9154981684 fix Windows env handling
* fixes #22441
* fixes #22655
* moves all env handling into the exec wrapper; this should work for everything but raw, which is consistent with non-Windows.

(cherry picked from commit cc68212612)
2017-03-23 17:48:55 -07:00
Peter Sprygada
6201f9eb14 fixes issue when host is defined in provider for junos (#22918)
The junos action handler was not honoring the host value in the provider
argument.  This patch will now use the provider host entry if it exists
and falls back to the inventory hostname
(cherry picked from commit cda3e001c6)
2017-03-23 19:05:29 -04:00
Jordan Borean
5eae522d94 win_reg_stat change the module parameters for standardisation (#22732)
(cherry picked from commit f1ab879bb6)
2017-03-23 15:16:11 -07:00
Jordan Borean
4d3e5a14e6 win_share: tweaks after the caching mode changes (#22763)
* win_share: tweaks after the caching mode changes

* Re-added the Unknown option back in

(cherry picked from commit 89b78cb5e8)
2017-03-23 15:10:03 -07:00
Toshio Kuratomi
0edc943c68 Make yum's state=list obey disablerepo and enablerepo
Fixes #22876

(cherry picked from commit d0712b1ec7)
2017-03-23 12:12:51 -07:00