Commit Graph

21498 Commits (c0695ffa4147a0b0dc87c7a2d2aa2ab7a16695cb)
 

Author SHA1 Message Date
Matt Clay c0695ffa41 Add `unify_repos.sh` to shellcheck skip list. 8 years ago
Benoît Allard 56dcf2cc04 with_sequence: pass AnsibleError through
The parsing methods try as hard as possible to generate meaningful error messages that are all ignored and immediately overwritten by a new AnsibleError instance. Better use the original one instead.
8 years ago
Benoît Allard 7db4ed02ee with_sequence: Fix indentation
This doesn't need to run for every parameters. Once is enough.
8 years ago
Alberto Murillo 7542dae26b Fix fetching files with scp (#18673)
Commit ec2521f intended to fix the scp command to fetch files
from a remote machine but it has src and dest swapped.

This change correctly treats src as the location in the remote machine
and dest as the location in the local machine.

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
8 years ago
Brian Coca 2b13ad0ae8 dont skip github modules... 8 years ago
Brian Coca eef7b8b5a5 now also unifies plugins in same dir structure 8 years ago
Adrian Likins 47a7cb733a use log attribute %(process)d instead of os.getpid (#18691) 8 years ago
Adrian Likins ba56c87566 Add SSH_AUTH_SOCK to default env
So ssh-agent works when using locally.
8 years ago
Peter Sprygada 8137c7207d adds feature to try to auto determine network_os (#18674)
This updates the network_cli connection plugin to attempt to automatically
determine the remote device os.  The device network os discovery can
be overridden by setting the ansible_network_os value.
8 years ago
Peter Sprygada 6fe9a5e40c functional updates to ansible-connection (#18574)
* sends the serialized play_context into an already established connection
* hooks the alarm_handler() method in the connection plugin if it exists
* added configuration options for connect interval and retries
* adds syslog logging to Server() instance

This update will send the updated play_context back into an already
established connection in case privilege escalation / descalation activities
need to be performed.  This change will also hook the alarm_handler() method
in the connection instance (if available) and call it in case of a
sigalarm raised.

This update adds two new configuration options

* PERSISTENT_CONNECT_INTERVAL - time to wait in between connection attempts
* PERSISTENT_CONNECT_RETRIES - max number of retries
8 years ago
Yannig 900b3ffcba Implement docker support for synchronize module. (#18145)
* Implement docker support for synchronize module.

Note : you need rsync installation on your docker container.
Have a look at https://github.com/ansible/ansible/issues/16306 for more details.
Support Ansible options for remote access.

* Give user name to docker command.
8 years ago
Matt Clay bee58fe890 Fix compile skip path handling for targeted tests. 8 years ago
John R Barker d22f7b4919 vyos: Don't run show commands that are over ANSIBLE_VYOS_TERMINAL_LENGTH (#18682) 8 years ago
Matt Clay 4da7a7ce0e Update coverage exclusions. (#18675)
* Update coverage exclusions.
* Fix logic error in Windows change detection.
8 years ago
Matt Clay 6bbd92e422 Initial ansible-test implementation. (#18556) 8 years ago
Matt Davis d95eac16eb bump submodule refs 8 years ago
Brian Coca 461dcf8ce3 log on target based on nolog, not verbosity (#18570)
* log on target based on nolog, not verbosity

fies #18569

* initialize module name

removing verbosity exposed missing name at certain stages, initialize to file name
and update later once module args are parsed
8 years ago
Virgil Dupras bf48383610 Fix regression in jinja2 include search path (#18617)
* Fix regression in jinja2 include search path

Since commit 3c39bb5, the 'ansible_search_path' variable is used to set
jinja2's search path for {% include %} directives. However, this path is
the the proper one because our templates live in 'templates' subdirs in
our search path.

This is a regression because previously, our include search path would
include the dirname of the currently interpreted file, which worked most
of the time.

fixes #18526

* Fix template lookup search path

Improve fix in commit c96c853 so that the search path contain both
template-suffixed paths as well as original paths.

ref PR #18617

* Add integration test for template lookups

Tests regression at #18526

This test fails on current devel branch and succeeds on PR #18617
8 years ago
Adrian Likins 9b1ce5dfb9 add integration tests for authorized_key (#18130)
Primarily for behavior related to
https://github.com/ansible/ansible-modules-core/issues/4780
8 years ago
James Cammarata 786ac0ea3d Submodule update 8 years ago
John R Barker 2b6d5f9f95 Update network-test-runner.sh (#18672) 8 years ago
Adrian Likins a1ca10f7fc Add lots of test cases to inventory/test_host.py (#17827) 8 years ago
Brian Coca ca1514cf2a unified boolean function
optimized boolean function
fixes #17815
8 years ago
Adrian Likins d6e2f1846a add a unit test for playbook/base.py (#17688)
* wip: add a unit test for playbook/base.py

This commit include a failing test
TestBaseSubClass.test_attr_class_post_validate

It fails with the error:
Traceback (most recent call last):
  File "/home/adrian/src/ansible/test/units/playbook/test_base.py", line 264, in test_attr_class_post_validate
    bsc = self._base_validate(ds)
  File "/home/adrian/src/ansible/test/units/playbook/test_base.py", line 206, in _base_validate
    bsc.post_validate(templar)
  File "/home/adrian/src/ansible/lib/ansible/playbook/base.py", line 450, in post_validate
    " Error was: %s" % (name, value, attribute.isa, e), obj=self.get_ds())
AnsibleParserError: the field 'test_attr_class_post_validate' has an invalid value (<class 'units.playbook.test_base.ExampleSubClass'>), and could not be converted to an class. Error was: test_attr_class_post_validate is not a valid <class 'units.playbook.test_base.ExampleSubClass'> (got a <class 'ansible.playbook.base.BaseMeta'> instead)

* wip, test refactoring

* wip, trying to add a parent->child

* wip, fix isa=class.

the ds the base using needs an instance of the class
(ie, whats normally created by the yaml loaders)

* wip, theres no need to argue, I just dont understand parents

* stub a _preprocess_data for coverage

* cleanup, required, parent, etc
8 years ago
Adrian Likins f0c71ad68d More test coverage for plugins/callback/__init__ (#18020) 8 years ago
John R Barker 4875824357 Network dut (#18668)
* Use dedicated account for testing

This also avoids any instance of "vyos" being masked by no_log

* use vyos-dut-01
8 years ago
Adrian Likins 83676e9b40 Fix 'cancled' misspelling in --step debug 8 years ago
John R Barker 366b7c7691 Network test runner - Phase 1 (#18524)
* Initial commit of network-test-runner

* remove gist link

* Correctly source hackenv and improve logging

* Remove debug

* Log location
8 years ago
Toshio Kuratomi 3c6d71522e Fix for AnsiballZ when the remote clock is behind (#18660)
Some machines have system clocks which can fall behind (for instance,
a host without a CMOS battery like Raspberry Pi).  When managing those
machines we have to workaround the fact that the zip format does not
handle file timestamps before 1980.  The workaround is to substitute in
the timestamp from the controller instead of from the managed machine.

Fixes #18640
8 years ago
jctanner 4d78c784a6 Add a doc reference to the module developer guide. (#18658)
Addresses https://github.com/ansible/ansible-modules-core/issues/5672
8 years ago
Daniel Miranda 57f4a9885e Make sure include_role inherit variables from parent role (#18627)
* Make sure include_role inherit variables from parent role

Setting the parent of task blocks generated by include_role after they
have been produced is not sufficient - it means the tasks don't have the
correct dependency chain set afterwards, and therefore, don't properly
inherit variables from outer roles.

In addition to manually setting the parents, pass the dep_chain when
compiling the role, such that variables are correctly imported.

Fixes #18540.

* Add tests for include_role

* Fix include_role variable inheritance for multiple parent levels
8 years ago
Matt Clay 00f8945159 Update submodule refs. 8 years ago
Adrian Likins dbbd2d79ff Fix traceback in atomic_move (#18649)
Commit 8b08a28c89 removed a
call to get_exception() that was needed. Without it, the fail_json
references an undefined variable ('exception') and throws an exception.

Add the get_exception() back in where needed and update references.

Now the proper module failure is returned.

Fixes #18628
8 years ago
Matt Clay 6169d2d49f Update submodule refs. 8 years ago
John R Barker 02842767c6 Remove duplicated 'timeout' doc (#18657) 8 years ago
Peter Sprygada 9aa8547016 adds two new plugins that use ansible-connection for persistence (#18572)
* adds new connection plugin `network_cli` which builds on paramiko
* adds new plugin `terminal` used for manipulating network_cli terminals
* adds new field to play_context `network_os` settable as ansible_network_os

This commit adds the plugins necesary to establish a persistent cli connection
to network devices of ssh.  It builds on the paramiko connection plugin
to create a shell environment that will persistent through ansible-connection.
The `newtork_cli` plugin then uses the network_os in the instance of
PlayContext to load the appropriate network OS environment plugin for
handling opening and closing of shells as well as privilege escalation.
8 years ago
John R Barker 54c5ea29bb Update inventory.network (#18654) 8 years ago
Peter Sprygada 7df5a0abd0 adds config option to auto add keys when using paramiko (#18598)
* updates paramiko_ssh to auto add keys
* updates constants with new config options

This commit adds a new feature that will allow paramiko to automatically
accept and save a host ssh key.  This feature is controlled by the
`host_key_auto_add` config setting in the paramiko section.  The default
is False to maintain current functionality.  It also includes a new
setting `look_for_keys` with the default to False for maintaining current the
current setting.
8 years ago
John R Barker 0793cf3599 HACK test on older vyos machine (#18653) 8 years ago
John R Barker 09550e4f46 Ops (#18652)
* Link to missing ops.yaml

* Add missing ops.yaml
8 years ago
Peter Sprygada a87d30f72f fixes exception raised when extracting timeout value from ModuleStub in eapi (#18651) 8 years ago
Peter Sprygada 9cb0e771d2 expose timeout param to socket (#18632)
The timeout param was exposed to the socket connection but was not
enforced for commands.  This update will now cause a command to timeout
based on the module parameter.
8 years ago
Peter Sprygada 69fb310878 updates the network shared docs to include the timeout parameter (#18635)
The network shared doc fragment was missing the timeout parameter from
the docstring.  This commit adds the timeout parameter back to the
doc fragment
8 years ago
Adrian Likins 0f455a0cfd Add ticket stub with info on reporting locale info (#16310) 8 years ago
Jeremy Swinarton 3e041a82c4 Add documentation on YAML floating-point values (#17182) 8 years ago
A D Vishnu Prasad ad7448d24c Fix typo (#18644) 8 years ago
Peter Sprygada a757a77159 fixes timeout param in netconf provider for junos (#18634)
This change will now cause the netconf provider to honor the module
timeout value when making calls to pyez.
8 years ago
Peter Sprygada eec6980f3e pass module timeout value to fetch_url in eapi connection (#18633)
This change causes the eapi connection to honor the module timeout
value when calling fetch_url
8 years ago
Alberto Murillo ec2521f6af Fix ssh plugin to correctly fetch files when using scp (#18614)
Fetch module uses fetch_file() from plugin/connection/ssh.py to
retrieve files from the remote hosts which in turns uses
_file_transport_command(self, in_path, out_path, sftp_action) being
sftp_action = 'get'

When using scp rather than sftp, sftp_action variable is not used
and the scp command is formed in a way that the file is always
sent to the remote machine

This patch fixes _file_transport_command() to correctly form the scp
swaping src and dest if sftp_action is 'get'

Bug introduced at 8e47b9b
Fixes #18603

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
8 years ago
Matt Clay 43714f859a Update submodule refs. 8 years ago