Commit Graph

7370 Commits (1268f4778dd8cd75112f80c2307ce80c51851db5)

Author SHA1 Message Date
Toshio Kuratomi 9330edd6b9 Update submodule refs 9 years ago
Peter Sprygada 32b605f603 Merge pull request #16422 from privateip/network
bug fix changes Config class in network to only raise exceptions
9 years ago
Peter Sprygada 02902325b4 Merge pull request #16424 from privateip/vyos
initial commit of vyos shared module with Cli transport
9 years ago
James Cammarata 948682dbe2 Fix off-by-one error with retries
Fixes #16408
9 years ago
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
9 years ago
nitzmahone ac04ffb9b1 apply @zazard's fix to parent attribute lookup 9 years ago
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
9 years ago
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
9 years ago
w1r0x 7d24e6e95c Fixes #12309 (#14121) 9 years ago
James Cammarata 3ea3fa8d46 Merge pull request #14639 from ivovangeel/find_mount_point-bug
Fixed bug in find_mount_point function
9 years ago
nitzmahone 5f9ca67685 bump extras submodule ref for test failures 9 years ago
nitzmahone 76633ddc4c bump submodule refs 9 years ago
James Cammarata 7c27f72515 Merge pull request #14356 from mludvig/session_token
Add support for AWS_SESSION_TOKEN environment variable. (trivial patch)
9 years ago
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
9 years ago
Toshio Kuratomi 39c543e356 Use find -exec + so that failures will be visible in find's exit code (#16389)
Fixes #16385
9 years ago
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
9 years ago
James Cammarata aefa12a20f Merge pull request #13709 from traveloka/credstash-support-encr-context
Make credstash lookup plugin support encryption contexts
9 years ago
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
9 years ago
James Tanner b1d32e6e32 Update submodule refs 9 years ago
nitzmahone 2bf9f593b5 bump submodule refs 9 years ago
James Cammarata 96a96b0e97 Merge pull request #16360 from agaffney/old_style_module_args_quoting
Fix quoting of args for old-style modules
9 years ago
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
9 years ago
James Cammarata 17447ff035 Fixing typo in base strategy code from handler listen feature merge 9 years ago
James Cammarata ca6ee4c789 FEATURE: handler listeners
Fixes ansible/proposals#8
9 years ago
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
9 years ago
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.
9 years ago
jctanner 1db02dfb71 If decryption of a vaulted file failed, include the filename in the error. (#16329)
Fixes #16327
9 years ago
James Cammarata 8ee851cd95 Merge pull request #13460 from yesbox/devel
Adds support for converting a MAC address to an integer
9 years ago
James Cammarata 4bc85e150a Merge pull request #12807 from Lujeni/devel
Ansible-galaxy requirements support a include directive
9 years ago
James Cammarata 20754c1094 Allow groups to be specified using YAML list syntax for add_host
Fixes #12622
9 years ago
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
9 years ago
Nate Coraor 706778ee7f Fix distro detection for Solaris derivatives 9 years ago
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
9 years ago
Mark Szymanski 2b0d0d0323 Allowing changed colour to be set properly from ansible.cfg (#16338) 9 years ago
Toshio Kuratomi bef1971ffe Update core submodule for wait_for fix 9 years ago
Toshio Kuratomi 6cb8fdeaf2 Use find instead of -R for recursive setfacl (#16340)
(-R is not present on Solaris or freebsd setfacl)

Fixes #16322
9 years ago
James Tanner a5046a3ffe Update submodule refs 9 years ago
Matt Davis 5900571273 Merge pull request #16296 from ccin2p3/hotfix/issue_16295
Properly template task names in free strategy
9 years ago
Matt Davis 9e2e2b1c54 Merge pull request #16279 from md5/show-facl-error
Show stderr when there is an error calling setfacl
9 years ago
nitzmahone 0a0b44baeb bump submodule refs 9 years ago
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
9 years ago
Colin Hoglund 5a2b34e159 allow spaces before the filter string (#16312) 9 years ago
Toshio Kuratomi e088193599 Update submodule refs 9 years ago
Toshio Kuratomi 16211e7dab Check that required arguments src and dest are present.
Fixes #16301
9 years ago
Adrian Likins a7639896a2 Delete currently unused code. (#16290)
This was kind of confusing, and also caused sphinx-apidoc
to throw strange errors.
9 years ago
Brian Coca 13d52ae438 subref update 9 years ago
Brian Coca 4acac55d23 add executable if none exists when become
this is needed as become adds commands that require shell
9 years ago
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
9 years ago
Adrian Likins f819bb524a zone plugin updates for newer api (#16289)
Fixes errors on import.
9 years ago
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
9 years ago
Remi Ferrand 9c3447c619 Properly template task names in free strategy
* Fixes #16295
9 years ago
jctanner dc9b53a6aa Add further commentary about synchronize process_remote. (#16292)
Addresses #16284
9 years ago
Sergei Smolianinov 9753cac530 Fix synchronize module incorrect remote host processing. (#15993)
Fixes  #15539
9 years ago
biancalana e143d3a75b Better FreeBSD distribution facts (#15866)
* - Give more usable content to distribution_version and set distribution_major_version

* Make python 2.4 friendly
9 years ago
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
9 years ago
nitzmahone 9dcfa468f7 bump core submodule ref 9 years ago
Brian Coca 90ae3f4d6d removed duplicate constants setting
also it had a non ANSIBLE_ env var
9 years ago
Mike Dillon 17372244d4 Show stderr when there is an error calling setfacl 9 years ago
Jiri Tyr 27d065924f Adding custom indentation of YAML and JSON filters (#10008) 9 years ago
ben-taylor-nzme e1d248dddf fix error message (#16264)
The error was: TypeError: fail_json() takes exactly 1 argument (2 given)
9 years ago
Brian Coca 07846f7bec ignore closing file error when file not open
fixes #16268
9 years ago
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.
9 years ago
Toshio Kuratomi a88919c751 Update submodule refs 9 years ago
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.
9 years ago
Toshio Kuratomi facea1ff0c Remove unneeded pass 9 years ago
Toshio Kuratomi 9273e1e7c7 Update submodule refs 9 years ago
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
9 years ago
René Moser 7aca70b4b0 cloudstack: simplify tag handling (#16188)
Fixes tag support in projects.
9 years ago
nitzmahone 445a88d3e8 call base _connect() from winrm._connect()
without it, we don't get the base's free become method error check
9 years ago
Brian Coca 734bbcb1d3 better handling of retry files 9 years ago
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.
9 years ago
nitzmahone ece1ed09d5 fix for psuedo-connection hostvars not propagating to connection
(mostly done by jimi-c, tested working)
9 years ago
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
9 years ago
Brian Coca a529a60478 raw should not use default executable (#16085)
also removed unused cruft in script
9 years ago
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 :)
9 years ago
Toshio Kuratomi 10860c50bd Update submodule refs for revert of git change 9 years ago
Brian Coca 4625bd2de5 updated submodule refs 9 years ago
Brian Coca c376954ecf avoid processing bad mtab entries (#16206)
fixes #16174
9 years ago
Toshio Kuratomi 1b58b55346 Update submodule refs 9 years ago
jctanner 02e52c319c Force an include to be a static task if no vars or loops are being used. (#16192)
Fixes #15735
9 years ago
James Cammarata b51d0dd69b Fix hostvars lookup of locahost based on 5f1bbb4 9 years ago
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.
9 years ago
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
9 years ago
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
9 years ago
nitzmahone d91315f2a0 bump submodule refs 9 years ago
James Cammarata f9803bfcc9 Revert "don't tempalte register"
This reverts commit 7ba790bbaf.

Fixes #15700
9 years ago
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
9 years ago
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
9 years ago
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.
9 years ago
Brian Coca f76befdb9a fix issues when state is not supplied 9 years ago
Krzysztof Magosa 721da46842 fix: playbook_on_task_start expects name and not task object (#16168) 9 years ago
Ritesh Khadgaray ef9238ab85 set remote_user to default if none is found when using delegate_to (#16138) 9 years ago
Peter Sprygada 596b32f31e Merge pull request #16148 from privateip/working
fixes issues with authenticating using ssh-agent for ios devices
9 years ago
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
9 years ago
Trond Hindenes ad4eb751a5 moved pending reboot to powershell.ps1 9 years ago
James Cammarata e36b4014f5 Merge pull request #15958 from Schnitzel/taskinclude_handler
new HandlerTaskInclude Class which can run TaskIncludes inside Handlers
9 years ago
Adrian Likins 7eec99a140 Merge pull request #16154 from vlna/patch-1
Typo fix: Kuraotmi -> Kuratomi
9 years ago
James Cammarata b33aeee2f0 Merge branch 'andreyshestakov-devel' into devel 9 years ago
James Cammarata add2d1947e Fix recursive call of _load_inventory_file() in VariableManager
Fixes #16128
9 years ago
James Cammarata 1f18f5c92d Tweak the poll time to 0.005 to improve perf with large playbooks 9 years ago
James Cammarata b9e743b478 Merge branch 'devel' of https://github.com/andreyshestakov/ansible into andreyshestakov-devel 9 years ago
James Cammarata 560532da7d Make sure we add host/group vars files when parsing inventory
Also fixes a bug where add_host was not adding the vars files

Fixes #16117
9 years ago
Brian Coca 2a984bbc98 much more fine grained error messages
fixes #16039
9 years ago
rdezavalia a7274774ed Support etcd v2. Use this version by default (#12312)
* Support etcd v2. Use this version by default

* default to etcd v1
9 years ago
vlna 53ac89e40d Typo fix: Kuraotmi -> Kuratomi 9 years ago
Peter Sprygada 0a87651fc5 fixes issues with authenticating using ssh-agent for ios devices
Exception was raised when trying to use ssh-agent for authentication to
ios devices.   This fix enables ssh-agent and enable use of password
protected ssh keys.  There is one additional fix to capture authentication
exceptions nicely.
9 years ago
James Cammarata d21cd16a91 Change uses of unicode() to to_unicode() in inventory/__init__.py 9 years ago
James Cammarata 879dc3a687 Mark implicitly hosts as such and exclude them from the all group
Fixes #16059
9 years ago
Toshio Kuratomi 5a3493be5f Port urls.py to python3 and other byte vs text fixes (#16124)
* Port urls.py to python3

Fixes (largely normalizing byte vs text strings) for python3

* Rework what we do with attributes that aren't set already.

* Comments
9 years ago
nitzmahone 434c949d03 update azure minimum doc fragment 9 years ago
nitzmahone d1b611a730 updates for Azure SDK 2.0.0rc4 9 years ago
Toshio Kuratomi 4fe8fe303f Update submodule refs 9 years ago
Toshio Kuratomi 80c36bef9f Update submodule refs 9 years ago
Toshio Kuratomi 3bac945147 Fix the copy action to not send the content as a param. (#16127)
Has already been transferred as a tempfile.

This fixes the error in https://github.com/ansible/ansible/issues/16125
but there may be higher level issues that should be fixed as well (other
modules might be able to cause status fields like failed and changed to
return a censored string instead of a bool).  So leaving 16125 open for
now.
9 years ago
nitzmahone 14fec788a1 bump core submodule ref 9 years ago
Matt Clay 7a533406f9 Merge pull request #13145 from Mic92/devel
lxc connection plugin
9 years ago
Brian Coca 85f4c95843 minor optimization 9 years ago
Brian Coca 2482c687b7 optimize openbsd pkg_mgr fact discovery 9 years ago
Brian Coca 44bd1db976 updated package to use minimal fact gathering
also fixed results handling of fact gathering
9 years ago
Michael Scherer f07d6b26a7 Show a better error message when there is too much arguments (#16119)
If someone run:

  ansible all -m file state=present

The error message is "Missing target hosts" which is misleading, since
the target hosts is here, the problem is the missing '-a'.
9 years ago
jctanner 2bf2e0fdfd Force relative role paths to be absolute and correct errors about missing path(s). (#16088)
Addresses #10811
9 years ago
James Cammarata 273a965dcc Fix the way host and group vars are loaded
* In the VariableManager, we were not properly tracking if a file
  had already been loaded, so we continuously append data to the end
  of the list there for host and group vars, meaning large sets of data
  are duplicated multiple times
* In the inventory, we were merging the host/group vars with the vars
  local to the host needlessly, as the VariableManager already handles that.
  This leads to needless duplication of the data and makes combining the
  vars in VariableManager take even longer.
9 years ago
Bede Carroll 805e0ec529 Add validate_certs to vmware doc fragment (#16096) 9 years ago
Matt Clay 7edfeb3665 Add junit callback plugin. (#16089)
Add junit callback.
9 years ago
ogenstad 6027e5b580 Module util, template action and doc fragment for Cisco ASA 9 years ago
Adrian Likins 644f0fb190 Merge pull request #15178 from alikins/galaxy_info_output
galaxy info displayed 'galaxy_info' section wrong [fix for #15177]
9 years ago
Brian Coca 3387d557bc Revert "Add prefixing and suffixing fuctionality to assemble module" (#16084) 9 years ago
Matt Clay 10a07fcc26 Update submodule refs. 9 years ago
Chris Houseknecht ce34397cf8 Merge pull request #10399 from underyx/assemble-with-prefix-and-suffix
Add prefixing and suffixing fuctionality to assemble module
9 years ago
Bence Nagy fadef43af7 Add header and footer support to assemble action 9 years ago
Matt Clay 126bc40ecf Do not remove exception from result, hide output.
This allows all callback plugins access to exception details.
9 years ago
Adrian Likins 1468538414 galaxy info displayed 'galaxy_info' section wrong
The output of 'ansible-galaxy info' was formatting the
'galaxy_info' key with one char per line.

Previously, when building the output string, items in
role_info that had a dict for value, the label for
it's key ('galaxy_info' for ex) was being added to
the text list in addition to being appended. Only
the append is needed.

Also added a unit test in test/units/cli/test_galaxy.py,
but skip it on py3 until galaxy is py3 compatible.

fixes #15177
9 years ago
Brian Coca 4c3c294a03 fixed confusing reporting when no hosts are matched
it was hitting 'empty inventory' warning.
9 years ago
Brian Coca e63bf1d86e fix version/help when missing action
also fixed issues with galaxy cli options
9 years ago
Brian Coca eaa7b9c0b7 treat roles_path as the list it is for galaxy list 9 years ago
Andrey Shestakov 295c7ce1c8 Fix sleep intervals (14219) 9 years ago
Jörg Thalheim 88482234e6
lxc connection plugin 9 years ago
chouseknecht 38c99fa9d5
Bump ansible-modules-core submodule to commit 90e8a36d4c 9 years ago
Tobias Wolf 328b423a0e Solve performance issue with a large number of groups (#13957)
Ansible excessively checks the file system for the potential presence of
`group_vars` and `host_vars` files.

For large numbers of groups this leads to combinatorial performance
issues.

This commit generates a set of group_vars and host_vars filenames using
`os.listdir()` in every possible location and then checks against the sets
before making a stat of the file system.

Also included in this commit is caching of the base directory lookup
for the inventory.
9 years ago
Brian Coca 011320793b moved validate info from vvv to debug 9 years ago
Chris Houseknecht 2261b2e59a Fix missing ignore_certs (#16018) 9 years ago
Toshio Kuratomi c03555b650 Fix unarchive failures when the destination is a symlink to a directory (#15999)
Also add integration tests for this problem and unicode filenames inside
a tarball.

Fixes #3725
9 years ago
Matt Davis b5bb518279 Merge pull request #16012 from stpierre/list-like-choices
Modules: check for list-like choices in arg spec
9 years ago
Chris St. Pierre bfd69a7042 Modules: check for list-like choices in arg spec
This makes it possible to use anything other than a list (e.g., a
tuple, or dict.keys() in py3k) for argument_spec choices. It also
improves the error messages if you don't use a list type.
9 years ago
James Cammarata 3e03004b6f Use get_dep_chain() instead of directly using a blocks _dep_chain
Child blocks (whether nested or via includes) don't get a copy of the
dependency chain, so the above method should be used to ensure the block
looks at its parents dep chain.

Fixes #15996
9 years ago
Brian Coca 6a0a366746 fixed service fact usage 9 years ago
René Moser 176a207c61 Merge pull request #15974 from resmo/feature/vpc
cloudstack: add VPC support
9 years ago
Brian Coca 48d8fa0380 updated subrefs 9 years ago
Brian Coca 90cbb8c01b re-add the service action plugin (#13001)
* readd the service action plugin, was removed cause it created unexpected fact gathering and there are no split service plugins that would make this useful (yet)
Revert "removed action plugin as service facts and separate modules don't work yet and this forces gathering facts"

This reverts commit 7368030651.

* now only does minimal fact gathering
9 years ago
Toshio Kuratomi 3b69ef7e8b Add strings 'True' and 'False' as booleans as python bools converted to strings will look that way.
Workaround for custom modules which are using choices=BOOLEANS instead
of type='bool'.
9 years ago
Rene Moser 62c424797a cloudstack: add common network code
Also used for VPC support.
9 years ago
Toshio Kuratomi a2bef45cf6 Update submodule refs 9 years ago
Tim Rupp 9041a0fee9 Adds a general purpose Exception class for F5 modules (#15977)
This class can be used by F5 modules for raising exceptions.
This should be used to handle known errors and raise them so
that they can be printed in the fail_json method.

The common Exception class built-in should not be used because
it hides tracebacks that are necessary to have when debugging
problems with the module.
9 years ago
Brian Coca 52a0165c77 skip non executable inventory when no shebang (#15969)
alternate fix #15934
9 years ago
Rene Moser fe05c5e35a cloudstack: add VPC support 9 years ago
Michael Scherer cf44db58e0 Add SEQUENCETYPE to handle the dict_keys type (#15953)
On python 3, there is a specific type for dict keys
instead of list, so previous tests based on Sequence didn't
not work anymore.
9 years ago
Brian Coca c8f0cdbdfd renamed systemd detection function 9 years ago
James Cammarata 733d017ad0 Save and restore the loader's basedir when loading playbooks
Fixes #15930
9 years ago
Michael Scherer f9f6f24acd Add a alias for 'long' since python3 do not have it (#15952) 9 years ago
James Cammarata 72b29d122e When adding nested blocks, don't pass in any parent includes
We previously changed block behavior to prefer includes over parent
blocks, which broke inheritence in nested blocks.

Fixes #15926
9 years ago
Michael Schmid 566690a44a Fixes #15915: New HandlerTaskInclude Class which can run TaskIncludes inside Handlers 9 years ago
Toshio Kuratomi b75895df9b Fix the error handling for loop squashing to restore the name argument into the task args 9 years ago
nitzmahone a0ff49194e bump submodule refs 9 years ago
Brian Coca 4821dc66ad now we show path from which we load module on vvv
also added remote module location on debug
9 years ago
Brian Coca 38cca53669 return friendlier error when failing to make dirs 9 years ago
jctanner 5bb4ee0c1e Avoid duplicate system related fact calls. (#15716)
* Avoid duplicate system related fact calls.

Addresses #1461
9 years ago
Toshio Kuratomi 97791f8b4e Update submodule refs 9 years ago
Matt Davis aee3b2e430 Merge pull request #15919 from camradal/devel
Fix issue with latest pyvmomi and certificate validation
9 years ago
Peter Oliver 95cfceda98 Catch DistributionNotFound when pycrypto is absent (#15731)
* Catch DistributionNotFound when pycrypto is absent

On Solaris 11, module `pkg_resources` throws `DistributionNotFound` on import if `cryptography` is installed but `pycrypto` is not.  This change causes that situation to be handled gracefully.

I'm not using Paramiko or Vault, so I my understanding is that I don't
need `pycrpto`.  I could install `pycrypto` to make the error go away, but:
- The latest released version of `pycrypto` doesn't build cleanly on Solaris (https://github.com/dlitz/pycrypto/issues/184).
- Solaris includes an old version of GMP that triggers warnings every time Ansible runs (https://github.com/ansible/ansible/issues/6941).  I notice that I can silence these warnings with `system_warnings` in `ansible.cfg`, but not installing `pycrypto` seems like a safer solution.

* Ignore only `pkg_resources.DistributionNotFound`, not other exceptions.
9 years ago
Matt Clay bad293ae35 Add work-around for ssh pty race condition.
This should minimize loss of stdout when using
a pty and connecting with ssh or paramiko_ssh.
9 years ago
René Moser ff62d7bbbd docs: cloudstack: add cloudstack guide to doc fragments (#15898) 9 years ago
Toshio Kuratomi 8363ef43c9 Update submodule refs 9 years ago
Matt Davis ec2cb07988 Make 'required' optional in module docs (#15906)
Updated module dev docs, doc build, ansible-doc to match
9 years ago
James Cammarata 74a252d0a5 More playbook executor compatibility fixes
With some earlier changes, continuing to forward failed hosts on
to the iterator with each TQM run() call was causing plays with
max_fail_pct set to fail, as hosts which failed in previous plays
were counting those old failures against the % calculation.

Also changed the linear strategy's calculation to use the internal
failed list, rather than the iterator, as this now represents the
hosts failed during the current run only.
9 years ago
Toshio Kuratomi aad9f43dda Make load_params into a function that custom modules can access (#15913) 9 years ago
Peter Sprygada d197407306 Merge pull request #15743 from mattchilders/multi-parent-netcfg-difference
Fixed issue with parents havings depth of 3+ on add method of Network…
9 years ago
Toshio Kuratomi 61f2147385 Rename pycompat to pycompat24
This change makes it so we know when it is safe to get rid of the module
(when we stop supporting python2.4) and makes it easier for us to find
code that is using the functions in there to update.

If needed, we'll create a pycompat26 and pycompat27 as well.  These
files are for functions that are needed on that python version to write
portable code.  So python-2.4 compatible modules may need code in
pycompat24, python26+ modules may need code in pycompat26, etc.  If
a function is needed in multiple python versions, we should implement it
in an internal common file and use import to put it in the namespace for
each pycompatXY module.
9 years ago
James Cammarata f0e26d0b76 In TQM run() mark any entries in _failed_hosts as failed in the PlayIterator
As noted in the comment, the TQM may be used for more than one play. As such,
after creating the new PlayIterator object it is necessary to mark any failed
hosts from previous calls to run() as failed in the iterator, so they are
properly skipped during any future calls to run().
9 years ago
James Cammarata 0f659d699e Re-remove checking for failed state on hosts when building list of hosts
This was re-added by 63471cd (and modified by me to use iterator again),
it simply needs to be removed.

Fixes #15395
9 years ago
Vincent Roy 7a1309c98a Make sure that serial failures are handled correctly. 9 years ago
Vincent Roy 59d3ae6136 Don't let max_fail_percentage affect future plays. 9 years ago
Vincent Roy 994e57fa2b Handle max_fail_percentage per task. 9 years ago
Vincent Roy e193e80f04 Don't stop executing plays after failure.
https://github.com/ansible/ansible/pull/13750/files
9 years ago
Vincent Roy ba89b2a095 Backward compatibility execution failures with 1.9 9 years ago
Peter Sprygada 48aa9153f2 Merge pull request #15755 from ocadotechnology/fix-junos-netconf-ssh-agent
Allow ssh agent usage for junos_netconf
9 years ago
Peter Sprygada 9553dfdbab Merge pull request #15911 from keinohguchi/ops_rest_auth_fix
openswitch.py: Fix the OpenSwitch REST authentication
9 years ago
Peter Sprygada 114a0596aa Merge pull request #15727 from privateip/shell_module
handle name resolution errors more gracefully from shell.py
9 years ago
Kei Nohguchi 2043c32551 openswitch.py: Fix the OpenSwitch REST authentication
It's a cookie based authentication, that we get it
through /login endpoint, called by connect() method
and save the cookie for the rest of the call.
9 years ago
Toshio Kuratomi 73a2bddf84 Update submodule refs 9 years ago
Peter Sprygada 7cb7132b24 Merge pull request #15891 from privateip/fixes-ansible-modules-core-3502
bugfix for issue with trying to eval contains with non-string
9 years ago
Michael Scherer fb2355e47d Port rax.py to python3 compatible syntax (#15875)
Since the pyrax website say that only python 2.7 is tested,
I do not think it is worth to aim for python 2.4 compatibility
for the various rackspace modules.
9 years ago
Peter Sprygada 83d0a15588 bugfix for issue with trying to eval contains with non-string
fixes ansible/ansible-modules-core#3502
9 years ago
Brian Coca c648c95eb7 made format more flexible and allow for non dict entries 9 years ago
Peter Sprygada 8f7c879574 Merge pull request #15629 from privateip/fix-15496
make netcfg preserve command order
9 years ago
Rob ba63ccb880 Handle case of both Key and key (#15468) 9 years ago
Michael Scherer 8680cc7156 Fix pkgin detection on NetBSD 6 and 7 (#15834)
Since this is now the default package manager, it got moved
to another location on Netbsd :

  netbsd# type pkgin
  pkgin is a tracked alias for /usr/pkg/bin/pkgin
  netbsd# uname -a
  NetBSD netbsd.example.org 6.1.4 NetBSD 6.1.4 (GENERIC) amd64

But since the package manager is also used outside of NetBSD, we
have to keep the /opt/local path too.
9 years ago
Kei Nohguchi 8de25db681 net_template.py: Fix jinja2 template file search path (#15134)
The change is needed to support the multiple include statements
inside the jinja2 template file, as in '{% include ['another.j2'] %}'.
statement.  I need this capability, as OpenSwitch `switch` role needs
to handle multiple *.j2 files and supporting the include statement
inside jinja2 file is essential, otherwise I need to combine multiple
template files into a single file, which easily causes conflicts
between developers working on different parts of the teamplate, ports
and interface.
9 years ago
Michael Scherer 10edaabed5 Port module_utils/ec2.py to python 3 syntax (#15879)
Since boto is considered as python 2.6 only (cf
https://github.com/ansible/ansible/blob/devel/test/utils/run_tests.sh#L15 ),
no need to use the 2.4 compatible syntax.
9 years ago
Michael Scherer eb52dc9af0 Port azure_rm_common.py to py3 syntax (#15880)
Since the rest of the file already use a non 2.4 syntax
(such as format), I didn't bother using the 2.4 syntax for
exceptions.
9 years ago
Michael Scherer cdef2f5db6 Port the gce snippet to a python 2.6 to 3 compatible syntax (#15872)
Since it depend on libcloud and libcloud requirements include python 2.6
since libcloud 0.4.0 (https://libcloud.apache.org/about.html), which
was released in 2011 Q2, and GCE drivers were added in 2013,
we can't run a libcloud version with GCE support on 2.4.
9 years ago
Michael Scherer fae492324e Port the rest of the file to the 2.4/3 compatible syntax (#15873)
Since the modules can use a paramiko transport (ergo
python 2.4 syntax), we need to keep compat with 2.4 and python 3,
so we need to use the get_exception trick, even if the various juniper
libraries are not compatible with 2.4.
9 years ago
Michael Scherer a4f6fc0dc2 Port docker_common.py to py3 compatible syntax (#15877)
Since docker-py depend on python 2.6 (cf their tox.ini),
we do not need to make it python 2.4 compatible.
9 years ago
Michael Scherer 97f16b7700 Port shell snippet to python3/2.4 compatible syntax (#15874) 9 years ago
Michael Scherer 127a37f67c Port the module snippet to python3 (#15870)
vca depend on pyvcloud, who depend on PyYAML 3.10, which
support python 2.5 as a minimum, cf https://github.com/vmware/pyvcloud/blob/master/requirements.txt
and http://pyyaml.org/wiki/PyYAML

vmware.py depend on PyVIM, who depend on python 2.6.

So we can use the modern syntax for both of them.
9 years ago
Michael Scherer e539b2003d Make the facts module run on netbsd (#15833)
It currently fail with

 ansible/module_utils/facts.py\", line 357, in get_service_mgr_facts\r\nKeyError: 'distribution'\r\n"

Since self.facts['distribution'] is used after, we need to make sure
this is set by default and if needed, corrected somewhere for Linux.
9 years ago
feliksik 95cf095222 hashi_vault lookup: be more rebust, and allow fields with other name than 'value' (#13690)
* more robust hashi_vault module, and allow querying specific field in secret-dict

* allow fetching entire secret dict with trailing ':'

* process comment by bcoca for PR #13690
9 years ago
Alexey Kalinin 1d113c384e Fix issue with latest pyvmomi and certificate validation 9 years ago
Toshio Kuratomi 0cb05d8ac9 Some Python-3 module_utils support 9 years ago
chouseknecht 56bb3ec680
Bump core submodule ref. 9 years ago
chouseknecht 7f8a6d11c2
Bumping core submodule ref. 9 years ago
camradal 4bb4c7e68e vCloud module utils error handling bug fixes (#15859)
* Fix AttributeError that hides login errors

* Typo fixes for vca error messages
9 years ago
James Cammarata 6f6456dff5 Adding a deprecation message for accelerated mode 9 years ago
Thomas Quinot a2c905c32e Fix uninitialized distribution fact on FreeBSD (#15842)
Initialize facts['distribution'] with self.system so that this fact does
not remain uninitialized on systems_platform_working platforms (FreeBSD,
OpenBSD).

Fixes #15841
9 years ago
Nathaniel Case 043e910652 Check for jxmlease when using netconf on JUNOS. (#15835) 9 years ago
James Cammarata 4f0be29d65 Reworking retry/until logic to fix bugs
Prior to this patch, the retry/until logic would fail any task that
succeeded if it took all of the alloted retries to succeed. This patch
reworks the retry/until logic to make things more simple and clear.

Fixes #15697
9 years ago
Toshio Kuratomi 03d33f0905 Start adding required to docs 9 years ago
jctanner e083fa3d11 Disable sftp batch mode if sshpass (#15829)
Make use of the -oBatchMode=no option to force password prompts from sftp

Addresses #13401
9 years ago
Toshio Kuratomi 119baba6b1 Update submodule refs 9 years ago
Toshio Kuratomi c1cc9f1f23 Merge pull request #15845 from abadger/ziploader-constants
Ship constants to the modules via internal module params rather than a secondary dict
9 years ago
Matt Martz 878b0dca68 Use .code instead of .getcode() as py24 does not have .getcode(). Fixes https://github.com/ansible/ansible-modules-core/issues/3608 9 years ago
James Cammarata d2bade6daf Make sure setting facts with run_once makes copies of the data
When using run_once, there is only one dict of facts so passing that
to the VariableManager results in the fact cache containing the same
dictionary reference for all hosts in inventory. This patch fixes that
by making sure we pass a copy of the facts dict to VariableManager.

Fixes #14279
9 years ago
Toshio Kuratomi 186337db28 Ship constants to the modules via internal module params rather than a secondary dict. 9 years ago
Toshio Kuratomi a404d0ffe2 Update submodule refs 9 years ago
Matt Martz a521b70217 Merge pull request #15306 from sivel/ansible-modules-core/issue/3370
Cascade ssh_*args configurations in synchronize
9 years ago
Matt Martz 196453b9b2 Merge pull request #13771 from sivel/binary-modules
First pass at allowing binary modules
9 years ago
Matt Martz 72b6f8244c Merge pull request #15337 from sivel/ignore-profile-crap
Guard against a shell profile printing extraneous data
9 years ago
James Cammarata ae09648068 Merge pull request #15812 from cThrice/patch-3
Fixes #15745 playbook include: Conditional scoping
9 years ago
Toshio Kuratomi b4e78caf25 Merge pull request #15825 from abadger/fix-squashing-traceback
If we can't squash for any reason, then simply do not optimize the items loop.
9 years ago
Matt Martz ca22783086 modify_module does not need to return module_path, as the calling code already has access to it 9 years ago
Matt Martz 34adb54734 Make _is_binary use already read module_data, move _is_binary check to the top of the stack 9 years ago
Matt Martz 0faddfa168 Move binary module detection into executor/module_common.py 9 years ago
Matt Martz ddf3c3838f Re-implement/move some code lost due to merge conflicts 9 years ago
Matt Martz 35246abb2e Don't register new vars that aren't needed 9 years ago
Matt Martz 1e038e5043 Update for py26 9 years ago
Matt Martz 0a8d016642 Get binary modules working for windows, assuming .exe for windows 9 years ago
Matt Martz d8a243bef0 First pass at allowing binary modules 9 years ago
Toshio Kuratomi 292f0ed0d6 If we can't squash for any reason, then simply do not optimize the items loop.
Also add more squashing testcases

Fixes #15649
9 years ago
Matt Martz 1cee3f35b1 Guard against a shell profile printing extraneous data 9 years ago
Toshio Kuratomi 4d59779e0a Fixed importing the libcloud modules to give a nice error rather than a traceback. 9 years ago
Vic Iglesias dac356466c Update GCE module to use JSON credentials (#13623)
* Update GCE module to use JSON credentials

* Ensure minimum libcloud version when using JSON crednetials for GCE

* Relax langauge around libcloud requirements
9 years ago
James Cammarata d391c53b4f Clear blocked hosts when a role duplicate task is found in free strategy
In the free strategy, we mark a host as blocked when it has work to do
(the PlayIterator returns a task) to prevent multiple tasks from being sent
to the host. However, we check for role duplicates after setting the blocked
flag, but were not clearing that when the task was skipped leading to an
infinite loop. This patch corrects that by clearing the blocked flag when
the task is skipped.

Fixes #15681
9 years ago
James Cammarata 08f6283c3f Merge pull request #15747 from larsks/bug/15744
do not erroneously set gathered_facts=True
9 years ago
James Cammarata 3439bcc744 Merge branch 'refresh-inventory-exit' of https://github.com/zenbot/ansible into zenbot-refresh-inventory-exit 9 years ago
James Cammarata 0d7530e6da Change error about loop variable in use to a warning 9 years ago
Toshio Kuratomi 8a184381af Strip junk after JSON return. (#15822)
Fixes #15601
9 years ago
James Cammarata 9d9a451b34 Simply being in an always block shouldn't mean a host did not fail
Previously the changed code was necessary, however it is now problematic
as we've started using the is_failed() method in other places in the code.
Additional changes at the strategy layer should make this safe to remove
now.

Fixes #15625
9 years ago
Carl fefd87c61a Fixes #15745 playbook include: Conditional scoping
Fixes #15745
Applies conditional forwarding to all tasks/roles within the included playbook.
The existing line only applies forwarded conditionals to the main Task block, and misses pre_, post_, and roles.

Typo ::

Made a selection mistake when I copied over the one line change
9 years ago
James Cammarata 33de7707c9 Do not include params when getting role vars in certain situations
In VariableManager, we fetch the params specifically in the next step,
so including them in the prior step is unnecessary and could lead to things
being overridden in an improper order.

In Block, we should not be getting the params for the role as they are
included earlier via the VariableManager.

Fixes #14411
9 years ago
Toshio Kuratomi 9096901c1f Update submodule refs 9 years ago
Toshio Kuratomi 99e3880181 small python3 fix so that ping will run on python3 9 years ago