Commit graph

29600 commits

Author SHA1 Message Date
Nathaniel Case
b4380432f6 Run save inside config mode. (#23977)
* Run `save` before exiting config mode.

* Fix unit tests for `save`

* Allow `save` to be on its own again and introspect success

* Introspecting `compare running` makes this a lot harder.

Move `save` tests to integration tests

(cherry picked from commit fc0bf87c20)
2017-04-27 11:09:38 -04:00
Matt Clay
126878488f Fix bugs in ansible-test units command. (#24044)
* Handle old versions of coverage.
* Handle old versions of setuptools.
* Detect python version for docker/remote units.
* Add sanity override for test constraints.

(cherry picked from commit d662f6f0db)
2017-04-27 11:22:44 +08:00
Toshio Kuratomi
4b2d80f662 Add changelog entry for fetch parameter change 2017-04-26 09:28:29 -07:00
KeepZero
9b00648f21 Set validate_checksum default yes of fetch to match the doc
(cherry picked from commit 98e7d4b49d)
2017-04-26 09:27:34 -07:00
Patrick Ogenstad
456ec66b0a asa_command: set default_output to text (#23979)
(cherry picked from commit 9a0a7f78d7)
2017-04-26 09:47:35 -04:00
Matt Clay
19c4e1a992 Use Shippable image: drydock/u16pytall:master
* Use Shippable image: drydock/u16pytall:master
* Do not install python 3.6 on Shippable.
2017-04-26 15:49:21 +08:00
Brian-Williams
c60b3166b1 Change wait_for time to utc (#23987)
(cherry picked from commit 8466c808d9)
2017-04-25 18:05:10 -04:00
Brian Coca
d1c14e8aa4 moved to exceptions for basic skip/fails
better handling of checkmode and async
fix test to follow new flow control

(cherry picked from commit e29dc49a49)
2017-04-25 14:51:22 -04:00
Ganesh Nalawade
6ada5cc074 Fixes #23960 junos_config fail with config in xml (#23962) (#23978)
If config is in xml format append it to <configuration>
tag as a instance of Element class.
(cherry picked from commit 15c19367d6)
2017-04-25 22:50:35 +05:30
René Moser
f20cd780a4 exoscale: fix TXT type records handling (#23956)
(cherry picked from commit 3959597f7d)
2017-04-25 13:08:02 +02:00
Trishna Guha
107308f6df Set terminal width for network *_command modules to avoid paging (#23728) (#23952)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit f354bd1eab)
2017-04-25 14:33:59 +05:30
Indrajit Raychaudhuri
8c6a2a848c pacman: Fail fast when 'rc != 0'
We fail-fast and display 'stderr' in case 'pacman' returns with 'rc != 0'.
There is no point computing 'module._diff' in such case anyway.

Fixes #23910
2017-04-25 02:07:06 +02:00
Kai
58666c0ca4 Fix systemd in chroot (#23904)
* Fix systemd in chroot

The 'request ignored' message is in stderr, not stdout.

* Check both stdout and stderr for systemd message

Some versions of systemd report to stderr, others to stdout. Also check
whether output could be a valid normal response to avoid false positives.

(cherry picked from commit cb13aea88b)
2017-04-24 19:54:50 -04:00
Brian Coca
476e8c7136 avoid hosts 'pre templated warnings' (#23878)
* avoid hosts 'pre templated warnings'

fixed is_template failing on undefined
fixes #23057

* py3 compat

(cherry picked from commit a108f0fcd3)
2017-04-24 15:19:50 -04:00
Adrian Likins
2ca4155f23 Use sys.stdout.buffer to write vault bytes to stdout on py3 (#23760)
* Use sys.stdout.buffer to write vault bytes to stdout on py3

We need sys.stdout.buffer on py3 so we can write bytes to it since the plaintext
of the vaulted object could be anything/binary/etc

Before, attempting to write bytes to stdout on py3 would cause:

  TypeError: write() argument must be str, not bytes

(cherry picked from commit e0a7105c2d)
2017-04-24 10:13:22 -04:00
Brian Coca
4b5553c97f fix environment populated detection
fixes #23764

(cherry picked from commit 27185f44b0)
2017-04-21 18:21:17 -04:00
Brian Coca
0878f45a6c keep unsafe .. unsafe (#23742)
* keep unsafe .. unsafe

fixes #23734, which was broken in previous fix that allowed non string types to be templated
use new 'is_template' function vs bastardizing others
refactored clean_data to allow for arbitrary data structures to clean
fixed/removed some tests

(cherry picked from commit 4594bee65a)
2017-04-21 16:09:48 -04:00
Ganesh Nalawade
a71b6041f6 Fix display argument defualt value (#23859) (#23860)
(cherry picked from commit 04ae977f39)
2017-04-21 19:16:13 +05:30
Ricardo Carrillo Cruz
ee19b19984 Remove catch-all regex on IOS terminal plugin (#23858)
We have a list of specific messages that we scree-scrape and flag
them as legit errors.
However, we also have a catch-all regex that matches everything
starting with %.
That can cause issues on commands that return lines with that
character, like for example the 'crypto key generate'.

Fixes #23770
(cherry picked from commit 8517fbf936)
2017-04-21 15:31:17 +02:00
Ricardo Carrillo Cruz
a1c0c1582b Add assertion on test_iosxr_facts (#23852)
We hit bug #23737 due to bad coverage on test_iosxr_facts, we
were not checking memory facts at all.
(cherry picked from commit 60de93c31d)
2017-04-21 11:21:40 +02:00
Ricardo Carrillo Cruz
283f7f9e24 Fix the iosxr_facts mem gathering (#23850)
We were not calling match.group, plus we were lacking a ':' from
the expected output of 'show memory summary'.

Fixes #23737
(cherry picked from commit d0fd8cefaa)
2017-04-21 10:45:18 +02:00
Trishna Guha
1ea67950e1 Add eos_user module to users parameter (#23847) (#23849)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 8ec4882ba0)
2017-04-21 13:36:21 +05:30
Ganesh Nalawade
0d2d9f897c Add doc for display argument of junos_command (#23804)
(cherry picked from commit 01afe12cba)
2017-04-21 02:32:29 -04:00
Matt Davis
a021b4bd8b template hostvars for set_host_overrides (#23839)
* fixes #23586
* temporary solution until connection-specific vars are handled by play_context
(cherry picked from commit 02ed223d49)
2017-04-20 20:34:32 -07:00
Brian Coca
c05aa93739 Revert "fixes play context connection user (#21776)" (#23830)
* Revert "fixes play context connection user (#21776)"

This reverts commit 58ee661437.
fixes #23530

* preserve original in copy

updated comment to clarify wtf is going on here

(cherry picked from commit eb887b8062)
2017-04-20 18:03:21 -04:00
Brian Coca
62811bf134 also skip polling when async failed
(cherry picked from commit 94f0a4edd5dad15f720ec087f04f20bcbef1b97b)
2017-04-20 18:03:21 -04:00
Brian Coca
68fff4a4b5 script fails on async
(cherry picked from commit fe9af903f3)
2017-04-20 18:03:21 -04:00
Brian Coca
4567527249 fix vars file selection
fixes #17382
alternate to #22979

deal with cases in which group/host have . in name
updated as per feedbck
only be strict about extension when doing dirs
also avoid ~ endings

(cherry picked from commit 602a2bca1b)
2017-04-20 18:03:21 -04:00
Brian Coca
1fdeef511c finer grained failed/skipped on async for actions
fixes #23729

(cherry picked from commit 3965689328)
2017-04-20 18:03:21 -04:00
Brian Coca
bc990004e1 fix hashing when path is symlink
(cherry picked from commit 631a10745d)
2017-04-20 18:03:21 -04:00
Nathaniel Case
c9b0026cd0 Eos port default values (#23829)
* Hook port back up for eos cli transport

* The default values have moved

* Why not have conditional defaults?
2017-04-20 16:04:47 -04:00
Nathaniel Case
0609b9ded0 EOS default transport (#23824)
* Give a default to eos transport
2017-04-20 16:04:47 -04:00
Logan Attwood
d74509a235 Use isfile check on package manager paths
(cherry picked from commit 5bbf0d9cb6)
2017-04-20 07:43:25 -07:00
John R Barker
c84a332531 Add guide for Packet host (#21346) (#23807)
* Add guide for Packet host

* incorporate feedback from Packet

* Format headings according to Python doc guide

* fixed rstcheck issues in packet guide

(cherry picked from commit 0b585ec4fd)
2017-04-20 15:01:21 +01:00
Trishna Guha
cc59d89538 Add eos_banner as module to banner param (#23789) (#23798)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit b2129a7d3a)
2017-04-20 16:34:40 +05:30
John R Barker
b7ba7d40ae Show UUID instead of name when using UUID to select snapshot (#23787) (#23794)
(cherry picked from commit 504a768636)
2017-04-20 11:12:58 +01:00
John R Barker
0347dcda05 Minor typo in vmware_guest_facts (#23791) (#23793)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit cc745b0224)
2017-04-20 11:07:16 +01:00
Ricardo Carrillo Cruz
81efc176f4 Add missing provider to eos_banner basic-motd eapi test (#23396)
Otherwise this stalls and timeouts, it doesn't have creds to run.
(cherry picked from commit 2cc2b8fb4d)
2017-04-20 10:57:54 +02:00
Ricardo Carrillo Cruz
79492a9d2d Check for proper response key on eos_banner map_config_to_obj (#23399)
If we run the task with 'login' banner, the 'show banner' command
will return a dict containing key 'loginBanner'.
However for motd, it will just return 'motd'.
Yay naming consistency!
(cherry picked from commit ba7ba7adc3)
2017-04-20 10:57:22 +02:00
Ricardo Carrillo Cruz
a769f0b0f4 Do not assert session name on idempotent eos banner (#23402)
* Check for proper response key on eos_banner map_config_to_obj

If we run the task with 'login' banner, the 'show banner' command
will return a dict containing key 'loginBanner'.
However for motd, it will just return 'motd'.
Yay naming consistency!

* Do not assert session exists on eos_banner response not changing device

(cherry picked from commit 13b2f11139)
2017-04-20 10:57:05 +02:00
Timo Benk
b9ee0c5477 fix ansible galaxy file mangling (#23703)
without this patch, ansible-galaxy will mangle files containing
the archive parent directory name, eg 'owncloud/files/owncloud.cron'
will become 'owncloud/files/.cron'.

The previous code could affect the entire path and even filenames.
If a file path has the top level dir name as a substring, galaxy
replaces it with ''. In one example, the archive top level dir
is 'go', so 'files/go-bin.sh' becomes 'files/-bin.sh'.

Fixes #22572, #23694, #23623
(cherry picked from commit 79943b86a1)
2017-04-19 14:17:18 -04:00
Alexander Gubin
d7c8d8ab4d Fix example fact(ansible_default_ipv4.address) for delegated_facts
(cherry picked from commit d04a5246de)
2017-04-19 11:00:40 -07:00
Bart van Bragt
898650d6bc Remove whitespace from unix group names
(cherry picked from commit d0e3d75381)
2017-04-19 09:43:34 -07:00
John R Barker
27073dd9bd Fix for setting values using gconftool-2 (#23713) (#23740)
Miscallenous fixes added to make gconftool-2 work.

Fixes https://github.com/ansible/ansible/issues/23670

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 27f776f97d)
2017-04-19 14:25:32 +01:00
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)
2017-04-18 22:57:22 +05:30
Ganesh Nalawade
db738e0a2d Remove Warning for provider (#23652) (#23714)
(cherry picked from commit b8507b676b)
2017-04-18 22:49:23 +05:30
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)
2017-04-18 13:08:59 -04:00
Matt Martz
8e1b422e4a When become_method is su, self._play_context.prompt is a function. Fixes #23689
(cherry picked from commit f82d95ae28)
2017-04-18 13:02:12 -04:00
Nathaniel Case
82dcaa725f pep8 fix for Shippable 2017-04-18 11:45:43 -04:00
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)
2017-04-18 11:39:55 -04:00