Commit Graph

2012 Commits (6580fb2cd128f02afc3e5adc57b9f6b9d1538328)

Author SHA1 Message Date
Patrick Ogenstad ac527ef86f Check for removal not allowed errors (#19251) 8 years ago
Ricardo Carrillo Cruz b44505e281 Merge pull request #20559 from rcarrillocruz/refactor_ios_config_network_connection
Refactor iosxr_config to make use of network_connection plugin
8 years ago
Matt Clay d8b18d79fa Disable assertions that fail on WS 2016. 8 years ago
Matt Clay d6cdd91511 Remove `win_fetch` from CI due to instability. 8 years ago
Ricardo Carrillo Cruz a8cfe4a5d7 Refactor iosxr_config to make use of network_connection plugin 8 years ago
Ansible Test Runner ff1a732ffd Increase timeout for http server in uri test. 8 years ago
Matt Clay fa7f84217b Add startup checks to ansible-test. 8 years ago
Ricardo Carrillo Cruz 034330e52f Fix typo on test_ios_config_before_after_no_change test (#20565) 8 years ago
Matt Clay 836e0b59d2 Fix git remote url change detection. (#20587)
* Fix git remote url change detection.

When comparing paths, unfrackgitpath must be called on both sides
of the comparison. Otherwise comparisons involving symlinks will
return incorrect results.

* Re-enable git test on OS X.

* Return None from unfrackgitpath when path is None.
8 years ago
Nathaniel Case b3662fdad1 vyos_command 2.3 (#18994)
* Peter's new module_utils/vyos
* Update vyos_command
* Restore `set terminal length $ANSIBLE_VYOS_TERMINAL_LENGTH` in vyos
* vyos_command tests
* Remove provider mentions from vyos_command
* Extend get_config to take (and cache) various `show configuration` commands
8 years ago
Matt Clay 61e6e7868c Improve jinja2 test coverage. (#20533)
* Run `template` test on latest jinja2 version.
* Update jinja2 install for groupby_filter.
* Clean test output dir for each test.
8 years ago
Matt Clay d87ee022bb Enable more `ios` tests on Shippable. 8 years ago
John R Barker 11c15bbbaf Disable IOS tests for the moment (#20524) 8 years ago
John R Barker a12033a6e0 integration/targets/ios_* work to support IOS (#20414)
* WIP

* Don't set connection: network_cli in the playbook

* ios_config tests now passing

* Create test loopback device

* delete

* ios_* pass (apart from ios_facts)

* Remove provider lines
8 years ago
John R Barker 7330ab8062 Correctly call get_config (#20452)
* Correctly call get_config

* remove debug

* Check for empty flags and LocalAnsibleModule

* Peter's feedback
8 years ago
James Cammarata 188c3c608a Don't restrict local jinja2 variables to those that start with l_
Per a change in jinja2 2.9, local variables no longer are prefixed
with l_, so this updates AnsibleJ2Vars to pull in all locals (while
excluding some) regardless of name.

Fixes #20063

(cherry picked from commit 4d49b317929b86e1fc1b0cbace825ff73b372dc7)
8 years ago
Matt Clay 9213d0c5b0 Fix and enable more tests for osx and freebsd. (#20482)
* Fix `iterators` test for osx.
* Enable `git` test for osx.
* Enable `get_url` test for osx and freebsd.
* Remove unused SNI_URI from uri test.
* Use ansible hosted SNI host oustside docker.
* Enable `uri` test for osx and freebsd.
* Enable `gathering_facts` test for osx.
* Skip single task on osx until test is fixed.
8 years ago
Matt Martz 537b3b75a6 Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes #20098 (#20362)
* Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes #20098

* Address some of the requested changes

* Quoting

* Print the python path and version

* Be less explicitly verbose, rely on implicit verbosity
8 years ago
Matt Clay a8fb6f0958 Use jinja2 import instead of pip to get version.
This resolves issues with older versions of pip.
8 years ago
Andrew Gaffney ac51266e8f Add pipeline-ish method using dd for file transfer over SSH (#18642) 8 years ago
James Cammarata 9d549c3498 Fixing iterator bug related to reworking of end-of-role detection
Bug was introduced in cae682607
8 years ago
Matt Clay 7ed67746cf Enable Windows 2016 on Shippable.
Also launch Windows instances on us-east-2 and all others on us-east-1.
8 years ago
Matt Clay 4ba9f63afe Use multiple AWS regions in ansible-test. (#20429)
* Move ansible-test EnvironmentConfig to util.
* Use multiple AWS regions in ansible-test.
8 years ago
James Cammarata cae682607c Reworking the way end of role detection is done
Rather than trying to enumerate tasks or track an ever changing cur_role
flag in PlayIterator, this change simply sets a flag on the last block in
the list of blocks returned by Role.compile(). The PlayIterator then checks
for that flag when the cur_block number is incremented, and marks the role
as complete if the given host had any tasks run in that role.

Fixes #20224
8 years ago
Matt Clay 4673a9c9c2 Generate ssh key once for network tests. 8 years ago
Matt Clay 4c97bad28e Update ansible-test network change classification. 8 years ago
Matt Davis b2a16379c8 new module: win_path (#20073) 8 years ago
Matt Clay 89898ed734 Update coverage constraints for ansible-test. 8 years ago
Matt Clay 3c51ce56fd Enable more network support in ansible-test. (#20372)
* Only start platform instances with tests selected.
* Enable ios on Shippable.
* Show inventory in explain mode.
* Fix indentation of generated network inventory.
* Update classification of network module_utils.
8 years ago
gaudenz 08e08ac775 new module cloudscale_server (#20175) 8 years ago
Ricardo Carrillo Cruz 825456f279 Merge pull request #20363 from rcarrillocruz/iosxr_template_network_cli
Refactor iosxr_template to network_cli plugin
8 years ago
David M. Lee fde551fa2a Adding support for Amazon ECR (#19306)
* Adding support for Amazon ECR

This patch adds a new module named ecr, which can create, update or
destroy Amazon EC2 Container Registries. It also handles the management
of ECR policies.

* ecs_ecr: addressed review feeback

 * Renaming ecr to ecs_ecr
 * Fixed docs
   * Removed bad doc about empty string handling
   * Added example of `delete_policy`
 * Removed `policy_text` option; switched policy to `json` type so
   it can accept string or dict
 * Added support for specifying registry_id
 * Added explicit else after returned if clauses
 * Added `force_set_policy` option
 * Improved `set_repository_policy` error handling
 * Fixed policy comparisons when AWS doesn't keep the ordering stable
 * Moved `boto_exception` into the module
8 years ago
Ricardo Carrillo Cruz ae630fff56 Refactor iosxr_template to network_cli plugin 8 years ago
John R Barker 64432c8f7c WIP: net_command: Initial tests for VyOS (#20147)
* Conditional include on ansible_network_os

* copy & paste error

* More tests

* More tests

* junos tests (based on vyos)

* remove excessive whitespace

* Pass in ansible_network_os

* net_command for ios

* consistent debug

* wrapp line

* ansible-test changes made in another PR

* ansible-test changes made in another PR
8 years ago
Matt Clay 893e2e0d35 Use ansible-test in integration test README. 8 years ago
Matt Clay dbb89549ff Improve ansible-test error handling and timeouts. (#20328)
* Eliminate warning/retry on old instance check.
* Increase instance start timeout for windows.
8 years ago
Matt Clay 55b9a11468 Require coverage < 4.3.2 to avoid bugs. 8 years ago
Matt Clay 34bca6fb55 Use distro packaged jinja2 instead of pip version. 8 years ago
Matt Clay b5d5888b6e Add support for ios to ansible-test. 8 years ago
Matt Clay ad65274643 Only test map on jinja2 >= 2.7 8 years ago
Toshio Kuratomi 32fbd4ba24 Test the extract filter without the map filter.
map + extract is the usual way to use it but map isn't available on
older versions of jinja2 that we still work with.  Test extract even on
those versions.
8 years ago
Matt Clay e2bd71ac02 Clean up inventory generation in ansible-test. (#20313) 8 years ago
Matt Clay a59ce3a7f9 Add retry on failure to get instance. 8 years ago
Matt Clay f3130898bb Retry instance start on error. 8 years ago
Matt Clay 203e375449 Fix python 3.6 install. 8 years ago
Matt Martz d25a70846f Only add Content-Type if not specified in headers. Fixes #20046 (#20234)
* Only add Content-Type if not specified in headers. Fixes #20046

* Update documentation to indicate body_format will not override Content-Type if specified in headers
8 years ago
Matt Clay f534573dcf Enable first network tests on Shippable. (#20208) 8 years ago
berenddeschouwer b1c57ea443 Installroot OS version check fix (#20180)
Cast to int before checking the OS version.
This prevents the DNF tests from running on
Fedora < 23
8 years ago
Matt Clay d8733a5455 Complete initial network-integration support. 8 years ago
Alvaro Aleman 1b2ad94496 Configurable fact path (#18147)
* Make fact_path configurable

* Add docs for fact_path

* Add tests for localfacts

* Default fact gathering settings in PlayContext
8 years ago
Peter Sprygada 4cdb266dac adds iosxr_system declarative module (#20134)
* adds new module iosxr_system
* adds unit test cases for module
8 years ago
Matt Clay cd3fdca540 Switch tests to pytest and ansible-test.
- Replace nose usage with pytest.
- Remove legacy Shippable integration.sh.
- Update Makefile to use pytest and ansible-test.
- Convert most yield unit tests to pytest parametrize.
8 years ago
Robin Roth 4976429e42 Zypper: Fix update_cache in checkmode (#20143)
Fixes #20139

Refresh does not support dry-run, so don't run it in check mode.
Also add a test for this case.
8 years ago
Matt Clay 300181cfd3 Send current winrm config to ansible-core-ci. 8 years ago
Matt Clay f340b8d14f Add test support for python 3.6. 8 years ago
John R Barker ec36b4968c Junos aws (#20083)
* junos Use inventory_hostname_short
* Basic Test for validating VyOS bringup in AWS
8 years ago
Matt Clay cc3d131f50 Fix group_by test to work with jinja2 >= 2.9. 8 years ago
Marius Gedminas d9b89ca577 Fix a test failure on Python 3.6 (#20030)
* Fix a test failure on Python 3.6

tox -e py36 failed with

    ======================================================================
    ERROR: test_action_base__execute_module (units.plugins.action.test_action.TestActionBase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/mg/src/ansible/test/units/plugins/action/test_action.py", line 507, in test_action_base__execute_module
        self.assertEqual(action_base._execute_module(), dict(_ansible_parsed=True, rc=0, stdout="ok", stdout_lines=['ok']))
      File "/home/mg/src/ansible/lib/ansible/plugins/action/__init__.py", line 596, in _execute_module
        remote_module_path = self._connection._shell.join_path(tmp, remote_module_filename)
      File "/home/mg/opt/python36/lib/python3.6/unittest/mock.py", line 939, in __call__
        return _mock_self._mock_call(*args, **kwargs)
      File "/home/mg/opt/python36/lib/python3.6/unittest/mock.py", line 1005, in _mock_call
        ret_val = effect(*args, **kwargs)
      File "/home/mg/src/ansible/.tox/py36/lib/python3.6/posixpath.py", line 92, in join
        genericpath._check_arg_types('join', a, *p)
      File "/home/mg/src/ansible/.tox/py36/lib/python3.6/genericpath.py", line 149, in _check_arg_types
        (funcname, s.__class__.__name__)) from None
    TypeError: join() argument must be str or bytes, not 'MagicMock'

because os.path.join() now checks argument types since Python 3.6 (due
to pathlib support, I expect).

* Use a more realistic module name in test
8 years ago
John R Barker b8ee80ac4e junos Use inventory_hostname_short (#20061)
Don't use hardcoded hostnames
8 years ago
Steve Bussetti 8a8090e658 test related to pulls: #19257 / #19057 (#19346) 8 years ago
Ganesh Nalawade 0305da6d6a Fix ios_command unit testcase (#20031) 8 years ago
John R Barker fb3bef7f46 Use inventory_hostname_short (#20054)
When using AWS we have to use the full domain name in the inventory file, which
we rather than the short name. This change avoids that ending up being
set in the tests.
8 years ago
Marius Gedminas 0a7f2c202b Improve --diff output when files lack trailing newlines
The behavior now matches GNU diff.

Fixes #14094.

Example of output before this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

after this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
    \ No newline at end of file
    +curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

The added unit tests contain more examples.

This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings.  (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
8 years ago
Peter Sprygada 258c6ada52 refactors ios_config to use network_cli plugin (#20042)
* updates the ios_config module to use the network_cli plugin
* updates the local action plugin to derive from network
* add unit test cases for ios_config
8 years ago
Peter Sprygada 63fbc1a764 adds missing __init__ to ios unit test 8 years ago
Matt Clay 7ba47bfd2d Correct test constraints and add sanity check. 8 years ago
Matt Clay 07c68571b6 Require jinja2 < 2.9 until tests pass on 2.9. 8 years ago
Matt Clay 3ec7243918 Run all win tests for winrm config script changes. 8 years ago
Peter Sprygada cba66dfedc update the _ios_template module to use the network_cli plugin (#19933)
* updates the deprecated ios_template module to use network_cli
* adds unit test cases for ios_template
* adds check for provider argument and displays warning message
8 years ago
Robin Roth cd02d0ca1d Cleanup git tests (#19737)
* Cleanup git tests
* Split git tests in seperate files
* Remove use of repo_depth_url
* Use native yaml
* Remove unnecessary remote/local clones
* Fix newlines for yamllint
* If the hash is valid (full-length) but doesn't exist, git returns 128 instead of 1.
* Ensure git doesn't use hardlinks for shallow clones
8 years ago
Peter Sprygada 7d3366acc0 updates ios_command to use network_cli plugin (#19992)
* refactors ios_command to use network_cli
* adds unit test cases for ios_command
8 years ago
Matt Clay 50b11cd8e3 Add test for `ConfigureRemotingForAnsible.ps1`. 8 years ago
Brian Coca 57f8b791d6 consolidated docs
point to new doc locations
removed non existing dirs
8 years ago
Toshio Kuratomi 95df8977b6 Fix yum install root (#19925)
* Reenable yum install root tests

No need for sos to test installroot.  Something with less deps works
just as well.

* Fix yum installroot.

Fix module import to use fail_json when the modules aren't installed.

Remove wildcard imports

* Lsat task is supposed to remove sos so make that happen
8 years ago
Toshio Kuratomi 74db76ec9c Not my day... Remove extraneous vim typo 8 years ago
Toshio Kuratomi d001d250f0 Whitelist the hacking/cherrypick script's use of python3 8 years ago
Peter Sprygada 5a14f1d705 adds new module ios_system (#19916)
adds new module ios_system
8 years ago
Toshio Kuratomi 84e755b252 Disable the yuminstallroot tests that are failing until the submitter can take a look. 8 years ago
Toshio Kuratomi cd2516bf8d Revert "Revert "Add --installroot to YUM and DNF modules, issue #11310""
This reverts commit b73ddd5212.
8 years ago
Matt Clay b73ddd5212 Revert "Add --installroot to YUM and DNF modules, issue #11310" 8 years ago
Matt Martz 9048cf2758 Changes to the httptester docker image to support new client cert functionality in tests (#19912)
* Fix Dockerfile
* Add changes to docker image to support new client cert functionality
* Update repo:tag for docker
8 years ago
Peter Sprygada 1c16c1db2b adds new module ios_vrf (#19915)
adds new module ios_vrf
8 years ago
berenddeschouwer 1fdcda0996 Add --installroot to YUM and DNF modules, issue #11310 (#19861)
* Add --installroot to YUM and DNF modules, issue #11310

This continues ansible-modules-core#1558, and
ansible-modules-core#1669

Allow specifying installroot for the yum and dnf modules
to install and remove packages in a location other than /.

* Remove empty aliases

* Simpler installroot set default logic
8 years ago
Matt Clay 95b59cd76c Remove `needs/privileged` from postgresql test. (#19907)
* Remove `needs/privileged` from postgresql test.
* Add python 3 support to postgresql tests.
8 years ago
Matt Clay 709a3aa42b Run service test on py3 + unprivileged on docker. (#19841)
* Run service test on py3 + unprivileged on docker.
* Fix service integration test for python 3.
8 years ago
Matt Clay b7780ca530 Pass DOCKER_* env vars to docker in ansible-test. 8 years ago
Toshio Kuratomi e98c0a3009 Fix locale_gen to compare native strings rather than mixing byte and text strings
Fixes #19426
8 years ago
Adrian Likins c771ab34c7 Add a encode() to AnsibleVaultEncryptedUnicode (#19840)
* Add a encode() to AnsibleVaultEncryptedUnicode

Without it, calling encode() on it results in a bytestring
of the encrypted !vault-encrypted string.

ssh connection plugin triggers this if ansible_password
is from a var using !vault-encrypted. That path ends up
calling .encode() instead of using the __str__.

Fixes #19795

* Fix str.encode() errors on py2.6

py2.6 str.encode() does not take keyword arguments.
8 years ago
Rene Moser 6c2af29659 tests: add handler listen test cases 8 years ago
Robin Roth 9f2d22425b Run tests on opensuse42.2
* add to shippable
* add to completion/readme
* Fixes #18645
8 years ago
Robin Roth 61897fa4b7 Add Dockerfile for opensuse 42.2 (#19805) 8 years ago
Matt Clay 68346b128f Update Fedora tests to use releases 24 and 25. 8 years ago
Matt Clay 165e7c4e61 Add Dockerfile for fedora24 and fedora25. 8 years ago
John R Barker c252ac1a7d Make tests run on fresh install (#19566) 8 years ago
Marius Gedminas b0b7a636d8 authorized_key: support --diff (#19277)
* Refactoring: split readkeys() into readfile() and parsekeys()

* Refactoring: split writekeys() into writefile() and serialize()

* authorized_key: support --diff

* Refactoring: remove no-longer used readkeys()/writekeys()

* Integration test for authorized_key in check mode
8 years ago
Tom Melendez 7e88df7ebc Adding auth support for google-api-python-client and gcloud-python (#19090)
Support for the Google API and GCloud-Python Clients have been added.

The three libraries:
* GCloud-Python: A new function, get_google_cloud_credentials, should be used.  The credentials-object returned can be passed to any gcloud-python client.  Using this client library requires in the installation of gcloud-python.  This is preferred library for new modules.

* Google API: A new function, gcp_api_auth, should be used to take advantage of services requiring this client.  This client library should be used if the desired functionality is not available in GCloud-Python.  Using this library requires the installation of google-api-python-client.

* libcloud: Existing function, gcp_connect, should be used.  The interface and return values have not changed and existing modules (such as gce, gce_pd and gce_net) should work without modification.  Note that the credentials-fetching code has been refactored out of gcp_connect so that can be reused by all connection functions. To use this function, apache-libcloud must be installed.

Import guards have been added and will only be trigger if a user tries to use a function that is missing dependencies.

Credential-specifying mechanisms (i.e, ansible module params, env vars and libcloud secrets.py) have not changed.  They have been refactored and unit tests have been added to allow for changes going forward. We are deprecating (and removing in a subsequent release) the ability to specify credentials via the libcloud secrets file.  Also, we have deprecated (and also plan to remove in a subsequent release) the ability to use a p12 pem file for a key - the JSON format is strongly preferred.  Deprecation warnings have been added for both of these issues (see the Ansible docs on how to disable deprecation warnings).
8 years ago
Tom Melendez d09ad82e71 Add regex support to gce_tag module, add unit tests and update integration test. (#19087)
The gce_tag module can support updating tags on multiple instances via an instance_pattern field.  Full Python regex is supported in the instance_pattern field.

'instance_pattern' and 'instance_name' are mutually exclusive and one must be specified.

The integration test for the gce_tag module has been updated to support the instance_pattern parameter.  Unit tests have been added to test the list-manipulation functionality.

Run the integration test with:

TEST_FLAGS='--tags "test_gce_tag"' make gce

Run the unit tests with:

python test/units/modules/cloud/google/test_gce_tag.py
8 years ago
Matt Davis f96ac8bff0 fix multiple handler notifications (#19655)
Fixes #19647
Adds integration test to catch multiple handler notifications
8 years ago
azenk f2458140f6 Lastpass lookup plugin (#16285)
This plugin can be used with the lpass cli interface for lastpass.
[lastpass-cli](https://github.com/lastpass/lastpass-cli)

Example:
Add a lookup to your playbooks/variables somewhere:
```
some_variable: "{{ lookup('lastpass','Some Lastpass entry name or ID', field='username') }}"
```
Usage:
* start a lpass session prior to using ansible
* run ansible
* logout when finished

```
lpass login user@domain.com
ansible-playbook foo.yml
lpass logout
```
8 years ago
Rob Cutmore 1da6a67c50 Add tests for Git remote URL changes (#16893)
* Update Git tests for set remote URL changes
* Git: report changed when needed in check mode
8 years ago