Commit graph

7225 commits

Author SHA1 Message Date
nitzmahone
60a8af95a5 bump core submodule ref 2016-06-27 09:00:25 -07:00
Brian Coca
1b7b1ca15e if seconds are specified, min is 1 2016-06-27 09:36:15 -04:00
Peter Sprygada
d83962d3f5 Merge pull request #15992 from ogenstad/asa
Module util, template action and doc fragment for Cisco ASA
2016-06-27 06:32:12 -07:00
Matt Clay
c2a5cb6174 Fix junit callback plugin for Python 2.6. (#16440) 2016-06-24 14:22:27 -07:00
James Cammarata
04fca42b62 Fixing issues with getattr caused by 5a3493b 2016-06-24 15:43:03 -05:00
Toshio Kuratomi
9330edd6b9 Update submodule refs 2016-06-24 09:01:40 -07:00
Peter Sprygada
32b605f603 Merge pull request #16422 from privateip/network
bug fix changes Config class in network to only raise exceptions
2016-06-23 16:15:20 -07:00
Peter Sprygada
02902325b4 Merge pull request #16424 from privateip/vyos
initial commit of vyos shared module with Cli transport
2016-06-23 16:15:07 -07:00
James Cammarata
948682dbe2 Fix off-by-one error with retries
Fixes #16408
2016-06-23 18:07:11 -05:00
James Cammarata
3e4755f7e4 Remove unnecessary role initialization and lookup stuff
* Remove unnecessary copying of values from parents to role deps, as
  this can cause problems when roles have multiple parents (or the same
  parents with different params speficied through deps)
* Since we're already checking the dep chain in the block for role
  things (which every task in a role should have), it is not necessary
  to check the role directly in case it improperly grabs something

Fixes #14438
2016-06-23 17:00:01 -05:00
nitzmahone
ac04ffb9b1 apply @zazard's fix to parent attribute lookup 2016-06-23 14:11:07 -07:00
Peter Sprygada
77922f82e2 initial commit of vyos shared module with Cli transport
This adds support for the VyOS network operating system using the
Cli transport.   This module will simplify building VyOS based
modules in Ansible
2016-06-23 12:27:33 -07:00
James Cammarata
c24c0f5f6b Properly wrap objects using json default encoder
Our custom encoder for the to_json filter was simply returning the
object if it was not a HostVars object, leading in some cases to a
TypeError when the data contained an undefined variable. This lead
to an odd error message being propagated up, so we now properly catch
this as an undefined variable error.

Fixes #15610
2016-06-23 09:19:32 -05:00
w1r0x
7d24e6e95c Fixes #12309 (#14121) 2016-06-23 09:02:34 -04:00
James Cammarata
3ea3fa8d46 Merge pull request #14639 from ivovangeel/find_mount_point-bug
Fixed bug in find_mount_point function
2016-06-22 22:38:54 -05:00
nitzmahone
5f9ca67685 bump extras submodule ref for test failures 2016-06-22 17:27:16 -07:00
nitzmahone
76633ddc4c bump submodule refs 2016-06-22 17:21:54 -07:00
James Cammarata
7c27f72515 Merge pull request #14356 from mludvig/session_token
Add support for AWS_SESSION_TOKEN environment variable. (trivial patch)
2016-06-22 18:51:09 -05:00
Peter Sprygada
107c13759e changes Config class in network to only raise exceptions
The Config class should not call fail_json but simply raise exceptions
and allow the implementor to handle the exception
2016-06-22 09:22:50 -05:00
Toshio Kuratomi
39c543e356 Use find -exec + so that failures will be visible in find's exit code (#16389)
Fixes #16385
2016-06-22 05:42:37 -07:00
James Cammarata
4c1601e9f2 Take previously failed/unreachable hosts into account when checking the batch
Again, as we're carrying failed/unreachable hosts forward from play to play via
internal structures, we need to remember which ones had previously failed so that
unrelated host failures don't inflate the numbers for a given serial batch in the
PlaybookExecutor causing a premature exit.

Fixes #16364
2016-06-21 16:47:38 -05:00
James Cammarata
aefa12a20f Merge pull request #13709 from traveloka/credstash-support-encr-context
Make credstash lookup plugin support encryption contexts
2016-06-21 11:00:43 -05:00
James Cammarata
15e648dd94 Fix handler listeners as a list
The listen statement on handlers should have supported a list, however
it was broken in the revision of the pub/sub feature based on the handler
revamp. This patch corrects the bug, so this works again:

- name: some handler
  ...
  listen:
  - some target
  - another target

Fixes #16378
2016-06-21 10:00:10 -05:00
James Tanner
b1d32e6e32 Update submodule refs 2016-06-20 18:08:20 -04:00
nitzmahone
2bf9f593b5 bump submodule refs 2016-06-20 13:09:57 -07:00
James Cammarata
96a96b0e97 Merge pull request #16360 from agaffney/old_style_module_args_quoting
Fix quoting of args for old-style modules
2016-06-20 12:42:47 -05:00
Nathaniel Case
5dccff29bf Network Module: EOS (#16158)
* add new module network

* move EOS to NetworkModule

* shell.py Python 3.x compatibility

* implements the Command class through the connection for eos

This implements a new Command class that specifies the cli command
and output format.  This removes the need to batch commands through
the connection

* initial add of netcmd module
2016-06-20 12:11:48 -04:00
James Cammarata
17447ff035 Fixing typo in base strategy code from handler listen feature merge 2016-06-20 09:47:43 -05:00
James Cammarata
ca6ee4c789 FEATURE: handler listeners
Fixes ansible/proposals#8
2016-06-20 09:30:20 -05:00
James Cammarata
8218591fec Track notified handlers by object rather than simply their name
Due to the fact that roles may be instantiated with different sets of
params (multiple inclusions of the same role or via role dependencies),
simply tracking notified handlers by name does not work. This patch
changes the way we track handler notifications by using the handler
object itself instead of just the name, allowing for multiple internal
instances. Normally this would be bad, but we also modify the way we
search for handlers by first looking at the notifying tasks dependency
chain (ensuring that roles find their own handlers first) and then at
the main list of handlers, using the first match it finds.

This patch also modifies the way we setup the internal list of handlers,
which should allow us to correctly identify if a notified handler exists
more easily.

Fixes #15084
2016-06-20 09:30:20 -05:00
Andrew Gaffney
a64f7fd602 Fix quoting of args for old-style modules
This removes the extra layer of quotes around values in the 'args' file.
These quotes were there before the pipes.quote() call was added, but
were not removed, resulting in too much quoting.
2016-06-19 19:21:25 +00:00
jctanner
1db02dfb71 If decryption of a vaulted file failed, include the filename in the error. (#16329)
Fixes #16327
2016-06-18 09:30:08 -04:00
James Cammarata
8ee851cd95 Merge pull request #13460 from yesbox/devel
Adds support for converting a MAC address to an integer
2016-06-18 08:16:12 -05:00
James Cammarata
4bc85e150a Merge pull request #12807 from Lujeni/devel
Ansible-galaxy requirements support a include directive
2016-06-18 07:50:59 -05:00
James Cammarata
20754c1094 Allow groups to be specified using YAML list syntax for add_host
Fixes #12622
2016-06-18 07:47:10 -05:00
Zempashi
af150ea43a Fix linux 'ip' stdout parsing. (#16170)
With network-manager in debian (stretch) and openvpn connection enabled
the output for ipv6 is different and include a 'peer' keyword.

Fixes #15448
2016-06-17 17:10:45 -04:00
Nate Coraor
706778ee7f Fix distro detection for Solaris derivatives 2016-06-17 16:54:52 -04:00
art-at-sky
38590fbab9 Fix string coercion problem in error handling code 10:50 (#16270)
Manifests as the following stack trace
  File "/usr/local/Cellar/ansible/2.0.1.0/libexec/lib/python2.7/site-packages/ansible/utils/display.py", line 259, in error
      new_msg = u"ERROR! " + msg
      TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found
2016-06-17 12:02:01 -07:00
Mark Szymanski
2b0d0d0323 Allowing changed colour to be set properly from ansible.cfg (#16338) 2016-06-17 12:26:20 -04:00
Toshio Kuratomi
bef1971ffe Update core submodule for wait_for fix 2016-06-17 07:09:00 -07:00
Toshio Kuratomi
6cb8fdeaf2 Use find instead of -R for recursive setfacl (#16340)
(-R is not present on Solaris or freebsd setfacl)

Fixes #16322
2016-06-17 10:00:21 -04:00
James Tanner
a5046a3ffe Update submodule refs 2016-06-17 09:59:21 -04:00
Matt Davis
5900571273 Merge pull request #16296 from ccin2p3/hotfix/issue_16295
Properly template task names in free strategy
2016-06-16 10:53:56 -07:00
Matt Davis
9e2e2b1c54 Merge pull request #16279 from md5/show-facl-error
Show stderr when there is an error calling setfacl
2016-06-16 09:58:24 -07:00
nitzmahone
0a0b44baeb bump submodule refs 2016-06-15 14:50:52 -07:00
Toshio Kuratomi
a3959644ee Change the default of module_set_locale to False. (#16313)
This makes Ansible no longer set LC_ALL for remote systems.  It is up to
the individual modules to set LC_ALL if they need it for screenscraping
the output from a program.

This is the 2.2 followup for #15138
2016-06-15 14:21:04 -04:00
Colin Hoglund
5a2b34e159 allow spaces before the filter string (#16312) 2016-06-15 14:17:17 -04:00
Toshio Kuratomi
e088193599 Update submodule refs 2016-06-15 10:36:01 -07:00
Toshio Kuratomi
16211e7dab Check that required arguments src and dest are present.
Fixes #16301
2016-06-15 09:37:09 -07:00
Adrian Likins
a7639896a2 Delete currently unused code. (#16290)
This was kind of confusing, and also caused sphinx-apidoc
to throw strange errors.
2016-06-15 12:07:40 -04:00
Brian Coca
13d52ae438 subref update 2016-06-15 11:25:12 -04:00
Brian Coca
4acac55d23 add executable if none exists when become
this is needed as become adds commands that require shell
2016-06-15 11:24:16 -04:00
elotje
8c7ceaab81 Unprivileged become on HP-UX/UNIX (Fixes #16249) (#16275)
Problem: When setting the file permissions on the remote server for
unprivileged users ansible expects that a chown will fail for unprivileged
users. For some systems (e.g. HP-UX) this is not the case.

Solution: Change the order how ansible sets the remote permissions.
* If the remote_user sudo's to an unprivileged user then we attempt to
  grant the unprivileged user access via file system acls.
* If granting file system acls fails we try to change the owner of the
  file with chown which only works in case the remote_user is privileged
  or the remote systems allows chown calls by unprivileged users (e.g.
  HP-UX)
* If the chown fails we can set the file to be world readable so that
  the second unprivileged user can read the file. Since this could allow
  other users to get access to private information we only do this
  ansible is configured with "allow_world_readable_tmpfiles" in the
  ansible.cfg
2016-06-15 08:16:24 -07:00
Adrian Likins
f819bb524a zone plugin updates for newer api (#16289)
Fixes errors on import.
2016-06-15 07:37:38 -07:00
Toshio Kuratomi
c4838286ac Make sure we don't end up with an empty PYTHONPATH (#16240)
When the PYTHONPATH is an empty string python will treat it as though
the cwd is in the PYTHONPATH.  This can be undesirable.  So make sure we
delete PYTHONPATH from the environment altgether in this case.

Fixes #16195
2016-06-15 07:02:56 -07:00
Remi Ferrand
9c3447c619 Properly template task names in free strategy
* Fixes #16295
2016-06-15 09:49:04 +02:00
jctanner
dc9b53a6aa Add further commentary about synchronize process_remote. (#16292)
Addresses #16284
2016-06-14 20:20:19 -04:00
Sergei Smolianinov
9753cac530 Fix synchronize module incorrect remote host processing. (#15993)
Fixes  #15539
2016-06-14 19:37:26 -04:00
biancalana
e143d3a75b Better FreeBSD distribution facts (#15866)
* - Give more usable content to distribution_version and set distribution_major_version

* Make python 2.4 friendly
2016-06-14 17:58:23 -04:00
Toshio Kuratomi
8c8e064828 Be more lenient of symlinked /bin/sh inside the chroot (#16239)
Symlinks inside of the chroot were failng because we weren't able to
    determine if they were pointing to a real file or not.  We could write
    some complicated code to walk the symlink path taking into account where
    the root of the tree is but that could be fragile.  Since this is just
    a sanity check, instead we just assume that the chroot is fine if we
    find that /bin/sh in the chroot is a symlink.  Can revisit if it turns
    out that many chroots have a /bin/sh that's a broken symlink.

    Fixes #16097
2016-06-14 12:03:59 -07:00
nitzmahone
9dcfa468f7 bump core submodule ref 2016-06-14 11:37:22 -07:00
Brian Coca
90ae3f4d6d removed duplicate constants setting
also it had a non ANSIBLE_ env var
2016-06-14 13:15:47 -04:00
Mike Dillon
17372244d4 Show stderr when there is an error calling setfacl 2016-06-14 09:29:20 -07:00
Jiri Tyr
27d065924f Adding custom indentation of YAML and JSON filters (#10008) 2016-06-14 10:07:34 -04:00
ben-taylor-nzme
e1d248dddf fix error message (#16264)
The error was: TypeError: fail_json() takes exactly 1 argument (2 given)
2016-06-14 10:02:07 -04:00
Brian Coca
07846f7bec ignore closing file error when file not open
fixes #16268
2016-06-14 09:34:41 -04:00
Peter Sprygada
59e1bb3e6e fixes using ssh keyfile with junos network module
The junos network module will now properly use the ssh key file if its
passed from the playbook to authenticate to the remote device.  Prior
to this commit, the ssh keyfile was ignored.
2016-06-13 22:39:51 -04:00
Toshio Kuratomi
a88919c751 Update submodule refs 2016-06-13 12:05:42 -07:00
Toshio Kuratomi
0e98ce11c4 Comment on is_executable's limitations and change logic to only use bit-manipulations
This is clearer to anyone who understands that unix file modes are bitfields.
2016-06-13 09:43:51 -07:00
Toshio Kuratomi
facea1ff0c Remove unneeded pass 2016-06-13 09:43:51 -07:00
Toshio Kuratomi
9273e1e7c7 Update submodule refs 2016-06-13 08:00:22 -07:00
Toshio Kuratomi
94dc4554db Workaround bad interaction with .pth files. (#16238)
When setuptools installs a python module (as is done via python setup.py
install)  It puts the module into a subdirectory of site-packages and
then creates an entry in easy-install.pth to load that directory.  This
makes it difficult for Ansiballz to function correctly as the .pth file
overrides the sys.path that the wrapper constructs.  Using
sitecustomize.py fixes this because sitecustomize overrides the
directories handled in .pth files.

Fixes #16187
2016-06-13 07:56:18 -07:00
René Moser
7aca70b4b0 cloudstack: simplify tag handling (#16188)
Fixes tag support in projects.
2016-06-13 08:27:27 +02:00
nitzmahone
445a88d3e8 call base _connect() from winrm._connect()
without it, we don't get the base's free become method error check
2016-06-10 14:40:29 -07:00
Brian Coca
734bbcb1d3 better handling of retry files 2016-06-10 14:03:22 -04:00
Brian Coca
de18566882 made ssh compression configurable (#16214)
AIX ssh does not seem to like compression, moved it to ssh_args
to allow making it configurable. Note that those using ssh_args
already will need to add it explicitly to keep compression.
2016-06-10 13:17:49 -04:00
nitzmahone
ece1ed09d5 fix for psuedo-connection hostvars not propagating to connection
(mostly done by jimi-c, tested working)
2016-06-10 10:14:41 -07:00
Dag Wieers
04ce71b4bd Give a module the possibility to known its own name (#16087)
* Give a module the possibility to known its own name

This is useful for logging and reporting and fixes the longstanding problem with syslog-messages:

    May 30 15:50:11 moria ansible-<stdin>: Invoked with ...

now becomes:

    Jun  1 17:32:03 moria ansible-copy: Invoked with ...

This fixes #15830

* Rename the internal name from module.ansible_module_name to module._name
2016-06-10 11:48:54 -04:00
Brian Coca
a529a60478 raw should not use default executable (#16085)
also removed unused cruft in script
2016-06-10 11:37:58 -04:00
J. Javier Maestro
828b73dd2d Fix: create retry_files_save_path if it doesn't exist (#15659)
* Fix: create retry_files_save_path if it doesn't exist

Ansible documentation states that retry_files_save_path directory will be
created if it does not already exist. It currently doesn't, so this patch
fixes it :)

* Use makedirs_safe to ensure thread-safe dir creation

@bcoca suggested to use the makedirs_safe helper function :)
2016-06-10 09:30:06 -04:00
Toshio Kuratomi
10860c50bd Update submodule refs for revert of git change 2016-06-09 14:50:13 -07:00
Brian Coca
4625bd2de5 updated submodule refs 2016-06-09 15:18:29 -04:00
Brian Coca
c376954ecf avoid processing bad mtab entries (#16206)
fixes #16174
2016-06-09 15:05:06 -04:00
Toshio Kuratomi
1b58b55346 Update submodule refs 2016-06-09 08:56:52 -07:00
jctanner
02e52c319c Force an include to be a static task if no vars or loops are being used. (#16192)
Fixes #15735
2016-06-08 19:23:48 -04:00
James Cammarata
b51d0dd69b Fix hostvars lookup of locahost based on 5f1bbb4 2016-06-08 14:14:02 -05:00
James Cammarata
5f1bbb4fcd There can be only one localhost
The changes to exclude implicit localhosts from group patterns exposed
the bug that we sometimes create multiple implicit localhosts, which
caused some bugs with things like includes, where the host was used as
an entry into a dict, so having multiple meant that the incorrect host
(with a different uuid) was found and includes were not executed for
implicit localhosts.
2016-06-08 13:03:52 -05:00
James Cammarata
fbec2d9692 Expand return code values returned by TQM and strategies
This allows the PlaybookExecutor to receive more information regarding
what happened internal to the TaskQueueManager and strategy, to determine
things like whether or not the play iteration should stop.

Fixes #15523
2016-06-08 10:21:57 -05:00
Peter Sprygada
178cfd142b fixes issue with ssh keyfile and nxos authentication
The nxos cli provider would not properly handle ssh key files passed
from the playbook task.   The ssh_keyfile argument is now properly
passed to the ssh authentication method

This fix address the bug reported in #3862
2016-06-07 21:01:34 -04:00
nitzmahone
d91315f2a0 bump submodule refs 2016-06-07 17:15:19 -07:00
James Cammarata
f9803bfcc9 Revert "don't tempalte register"
This reverts commit 7ba790bbaf.

Fixes #15700
2016-06-07 13:38:26 -05:00
James Cammarata
068e447fda Further tweaks to variable precedence to make it match our docs
Also removes looking at role variables from the Block, as those are
merged in separately via VariableManager
2016-06-07 12:08:01 -05:00
James Cammarata
b37b51dcea Fix variable precedence issue where set facts beat role params
Also updates doc on variable precedence, as it was incorrect for the
order of play vars/vars_prompt/vars_files in relation to set_fact and
registered variables.

Fixes #14702
Fixes #14826
2016-06-07 11:25:02 -05:00
James Cammarata
fa368934bd Create state in PlayIterator for unknown hosts rather than raise errors
Since we now use the PlayIterator to carry forward failures from previous
play executions, in the event that some hosts which had previously failed
are not in the current inventory we now create a stub state instead of
raising an error.
2016-06-07 09:42:39 -05:00
Brian Coca
f76befdb9a fix issues when state is not supplied 2016-06-07 10:29:24 -04:00
Krzysztof Magosa
721da46842 fix: playbook_on_task_start expects name and not task object (#16168) 2016-06-07 09:43:01 -04:00
Ritesh Khadgaray
ef9238ab85 set remote_user to default if none is found when using delegate_to (#16138) 2016-06-07 09:36:17 -04:00
Peter Sprygada
596b32f31e Merge pull request #16148 from privateip/working
fixes issues with authenticating using ssh-agent for ios devices
2016-06-07 06:31:46 -04:00
Brian Coca
6f36909074 service now passes 'started' instead of 'running'
other modules don't have to implement this directly
also updated docs to prefer 'started'.
fixes #16145
2016-06-06 22:30:04 -04:00
Trond Hindenes
ad4eb751a5 moved pending reboot to powershell.ps1 2016-06-06 23:18:51 +02:00