Commit Graph

29556 Commits (c92765e26ed3003bc8284e527d04c4e3abb77fbd)
 

Author SHA1 Message Date
Ganesh Nalawade c92765e26e Make warning logs consistent (#23666) (#23716)
* Make warning logs consistent

Arguments outside provider with default
value should not log as warning in case
it is not mentioned in play.

* Make nxos timeout default consistent and add comments

* Make comments more verbose

(cherry picked from commit bf1a543f06)
9 years ago
Ganesh Nalawade db738e0a2d Remove Warning for provider (#23652) (#23714)
(cherry picked from commit b8507b676b)
9 years ago
Adrian Likins 32be9a9273 Fix vault reading from stdin (avoid realpath() on non-links) (#23583)
* Fix vault reading from stdin (avoid realpath() on non-links)

os.path.realpath() is used to find the target of file paths that
are symlinks so vault operations happen directly on the target.

However, in addition to resolving symlinks, realpath() also returns
a full path. when reading from stdin, vault cli uses '-' as a special
file path so VaultEditor() will replace with stdin.
realpath() was expanding '-' with the CWD to something like
'/home/user/playbooks/-' causing errors like:

        ERROR! [Errno 2] No such file or directory: u'/home/user/ansible/-'

Fix is to specialcase '-' to not use realpath()

Fixes #23567

* to_text decrypt output when writing to stdout

(cherry picked from commit ae3d7fb29e)
9 years ago
Matt Martz 8e1b422e4a When become_method is su, self._play_context.prompt is a function. Fixes #23689
(cherry picked from commit f82d95ae28)
9 years ago
Nathaniel Case 82dcaa725f pep8 fix for Shippable 9 years ago
Brian Coca 7cd2b8d7a0 tolerate 'batch' systems that mess with stdin (#23596)
* tolerate 'batch' systems taht mess with stdin

fixes #23541

* have pause on windows tolerate devnull

* tuplie

(cherry picked from commit 586fcae398)
9 years ago
Nathaniel Case c4b6b87344 nxos_vlan tweaks (#23194)
* Remove commented code

Remove a lot of unnecessary output

* Tests

* Sort vlan ids _after_ running set operations, so order is not lost
(cherry picked from commit 0b4cebfb8b)
9 years ago
Daniel f66852f1ef Nxos vxlan vtep vni netcfg fix (#23620)
* Code cleanup
Removed 'add' method from CustomNetworkConfig.  It is identical
to the one inherited from NetworkConfig

* Removed unused CustomNetworkConfig import

* Replaced
```
def get_existing(module, args):
    existing = {}
    netcfg = get_config(module)
    config = netcfg.get_section(parents)
```
with
```
netcfg = CustomNetworkConfig(indent=2, contents=get_config(module))
```
get_config returns a string, not an object in 2.3.

* Removed non-functioning get_object method in CustomNetworkConfig in favor of the
inherited method.

Added child_objs property so that expand_selection would work.  The original
verion never worked correctly as it compared NetworkConfig obj's and str's.

* Removed ShellError method in favor or new load_config method.

* Removed ShellError method in favor or new load_config method.
fixes #20260

* nxos requires a "no" statement to change mcase group.  Corrected.
Corrected changed logic.

* Corrected deleted CustomNetworkConfig import
9 years ago
Nathaniel Case d1d0f382a2 Clean up import statements for nxos_rollback (#23540)
* Clean up import statements for nxos_rollback

* Don't try to deal with pre-2.3 logic
(cherry picked from commit e518b6f5b4)
9 years ago
Ganesh Nalawade 39c2e4c28b Make logging consistent for network platforms (#23605) (#23648)
(cherry picked from commit 89752cc34f)
9 years ago
John R Barker b721fa2ef5 Fix documented defaults in the nsupdate module (#23532) (#23637)
Let the documentation reflect what the module actually implements.
(cherry picked from commit 40f9f98f7c)
9 years ago
Manuel Sousa b8400cd897 Fix #23338 - rabbitmq_queue message ttl can't be 0 (#23448)
(cherry picked from commit 8b4f5ba064)
9 years ago
Ganesh Nalawade 8b5267f09f fixes issue where network modules would ignore provider host value (#23589) (#23608)
This addresses a problem where the action plugin would ignore the
remote_addr value for the host.  In this case, only the inventory values
for the hostname would be considered and populate the remote host
remote_addr value for the connection plugin.
(cherry picked from commit c2370f14dd)
9 years ago
Matt Clay 06be3c56a9 Add rstcheck to ansible-test and correct issues. (#23550)
* Add rstcheck to ansible-test.
* Fix rst code-block languages and syntax errors.
* Fix rst inline literals.
* Update python 2 code block to pass tests on py 3.

(cherry picked from commit cb1f57d4e5)
9 years ago
Matt Clay 92bdd13bb1 Fix var precedence check to support python 3. (#23552)
* Fix var precedence check to support python 3.
* Run CI sanity tests using python 3.5.
* Disable pylint non-iterator-returned test to pass on python 3.5.

(cherry picked from commit e7bb508ad6)
9 years ago
Matt Clay 69562c5d20 Fix module validator blacklist handling.
Process the blacklist before creating a validator instance.

(cherry picked from commit 442768c45e)
9 years ago
Lumír 'Frenzy' Balhar 4452429b45 Add Python 3 support for validate-modules test. (#21195)
* Improve PEP8 compatibility

* Fix Python 3 incompatibility

Is prohibited to mutate OrderedDict during iteration through it so
is better to add records with error or warning to empty dictionary
instead of delete records from copy of dictionary during iterating.

* Decode output of subprocess from bytes to unicode.

* Add Python 3 support for validate-modules test.

Fix #18367

(cherry picked from commit 9d41aefd71)
9 years ago
Ryan Brown a256745eae fix validate-module sanity error per https://app.shippable.com/github/ansible/ansible/runs/16493/1/console (#22711)
(cherry picked from commit d791665559)
9 years ago
Matt Clay 345749884d Fix module validation without base branch.
(cherry picked from commit 672e9a2f61)
9 years ago
Matt Clay 5667fe6746 Support module alias and rename validation. (#22675)
Cache git ls-tree output to speed up validation.
(cherry picked from commit 1f337b6421)
9 years ago
Brian Coca c9de302fc6 removed debug print
(cherry picked from commit 313591f8b8)
9 years ago
Matt Clay 6883cad07e Temporarily cap pylint version < 1.7.0 in tests.
(cherry picked from commit 4ee96b20a3)
9 years ago
John R Barker 85fa2a9dd4 Make it easier to find network modules (#23576) (#23584)
* Make it easier to find network modules

Feedback has been it's difficult (via Google or directly) to find
modules as some people search for the company name vs product name,
therefore specify both.

* "IOS XR" (not "IOS-XR")

(cherry picked from commit 92a425a532)
9 years ago
John R Barker 5865356e92 network_cli modules don't always return stdout or stdout_lines (#23573) (#23582)
It's possible that if the module has a low-level failure, such as
"unable to open shell", or something else in the action plugin that
stdout and stdout_lines will not be returned.

Update the documentation to clarify this point.
(cherry picked from commit 2bb25d031b)
9 years ago
John R Barker bc43de7b21 Error string:Regular expression updates (#23426) (#23569)
(cherry picked from commit c86feeaed9)
9 years ago
John R Barker a574dc7bf1 [WIP] Network return docs (#23441) (#23535)
Network return docs
(cherry picked from commit 902bc58509)
9 years ago
Colin Nolan c5fcae130f Add checks to confirm that the output from `xfs_info` has the expected format.
(cherry picked from commit 57c67f0c08)
9 years ago
Matt Clay 45c2887b19 Fix ansible-test handling of import/syntax errors.
(cherry picked from commit 0cf1e8e061)
9 years ago
Matt Clay 84d5e6e645 Fix errors reported by pylint. (#23282)
* Fix pylint misplaced-bare-raise errors.
* Fix pylint return-in-init error.
* Fix pylint bad-format-character error.
* Fix pylint too-many-format-args errors.
* Fix pylint too-few-format-args errors.
* Fix pylint truncated-format-string error.

(cherry picked from commit 48eeab8a53)
9 years ago
Matt Clay 92c4a3319c Initial pylint support for ansible-test sanity.
(cherry picked from commit 1daa69d685)
9 years ago
Albert Casademont 1a30df265d Fix Postgres user module always reporting changes (#23488)
(cherry picked from commit 54316f7da0)
9 years ago
Toshio Kuratomi ee69fd140b When apt errors, include it's exit code
We invoke /usr/bin/apt inside of the ansible module.  When that command
exits, it doesn't always include a helpful error message.  Include the
exit code so that user's have all the information we can gice them as to
why apt failed.

Addresses #19128

(cherry picked from commit b4f976e9b9)
9 years ago
Matt Clay f57d0bab32 Set IO encoding for ansible-test on Shippable.
(cherry picked from commit eec01e2137)
9 years ago
Matt Clay a491adc425 Fix ansible-test empty diff handling on Shippable.
(cherry picked from commit 92ad9a19b6)
9 years ago
Lucas Alvares Gomes 5f53a159a0 rpm_key: Decode bytes to string to work with Python 3 (Fixes #20326) (#20385)
* rpm_key: Decode bytes to string to work with Python 3 (#20326)

The read() method will return bytes we need to then decode() those bytes
to a string before trying to match() it using the re module.

* Make the rpm_key pgp regex more robust on both py2 and py3

(cherry picked from commit cee8cc2a52)
9 years ago
cclauss f2cf1dba92 Update the comments around Python 3
[Enterprise Linux 5 is at the end of "End of Production 3 phase"](https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux#Product_life_cycle) so that is no longer a reasonable reason to wait.  Also removed the comments about [Python 3 not being mainstream](http://python3wos.mybluemix.net/201).  Perhaps a link to https://docs.ansible.com/ansible/python_3_support.html would also be a useful addition to this question.
(cherry picked from commit 6314169afd)
9 years ago
Karl Bergström 561d424a0e Open unarchive file in binary mode
Recent Python3 versions require open() to specify binary mode if the data is anything other than text.

Python3: Use int() instead of long() in unarchive

Changes long() to int() for CRC values in the unarchive module. Affects unarchiving of zip files. Since CRC values in zipfile are 32 bits the behaviour should be unchanged even in Python 2.
9 years ago
Paul Montero ba977b7cd7 Open file in binary mode for python3
(cherry picked from commit 1963e506ec)
9 years ago
Toshio Kuratomi 53b19611e1 Fix a traceback with python3 and diff output
When retrieving file contents for diffing we need to get the contents as
binary.  Otherwise python3 will try to convert the file to text and fail
with non-decodable contents.

Fixes #23171

(cherry picked from commit 2fdb8e7f90)
9 years ago
Ganesh Nalawade b8d6f23fb7 Fix a10 pylint issues (#23410) (#23413)
* Fix a10 pylint issues
* Moving imports to standard location

(cherry picked from commit 3934513121)
9 years ago
Matt Martz b96407be86 Extra deps needed for building cryptography
(cherry picked from commit ac61f09203)
9 years ago
Matt Martz bdf46e928f Fallback to old ssl_wrap_socket
(cherry picked from commit 13ac993d25)
9 years ago
Matt Martz 9acba3fa68 Update install deps for SNI tests
(cherry picked from commit b4b76bab14)
9 years ago
Matt Martz 71e8c841ce Use PyOpenSSLContext instead of deprecated wrap_ssl_context from urllib3.contrib.pyopenssl. Fixes #18528
(cherry picked from commit 33f7a27cba)
9 years ago
Strahinja Kustudić 701a47c850 Ignores ControlPersist broken pipe errors. Fixes #16731
Ansible will now automatically retry a connection if SSH returns an error:

mux_client_hello_exchange: write packet: Broken pipe

This is probably a bug in SSH, but because it's safe to retry this
connection there is no need for Ansible to fail because of it.

(cherry picked from commit 9f0be5a556)
9 years ago
Matt Parkes ffde769567 ini_file 'create' parameter default value should be True
Updated create default value to True to match documentation (and common sense).
9 years ago
Brian Coca 3b5a758525 centralize ansible_managed and other template vars
now template lookup supports these again.

(cherry picked from commit 5b7e8a7bd6)
9 years ago
Brian Coca 4b10f3c13c removed extra 'changed' from debug output
(cherry picked from commit f7566ef1f1)
9 years ago
Brian Coca e1c1c19a9b added test emulating #23180 use case
(cherry picked from commit 8382ed7200)
9 years ago
Brian Coca 690a793aae fix environment validation, make setup exception
removed bare vars
now environment inheritance correclty prepends
this allows more local to override more general

fixes #23180

(cherry picked from commit df5895e585)
9 years ago