Commit Graph

2767 Commits (45e377566c6fbcbcfe19c2ed324136fef9a58666)

Author SHA1 Message Date
René Moser 53c46df323 cloudstack: new module cs_network_acl_rule (#25325)
* cloudstack: new module cs_network_acl_rule
* fix doc errors
7 years ago
René Moser 3e02b19b98 cloudstack: fix pep8 cs_project (#25322) 7 years ago
Will Thames 84eea2a7e3 Support check_mode in ec2_vpc_nacl (#23112)
* Support check_mode in ec2_vpc_nacl

Ensure that all API calls that make changes are guarded by
`if not module.check_mode`.

* Update ec2_vpc_nacl_facts to latest pep8 standards
7 years ago
Trishna Guha e90f1d6449 net_command platform agnostic module (#25249)
* net_command platform agnostic implementation

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add net_command platform agnostic module

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add integration test for net_command module

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix yaml issue
7 years ago
Dag Wieers 8cbed3c534 unarchive: PEP8, imports, cosmetics (#24654)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Ricardo Carrillo Cruz 955dc6e250 Add net_banner platform agnostic module (#25245)
* Add net_banner platform agnostic module

* Add integration tests for net_banner

* Remove default from required param

* Remove skip/python3 from net_banner aliases
7 years ago
Ricardo Carrillo Cruz ffc74fdca2 Add missing provider on basic-motd IOS test (#25307)
Without this it fails, as it needs elevated privs.
7 years ago
Ricardo Carrillo Cruz 64add28657 Platform agnostic net_system module (#24953)
* Platform agnostic net_system module

Also refactor the action network plugins for better code re-use

Still more refactoring to do once the connection plugin work is complete

* Replace importlib for imp

importlib is not available on 2.6, so we need to stick to imp

* Load action plugin via module metadata

* Better error message if no implementation is found

Now the plugin will show the module name and the network OS in the
error message

* Fix typo on documentation author line

* Fix pep8 issues

* Add missing options key on doc string and stringify version

* Return None in case module has no metadata

* Read module metadata only if it's a python module

Check for module suffix, if it's .py then read metadata.
Otherwise this fails on non-python modules, like Windows PS for example.

* Read metadata variable only if it's a python module

Fix referencing a variable before assignment

* Add action_handler to validate_modules metadata schema

* Pull metadata with plugin_docs get_docstring

Using load_source from PluginLoader is troublesome, it is not guaranteed
a module may be importable at the controller, e.g. if a module depends
on module_utils functions it won't work, because module_utils is not
in the sys path.
Rather than putting that module dependencies introspection, just
use plain parsing like plugin_docs get_docstring does as we only care
about reading ANSIBLE_METADATA.

* Add platform agnostic group of groups for integration tests

This will be the target for platform agnostic integration tests.

* Add integration tests for net_system

* Switch to action plugin inheritance from metadata driven action handler

As the metadata action driven action handler work is being worked on
on its standalone proposal+PR, let's just go back to have one
action handler per platform agnostic module.
Those action plugins will inherit from net_base.

* Add blank line to fix pep8

* Add aliases file to net_system integration test

This will avoid CI failure

* Fix integration tests for net_system

* Give more precedence to task network_os over inventory network_os
7 years ago
Brandon Davidson 0e0c5328fa amazon/ec2_vpc_igw: Allow internet gateways to be tagged (#23782) 7 years ago
Dag Wieers 5553b20828 Collated PEP8 fixes (#25293)
- Make PEP8 compliant
7 years ago
Dag Wieers 2f33c1a1a1 find: PEP8, imports, cosmetics (#24646)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers 91ee93ce13 patch: PEP8, imports, cosmetics (#24649)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Ganesh Nalawade 85219dfdf3 Add support to fetch old style junos facts (#25250)
* Add support to fetch old style junos facts

Fixes #25050

Add support to fetch old style facts supported in Ansible <= 2.2
To fetch old style facts value `gather_subset` value shoule be `all`
and `junos-eznc` is required to be installed on control node as a
prerequisite.

* Remove unwanted import
7 years ago
Sloane Hertel 7160a491c2 elasticache: add requirements to parameter_group and snapshot (#24904)
* Add requirements to elasticache parameter group

* add requirements for elasticache_snapshot

* pep8 elasticache_snapshot

* remove elasticache_snapshot from legacy files
7 years ago
Trond Hindenes 055fd6f5f5 New module: win dsc (#24872)
* Added win_dsc module file

* mute output and track reboot requirements

* added tests

* proper conditionals for test

* Added moar conditionals for test

* ci fixes

* Added metadata

* fixed integration test yaml

* ci fix

* ci fix

* added module_version param and output, no longer chokes on multiple versions found.

* ci fix

* code review improvements, make return vars more pythonic, cleanup
removed reference to handles in commit message

* Fixed tests, clearer documentation

* fixed trailing whitespace
7 years ago
Adrian Likins 45a9f96774 Facts Refresh (2.4 roadmap) (#23012)
Facts Refresh (2.4 roadmap)

This commit implements most of the 2.4 roadmap 'Facts Refresh'
- move facts.py to facts/__init__.py
- move facts Distribution() to its own class
- add a facts/utils.py
- move get_file_content and get_uname_version to facts/utils.py
- move Facts() class from facts/__init__ to facts/facts.py
- mv get_file_lines to facts/utils.py
- mv Ohai()/Facter() class to facts/ohai.py and facter.py
- Start moving fact Hardware() classes to facts/hardware/*.py
- mv HPUX() hardware class to facts/hardware/hpux.py
- move SunOSHardware() fact class to facts/hardware/sunos.py
- move OpenBSDHardware() class to facts/hardware/openbsd.py
- mv FreeBsdHardware() and DragonFlyHardware() to facts/hardware/
- mv NetBSDHardware() to facts/hardware/netbsd.py
- mv Darwin() hardware class to facts/hardware/darwin.py
- pep8/etc cleanups on facts/hardware/*.py
- Mv network facts classes to facts/network/*.py
- mv Virtual fact classes to facts/virtual
- mv Hardware.get_sysctl to facts/sysctl.py:get_sysctl

- Also mv get_uname_version from facts/utils.py -> distribution.py
  since distribution.py is the only thing using it.

- add collector.py with new BaseFactCollector
- add a subclass for AnsibleFactCollector
- hook up dict key munging FactNamespaces
- add some test cases for testing the names of facts
- mv timeout stuff to facts.timeout

- rm ansible_facts()/get_all_facts() etc

- Instead of calling facts.ansible_facts(), fact collection
  api used by setup.py is now to create an AnsibleFactCollector()
  and call it's collect method.

- replace Facts.get_user_facts with UserFactCollector
- add a 'systems' facts package, mv UserFactCollector there
- mv get_dns_facts to DnsFactCollector
- mv get_env_facts to EnvFactCollector
- include the timeout length in exception message

- modules and module_utils that use AnsibleFactCollector
  can now theoretically set the 'valid_subsets'

  May be useful for network facts module that currently have
  to reimplement a good chunk of facts.py to get gather_subsets
  to work.

- get_local_facts -> system/LocalFactCollector
- get_date_time -> system/date_time.py
- get_fips_facts -> system/fips.py
- get_caps_facts() -> system/caps.py
- get_apparmor_facts -> system/apparmor.py
- get_selinux_facts -> system/selinux.py
- get_lsb_facts -> system/lsb.py
- get_service_mgr_facts -> system/service_mgr.py
- Facts.is_systemd_managed ->  system/service_mgr.py
- get_pkg_mgr_facts -> system/pkg_mgr.py
- Facts()._get_mount_size_facts() -> facts.utils.get_mount_size()

- add unit test for EnvFactCollector
- add a test case for minimal gather_subsets
- add test case for collect_ids
- Make gather_subset match existing behavior or '!all'

    If 'gather_subset' is provided as '!all', the existing behavior
    (in 2.2/2.3) is that means 'dont collect any facts except those
    from the Facts() class'. So 'skip everything except
    'apparmor', 'caps', 'date_time', 'env', 'fips', 'local', 'lsb',
    'pkg_mgr', 'python', 'selinux', 'service_mgr', 'user', 'platform', etc.

    The new facts setup was making '!all' mean no facts at all, since
    it can add/exclude at a finer granularity. Since that makes more
    sense for the ansible collector, and the set of minimal facts to
    collect is really more up to setup.py to decide we do just that.

    So if setup.py needs to always collect some gather_subset, even
    on !all, setup.py needs to have the that subset added to the
    list it passes as minimal_gather_subset.

    This should fix some intg tests that assume '!all' means that
    some facts are still collected (user info and env for example).

    If we want to make setup.py collect a more minimal set, we can do that.

- force facts_dicts.keys() to a list so py3 works
- split fact collector tests to test_collectors.py

- convert Facter(Facts) -> other/facter.py:FacterFactCollector

- add FactCollector.collect_with_namespace()

    regular .collect() will return a dict with the key names
    using the base names ('ip_address', 'service_mgr' etc)

    .collect_with_namespace() will return a dict where the key names
    have been transformed with the collectors namespace, if there is
    one. For most, this means a namespace that adds 'ansible_' to the
    start of the key name.

    For 'FacterFactCollector', the namespace transforms the key to
    'facter_*'.

- add test cases for collect_with_namespace

- move all the concrete 'which facts does setup.py' stuff to setup.py

    The caller of AnsibleFactCollector.from_gather_subset() needs to
    pass in the list of collector classes now.

- update system/setup.py to import all of the fact classes and pass
  in that list.
- split the Distribution fact class up a bit

    extracted the 'distro release' file handling (ie, linux
    boxes with /etc/release, /etc/os-release etc) into its
    own class.
- extract get_cmdline_facts -> cmdline.py
- extract get_public_ssh_host_keys -> system/ssh_pub_keys.py
- extract get_platform_facts -> system/platform.py

  platform.py may be a good candidate for further splitting.

- rm test for plain Facts() base class
- let the base class for Collector unit tests provide collected_facts

    some Collectors and/or their migrated Facts() subsclasses need
    to look at facts collected by other modules ('ansible_architecture'
    the main one...).

    Collector.collect() has the collected_facts arg for this, so add
    a class variable to BaseFactsTest so we can specify it.

- mv Ohai to other/ohai.py and convert to Collector
- update hardware/*.py to return facts (no side effects)

- mv AnsibleFactCollector to setup.py
- extra collector class gathering to module method in
  facts/__init__.py (collector_classes_from_gather_subset)
- add a CollectorMetaDataCollector collector used to provide
  the 'gather_setup' fact
- add unit test module for 'setup' module
  (test/units/modules/system/setup.py)

- Collector init now doesnt need a module, but collect does

    An instance of a FactCollector() isnt tied to a AnsibleModule
    instance, but the collect() method can be, so optionally pass
    in module to FactCollector.collect() (everywhere)

- add a default_collectors for list of default collectors

  import and use it from setup.py module

  eventually, would like to replace this with a plugin loader
  style class finder/loader

- unit tests for module_utils/facts/__init__.py
- add unit tests for ohai facts collector
- remove self.facts side effect on populate() in hardware/sunos.py
- convert OpenBSDHardware() to rm side effects on self.facts
- try to rm some self.facts side effects in Network()

    plumb in collected_facts from populate() where it is needed.

    stop passing collected_facts into Network() [via cached_facts=,
    where it eventually becomes self.facts]

- nothing provides Fact() cached_facts arg now, rm it

    Facts() should be internal only implementation so nothing
    should be using it.

    Of course, now someone will.

- add a Collector.name attr to build a map of name->_fact_ids

    To properly exclude a gather_subset spec like '!hardware', we
    need to know that 'hardware' also means 'devices', 'dmi', etc.
    Before, '!hardware' would remove the 'hardware' collector name
    but not 'devices'. Since both would end up in id_collector_map,
    we would still end up with the HardwareCollector in the collector
    list. End result being that '!hardware' wouldn't stop hardware
    from being collected.

    So we need to be able to build that map, so add the Collector.name
    attribute that is the primary name (like 'hardware') and let
    Collector._fact_ids be the other fact ids that a collector is
    responsible for.

    Construct the aliases_map of Collector.name -> set of _fact_ids
    in fact/__init__.py get_collector_names, and use it when we are
    populating the exclude set.

- refactor of distribution.py

    make the big OS_FAMILY literal a little easier to read
    Also keys can now be any string instead of python literals

    99% sure the test for 'KDE Neon' was wrong
    I don't see how/where it should or could get 'Neon' instead
    of 'KDE Neon' as provided in os-release NAME=

    Use 'distribution' string for key to OS_MAP

    ie, we dont need to make it a valid python label anymore so dont.

    move _has_dist_file to module as _file_exists
    easier to mock without mucking with os.path

    mv platform.system() calls to within get_distribution_facts() instead
    of Distribution() init.

- remove _json compat module

    The code in here was to support:

      -a 'json' python module that was not the standard one included
      with python since 2.6.

      - potentially fallback to simplejson if 'json' was not available.

    'json' is available for all supported python versions now so
    no longer needed.

- mv get_collector_names -> facts.collector
- mv collector_classes_from_gather_subset -> facts.collector
- mv collector tests from test_facts -> test_collector

- Use six's reduce() in sunos/netbsd hardware facts

- rm extraneous get_uname_version in utils

  only system/distribution.py uses it

- Remove Facts() subclass metaclass usage

  - using fact_id and a platform id for matching collectors

    gut most of Facts() subclasses

    rm Facts() subclasses with weird metaclass

    only add collectors that match the fact_ids and the platform_info
    to the list of collectors used.

    atm, a collectors platform_id will default to 'Generic', and
    any platform matches 'Generic'

    goal is to select collector classes including matching the
    systems platform in collector.py, instead of relying on
    metaclasses in hardware/*. To finish this, the various
    Facts() subclasses will need to be replaced entirely with
    Collector() subclasses.

    use collector classmethod platform_match() to match the platform

    This lets the particular class decide if it is compatible with
    a given platform_info. platform_info is a dict like obj, so it could be
    expanded in the future.

    Add a default platform_match to BaseFactCollector that matches
    platform_info['system'] == cls._platform

    They were needed previously to trigger a module
    load on all the collector classes when we import
    facts/hardare so that the Hardware() and related
    classes that used __new__ and find_all_subclasses()
    would work.

    Now that is done in collectors based on platform matching
    at runtime we dont need to do it py module import/parse
    time. So the non empty __init__.pys are no longer needed
    and their is a more flexible mechanism for selection
    platform specific stuff.

    facts/facts.py is no longer used, rm'ed

- if we dont find an implement class for gather spec.. just ignore it.

  Would be useful to add a warn to warn about this case.

- Fix SD-UX typo (should be HP-UX)

- Port fix for #21893 (0 sockets) to this branch

    This readds the change from 8ad182059d
    that got lost in merge/rebase

    Fixes #21893

- port sunos fact locale fix for #24542 to this branch

    based on e558ec19cd

    Fixes #24542

    Solaris fact fix (#24793)

    ensure locale for solaris fact gathering

    fixes issue with locale interfering with proper reading of decimals

- raise exceptions in the air like we just dont care.

    Pretty much ignore any not exit exception in facts
    collection. And add some test cases.

- added new selinux fact to clarify python lib

    the selinux fact is boolean false when the library is not installed,
    a dictionary/hash otherwise, but this is ambigous
    added new fact so we can eventually remove the type dichtomy and normalize it as a dict

    Re-add of devel commit 85c7a7b844 to
    the new code layout, since it got removed in merge/rebase
7 years ago
Matt Clay 9d8aa43c67 Temporary work-around for setuptools 36.0.0 bug. (#25243)
* Temporary work-around for setuptools 36.0.0 bug.
* Use older setuptools for pip integration test.
* Limit isort version to avoid new test failures.
7 years ago
Trishna Guha 343b83041e nxos_feature fix and unit test (#25200)
* nxos_feature fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_feature unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove from pep8/legacy-file

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha fb87680046 fix state present nxos_evpn_vni (#25212)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Dag Wieers c13b1a718a plugins/terminal/: PEP8 compliancy (#25207)
- Make PEP8 compliant
7 years ago
Chris Alfonso b937bad52e Narrowing the match for python 3 cmp check (#25220)
Allowing the yaml examples in python documentation.
7 years ago
Sloane Hertel 75bdcce072 s3 integration tests (#22920)
* s3 integration tests

* Make s3 integration tests work in standard integration setup and with fish as current shell
see also https://github.com/ansible/proposals/issues/62 if you don't like this much

* test_s3 integration test - substitute command instead of shell where simple

* test_s3 integration test - random contents + complete elimination of use of shell module by moving to tempfile

* move s3 to integration test targets

* Add a couple more test for . in bucket names

Tidy syntax

remove reference to legacy credentials.yml

remove posix/cli/cloud/aws

* remove from legacy testing

* remove dependencies that aren't used
7 years ago
Dag Wieers d958440bcb win_firewall_rule: Implement idempotency, check-mode and diff support (#23162)
* win_firewall_rule: Small idempotency fix

This PR includes the following changes:
- an idempotency fix when `profile: any`
- better difference output to debug idempotency issues
- documentation fixes (remove `required: false`)
- Parameter handling fixes
- RDP example that matches default RDP rule
- Renamed parameter 'enable' to 'enabled' (kept alias)
- Renamed parameter 'profile' to 'profiles' (kept alias)

* Rewrite module completely

The logic is still intact, but various changes with a single goal:

- Make the module idempotent
- Implement check-mode
- Implement diff-mode
- Adapted integration tests

This fixes #18807 and #23455.

* Change casing to lowercase

* Improve the logic wrt. diff
7 years ago
Dag Wieers 0e160d5c7e Ensure exit_json returns failed = False
This is required for modules that may return a non-zero `rc` value for a
successful run, similar to #24865 for Windows fixing **win_chocolatey**.

We also disable the dependency on `rc` value only, even if `failed` was
set.

Adapted unit and integration tests to the new scheme.
Updated raw, shell, script, expect to take `rc` into account.
7 years ago
Evgeni Golov 1f78715848 apt: include arch in check for installed packages on multi-arch systems (#24846)
* apt: include arch in check for installed packages on multi-arch systems

Thanks: Stefan Löwen <stefan.loewen@gmail.com>

Fixes: #24673

* add an integration test for apt's multi-arch handling
7 years ago
Dag Wieers 758cfeb73e contrib: PEP8 compliancy (#24680)
- Make PEP8 compliant
7 years ago
Ricardo Carrillo Cruz 69efb61008 Add provider param to prepare_iosxr_tests role tasks (#25163)
This will avoid passing -u -k to ansible-playbook
7 years ago
Nathaniel Case 53837c2ab0 Assorted nxos_bgp_* fixes (#25080)
* Simplify apply_key_map

* Fix nxapi

* Clean up get_value

* Fix missing non-values

* Add test for existing bgp_af case

* Fix small issues with bgp_neighbor_af
7 years ago
Pierre-Louis Bonicoli a4131197e0 PostgreSQL tests: enforce UTF8
By default, client encoding is determined either from the LANG_*/LC_*
environment variables or using encoding of the database.

Containers used in the CI don't define a default locale, then encoding
of default databases was SQL_ASCII.
7 years ago
Pierre-Louis Bonicoli fb1e7aaa81 Creates cluster the same way Debian package does
This task is only executed when the playbook has already been executed
once, for example using 'ansible-test integration' with '--retry-error'
switch when the first run fails.

This modification allows to recreate default databases (postgres,
template0 and template1) using the same encoding that the one used by
the Debian package.

Default encoding is 'SQL_ASCII' when default locale is not set in
/etc/default/locale.
7 years ago
Pierre-Louis Bonicoli ce856c2123 postgresql_user: add tests with hashed password 7 years ago
Dag Wieers 09ba70f7c4 stat: PEP8, imports, cosmetics (#24653)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers 8d962209f4 mod_utils/cloudengine: PEP8 compliancy (#24659)
- Make PEP8 compliant
7 years ago
Dag Wieers b3b11fbce2 get_url: PEP8, imports, cosmetics (#24676)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers 630185cb20 ansible/executor: PEP8 compliancy (#24695)
- Make PEP8 compliant
7 years ago
Dag Wieers 51b595992b ansible/utils/: PEP8 compliancy (#24686)
- Make PEP8 compliant
7 years ago
Dag Wieers 47738eb1dd docs: PEP8 compliance (#24681)
- Make PEP8 compliant
7 years ago
Dag Wieers 4efec414e7 test/: PEP8 compliancy (#24803)
* test/: PEP8 compliancy

- Make PEP8 compliant

* Python3 chokes on casting int to bytes (#24952)

But if we tell the formatter that the var is a number, it works
7 years ago
Trishna Guha 31c59ad5f9 nxos_portchannel fix and unit test (#25019)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Ricardo Carrillo Cruz fd5db52fd9 Add provider to prepare_ios_tests role tasks (#25162)
This avoids passing -u <user> -k, as it will just consume
the credentials from group_vars
7 years ago
Rene Moser 9cbae80c3b cloudstack: fix pep8 cs_pod 7 years ago
Rene Moser 3ef37e88fe cloudstack: fix pep8 cs_facts 7 years ago
Rene Moser 439f0beca5 cloudstack: fix pep8 cs_domain 7 years ago
Rene Moser 1778e23fad cloudstack: fix pep8 cs_account 7 years ago
Rene Moser e3f75227bc cloudstack: fix pep8 cs_affinitygroup 7 years ago
Rene Moser 9fe3891d65 cloudstack: fix pep8 cs_cluster 7 years ago
Reilly Herrewig-Pope 723c8f06ab Allow setting/unsetting BYPASSRLS Postgres role attribute (#24625)
* Allow setting/unsetting BYPASSRLS role attr

* Build valid role attrs against version

* Add integration tests
7 years ago
René Moser d5b04aa1f1 cloudstack: add check mode tests (#24908)
* cloudstack: test: cs_network_acl: add check_mode tests

* cloudstack: test: cs_pod: add check_mode tests

* cloudstack: test: cs_user: add check_mode tests

* cloudstack: test: cs_sshkeypair: add check_mode tests

* cloudstack: test: cs_project: add check_mode tests

* cloudstack: test: cs_vpc: add check_mode tests

* cloudstack: test: cs_vpn_gateway: add check_mode tests

* cloudstack: test: cs_volume: add check_mode tests

* cloudstack: test: cs_vmsnapshot: add check_mode tests

* cloudstack: test: cs_account: add check_mode tests

* cloudstack: test: cs_affinitygroup: add check_mode tests

* cloudstack: test: cs_cluster: add check_mode tests

* cloudstack: test: cs_domain: add check_mode tests

* cloudstack: test: cs_instancegroup: add check_mode tests

* cloudstack: test: cs_iso: add check_mode tests

* cloudstack: test: cs_loadbalancer_rule: add check_mode tests

* cloudstack: test: cs_portforward: add check_mode tests

* cloudstack: test: cs_resourcelimit: add check_mode tests

* cloudstack: test: cs_securitygroup: add check_mode tests

* cloudstack: test: cs_securitygroup_rule: add check_mode tests

* cloudstack: test: cs_configuration: add check_mode tests

* cloudstack: test: cs_firewall: add check_mode tests

* cloudstack: test: cs_instance: add check_mode tests

* cloudstack: query current tags from API

Fixes unexpected tags returned in check mode.
7 years ago
Brendan Almonte 2af5556901 Added autoclean/autoremove for the apt module
- Removed alias autoclean from autoremove.
- Added independent execution of apt-get autoclean/autoremove
- Continued to support --auto-remove as a flag to install/remove

Fixes #22222 #24718
7 years ago
Robin Roth 8fca263560 Refactor zypper version parsing and handling (#24056)
Fixes #23516
7 years ago
Nathaniel Case 8985f7c930 nxos_static_route updates (#24992)
* Add static_route tests
* Add VRF tests
7 years ago
Trishna Guha 6a3ce18e4b add more testcases for nxos_evpn_vni (#24996) 7 years ago
Brendan Almonte b820d024fc Add alternative syntax for upgrading all installed packages via apt (#25007)
syntax: 'apt: name=* state=latest'

feature #24189
7 years ago
kkjang 5c43bd3bae Cmp python3 compat (#25008)
* Use double-quotes for expect integration tests

* Cast user input to string for expect integration tests

* Remove usage of cmp() for python3 compatibility

- Add code smell test to look for cmp usage

- Fixes #24756
7 years ago
Tim Rupp 6ef022b034 Adds the bigip_snmp_trap module to Ansible (#24848)
This patch adds the bigip_snmp_trap module to Ansible to support managing
SNMP trap destinations on an F5 BIG-IP.
7 years ago
Ganesh Nalawade 825d9df5ea Add eos changes for Python3 (#24600)
* eos python3 changes

* changes to convert response from byte to text

* Add dellos6 python3 changes
Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

* Fix py3 prompt issue for invalid show command
* Fix review comments
* Add generic fix for error prompt in py3
* Fix CI issue
* Fix network_cli unit test failure
7 years ago
bengerman13 4b6db5db7c add xattr integration tests to ci (#24950)
* add xattr integration tests to ci

* fix package syntax

* remove unnecessary become, disable xattr for bsd and osx
7 years ago
kkjang daada2000c Fix expect for python 3 (#24912)
* Fix expect for python 3

- Change generator next to python 3 compatible
- Added tests for expect

* Add pexpect to integration.txt

- add pexpect library to requirements for integration tests

* Use ansible_python_interpreter in integration tests for expect

* Use double-quotes for expect integration tests

* Cast user input to string for expect integration tests

* Cast user input to string earlier in expect integration tests

* Use ansible.module_utils.six.moves input for expect integration tests

* Fix yamllint errors in the expect test

* Use cat to trigger timeout for expect integration tests

* Use realpath filter in expect integration tests
7 years ago
Dag Wieers 66355df917 module_utils/six: PEP8 compliancy
- Make PEP8 compliant
7 years ago
Brian Coca 8f97aef1a3 Transition inventory into plugins (#23001)
* draft new inventory plugin arch, yaml sample

 - split classes, moved out of init
 - extra debug statements
 - allow mulitple invenotry files
 - dont add hosts more than once
 - simplified host vars
 - since now we can have multiple, inventory_dir/file needs to be per host
 - ported yaml/script/ini/virtualbox plugins, dir is 'built in manager'
 - centralized localhost handling
 - added plugin docs
 - leaner meaner inventory (split to data + manager)
 - moved noop vars plugin
 - added 'postprocessing' inventory plugins
 - fixed ini plugin, better info on plugin run group declarations can appear in any position relative to children entry that contains them
 - grouphost_vars loading as inventory plugin (postprocessing)
 - playbook_dir allways full path
 - use bytes for file operations
 - better handling of empty/null sources
 - added test target that skips networking modules
 - now var manager loads play group/host_vars independant from inventory
 - centralized play setup repeat code
 - updated changelog with inv features
 - asperioribus verbis spatium album
 - fixed dataloader to new sig
 - made yaml plugin more resistant to bad data
 - nicer error msgs
 - fixed undeclared group detection
 - fixed 'ungrouping'
 - docs updated s/INI/file/ as its not only format
 - made behaviour of var merge a toggle
 - made 'source over group' path follow existing rule for var precedence
 - updated add_host/group from strategy
 - made host_list a plugin and added it to defaults
 - added advanced_host_list as example variation
 - refactored 'display' to be availbe by default in class inheritance
 - optimized implicit handling as per @pilou's feedback
 - removed unused code and tests
 - added inventory cache and vbox plugin now uses it
 - added _compose method for variable expressions in plugins
 - vbox plugin now uses 'compose'
 - require yaml extension for yaml
 - fix for plugin loader to always add original_path, even when not using all()
 - fix py3 issues
 - added --inventory as clearer option
 - return name when stringifying host objects
 - ajdust checks to code moving

* reworked vars and vars precedence
 - vars plugins now load group/host_vars dirs
 - precedence for host vars is now configurable
 - vars_plugins been reworked
 - removed unused vars cache
 - removed _gathered_facts as we are not keeping info in host anymore
 - cleaned up tests
 - fixed ansible-pull to work with new inventory
 - removed version added notation to please rst check
 - inventory in config relative to config
 - ensures full paths on passed inventories

* implicit localhost connection local
7 years ago
Brian Coca 6fa5dbdb5c fixed pep8 issues 7 years ago
bengerman13 25aac6151f add integration tests for xattr module (#24947)
* add integration tests for xattr module

* fix whitespace
7 years ago
jhawkesworth b46c098581 Added win_copy recursive integration test with trailing path separator. (#24523)
This is a reproducer for https://github.com/ansible/ansible/issues/23559

Tests will fail until https://github.com/ansible/ansible/pull/23581 is merged

Note that I believe another commit is also needed for this to work,
specifically the change from: https://github.com/ansible/ansible/pull/23326
7 years ago
Nathaniel Case dd4a79d7d3 Clean up nxos_bgp_neighbor_af (#24890)
* Fix pep8 in bgp_neighbor_af
* Remove WARNINGS
* Rewrite command detection
* Add bgp_neighbor_af test
* Finally kill invoke
7 years ago
Brian Coca e0e94a4d02 reinstated to legacy
(cherry picked from commit a6484da0f11d03056b446526ef1cf78f968ae3ee)
(cherry picked from commit f23e766efa859b25557537d5098de557e85120cf)
7 years ago
Trishna Guha 4066b03a4c nxos_evpn_global refactor (#24919)
* nxos_evpn_global refactor

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* ansibot told me to do this

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
pdasilva f8e47e2204 Changed assemble_from_fragments to use os.path.join (#24909)
Fixes #19437
7 years ago
pdasilva 3b45a9eb58 Test for _get_url_data in jenkins_plugin.py (#24905)
* Test for _get_url_data in jenkins_plugin.py

* PEP8 fix
7 years ago
Tim Rupp 4fc40304d5 Adds the bigip_command module to Ansible (#24850)
This patch adds the bigip_command module to Ansible to support arbitrary
tmsh command to a F5 BIG-IP.
7 years ago
Ricardo Carrillo Cruz b12beca3ed Refactos nxos_ip_interface module (#24885) 7 years ago
René Moser d96195131f cloudstack: test: improve startup time, fix network dependency on run (#24876) 7 years ago
Ganesh Nalawade 7563d93901 Add nxos changes for Python3 (#24602)
* Add nxos changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

* Fix CI issues

* Fix review comment

Replace surrogate_or_strict with
surrogate_then_replace as per review
comment os PR #24601
7 years ago
Trishna Guha 1e5a0982b9 Fix nxos_hsrp and add unit test (#24770)
* nxos_hsrp fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* unit test nxos_hsrp

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* ansibot told me to do this

* revert apply_key_map and simplify method
7 years ago
Trishna Guha 4782a4e62f Make host required field and minor refactor (#24534)
* Make host required field and minor refactor

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* ansibot pep8 legacy file

* example doc update
7 years ago
Tim Rupp 22e096f911 Changes skip test for bigip user (#24799)
All of the F5 Ansible modules will come to require the same major
dependencies over time. This mentions that.
7 years ago
Trishna Guha 998305a493 nxos_ospf_vrf fix and unittest (#24495) 7 years ago
Tim Rupp c1397626fc Adds the bigip_user module to Ansible (#24753)
The patch adds the bigip_user module to Ansible to support managing
users on an F5 BIG-IP.

Unit tests are provided. Integration tests can be found here

  * https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_user.yaml
  * https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_user/tasks
7 years ago
Tom Melendez 13f2d9222f [GCP] Global Load Balancer Integration Test (#24704)
* Revert to using url_map internal to the module to allow parameter generation to work. module parameter is still url_map_name.

* [GCP] Cross Region Load Balancer Integration Test
7 years ago
Matt Clay 53180ebb57 Fix Shippable BASE_BRANCH lookup on merges. 7 years ago
Dag Wieers c4a7f64c02 ansible/galaxy: PEP8 compliancy (#24696)
- Make PEP8 compliant
7 years ago
Dag Wieers 6f6bdf7914 ansible/parsing: PEP8 compliancy (#24701)
- Make PEP8 compliant
7 years ago
Matt Clay 5babe2daea Increase python version coverage for tests. (#24762)
* Improve ansible-test inventory handling.
* Fix python 3 re-raise of exception from thread.
* Fix python 3 encoding for windows-integration.
* Run network tests on multiple python versions.
* Run windows tests on multiple python versions.
* Support Shippable delegation using --tox.
* Skip vyos_command on python 3 tests until fixed.
* Add python 3 filtering to local and tox.
* Fix tests to support back to back runs.
* Temporarily test networking with python 2.7 only.

Running the tests back to back causes intermittent test failures
which need to be addressed before we can test multiple versions
in a single test run.
7 years ago
Tom Melendez c99c3b2b5d [GCP] Healthcheck module (#24564)
* [GCP] Healthcheck module

* fix return YAML block

* removed update_ return value; removed python26 check; typos and docs updates

* doc fix

* Updated int test for no-update conditions

* added filter_gcp_fields test

* fixed bug in update where dictionary wasn't built correctly and port was not being set.

* added default values to documentation block
7 years ago
Tom Melendez 3fbf3b51ff [GCP] remove ansible.utils.display for deprecations (#24738)
* [GCP] remove ansible.utils.display for deprecations, use module.deprecate instead.

* removed test file from legacy files
7 years ago
Dag Wieers ac1017b7ad ansible/constants: PEP8 compliancy (#24692)
- Make PEP8 compliant
7 years ago
Dag Wieers 37bfca23c9 slurp: PEP8, imports, cosmetics (#24677)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers ea27baf7ff examples/: PEP8 compliancy (#24682)
- Make PEP8 compliant
7 years ago
Dag Wieers de907a8e36 ansible/compat/: PEP8 compliancy (#24689)
- Make PEP8 compliant
7 years ago
Dag Wieers ac27c54c2e ansible/errors: PEP8 compliancy (#24693)
- Make PEP8 compliant
7 years ago
Matt Clay f5332de83d PEP 8 fixes. 7 years ago
Ganesh Nalawade 38eeeb755d Add ios changes for Python3 (#24601)
* Add ios changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
pep8 fixes

* Fix CI issues

* Fix review comment
7 years ago
Matt Clay c4a2deda9d Restore disabled opensuse integration tests. 7 years ago
Abhijeet Kasurde ad41d0e88f Pep8 fixes for parted (#24713)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 036ba7eeec Clean up Shippable tools and update job handling.
- Tools are now in a tools subdirectory.
- Removed obsolete ansible-core-ci tool.
- Added run.py for starting new CI runs.
- Improved handling of run IDs and URLs.
- General code cleanup and docs updates.
- Nightly CI runs use complete coverage.
7 years ago
Trishna Guha 8937246f8f Fix nxos ospf and Unit test (#24613)
* nxos_ospf fixes refactor

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* unit test nxos_ospf

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay 6e160650e9 Fix run filter on Shippable downloader. 7 years ago
Daniel Shepherd cf4806d29d [cloud] Update AWS CloudTrail module to use boto3 and updated/new CT parameters (#22884)
remove cloudtrail.py from legacy-files as it passes pep8 tests now

update return values to use snake case per coding guidelines

update boto3 exception handling to use method outlined in coding guidelines

update parameter spec and return value code per PR code review
7 years ago
Tom Melendez 07c55b855a [GCP] Forwarding Rule module (#24627)
* [GCP] Forwarding Rule module

* pep8 formatting for tests

* remove py26 check and updated_ key; docs and typo fixes
7 years ago
Ganesh Nalawade a3c689bf0d Add sros changes for Python3 (#24604)
* Add sros changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

Code cleanup
pep8 fixes

* Fix CI issue
7 years ago
Ganesh Nalawade 16d610c1de Add vyos changes for Python3 (#24603)
* Add vyos changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
pep8 fixes

* Fix CI issues
7 years ago
Ganesh Nalawade f4e1dc503b Add iosxr changes for Python3 (#24605)
* Add iosxr changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

* Fix CI issue
7 years ago
Dag Wieers 9a5a61bdca hacking/: PEP8 compliancy (#24683)
- Make PEP8 compliant
7 years ago
Dag Wieers 4f29662a9e ansible/vars/: PEP8 compliancy (#24685)
- Make PEP8 compliant
7 years ago
Matt Clay 9178e176b5 Limit sphinx version on python 2.6. (#24678)
* Limit sphinx version on python 2.6.
* Fix issues identified by rstcheck.
7 years ago
Will Thames 9a958da57e [cloud] Make ec2_vpc_nat_gateway results consistent (#24042)
Ensure newly created NAT gateways get converted to snake dict
Remove custom code, and associated test, for generating snake
dict and use `camel_dict_to_snake_dict`
Make use of `required_if` rather than bespoke parameter checks
Remove ec2_vpc_nat_gateway from pep8 legacy files list
7 years ago
Ganesh Nalawade f5d865a208 Fixes #24251 save config only if it is changed (#24345)
* Fixes #24251 save config only if it is changed

Save to startup configuration only when it is different
from running configuration.

* Fix unit test issue
7 years ago
Dag Wieers c6533d4da9 utils/unicode: PEP8 compliancy (#24668)
- Make PEP8 compliant
7 years ago
Nathaniel Case f240ba6b60 nxos_bgp_neighbor cleanup (#24446) 7 years ago
Dag Wieers 61d68275e8 module_utils/asa: PEP8 compliancy (#24655)
- Make PEP8 compliant
7 years ago
Matt Clay 4daa16f9ce Add --all and --stub coverage options.
ci_coverage
ci_complete
7 years ago
Rene Moser e34fd20452 cloudstack: test: fix setup cs_vpc not using zone 7 years ago
Abhijeet Kasurde 764b4b20ec Fix UnboundLocalError in basic.py
* Fix for UnboundLocalError while accessing deprecations
  in result
* Add Unit test

Fixes #24592

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 6a2a7a2392 Enable codecov.io and add coverage grouping. 7 years ago
Matt Clay a23f503286 Temporarily disable cs_network_acl test in CI.
This test currently conflicts with cs_vpc, causing it to fail if
both tests are run together.
7 years ago
René Moser 3ca3163af1 cloudstack: add new module cs_network_acl (#24609) 7 years ago
Matt Clay fdcad0f44d Improve on-demand coverage for Shippable. 7 years ago
Matt Clay 5cb5228cde Implement on-demand coverage on Shippable. (#24535) 7 years ago
Toshio Kuratomi d834412ead Fix for persistent connection plugin on Python3 (#24431)
Fix for persistent connection plugin on Python3.  Note that fixes are also needed to each terminal plugin.  This PR only fixes the ios terminal (as proof that this approach is workable.)  Future PRs can address the other terminal types.

* On Python3, pickle needs to work with byte strings, not text strings.
* Set the pickle protocol version to 0 because we're using a pty to feed data to the connection plugin.  A pty can't have control characters.  So we have to send ascii only.  That means
only using protocol=0 for pickling the data.
* ansible-connection isn't being used with py3 in the bug but it needs
several changes to work with python3.
* In python3, closing the pty too early causes no data to be sent.  So
leave stdin open until after we finish with the ansible-connection
process.
* Fix typo using traceback.format_exc()
* Cleanup unnecessary StringIO, BytesIO, and to_bytes calls
* Modify the network_cli and terminal plugins for py3 compat.  Lots of mixing of text and byte strings that needs to be straightened out to be compatible with python3
* Documentation for the bytes<=>text strategy for terminal plugins
* Update unittests for more bytes-oriented internals

Fixes #24355
7 years ago
Ilya Drey 62b8813873 Improving nxos_ip_interface module (#21353)
* Improving of nxos_ip_interface module

Added features:

  * Route tags for an IP address at interface level with 'tag' option
  * Support of IPv4 secondary addresses if option 'allow_secondary' is
true (false by default). If option 'allow_secondary' is true primary
IPv4 address will be replaced

All features support NXAPI and CLI transport, but only with text/raw
output. Currently not possible to get route tags for secondary IPv4/IPv6
addresses from JSON output.

Other changes:
  * Module return state 'changed' only when configuration commands were
executed
  * Module result includes multiple prefixes if IPv4 addresses were
found

* Fix PEP8 issues

* Addition fix of PEP8 issues

* Remove unused variable from main()

* Fix "proposed" sample in RETURN variable

* Fix "existing" sample in RETURN variable

* Update RETURN variable

Add 'secondary' for every element of 'addresses' list.

* Restore old version number

* Added exception when ipaddress module is imported

* DOCUMENTATION string was updated

  * Added 'version_added' for new features
  * Added 'requirements' for module

* Added compatibility with latest commit in devel branch

* DOCUMENTATION was fixed
* Improve changes of route tag for existing ip addresses
* Added compatibility with core code

* Fixed mistypes in the DOCUMENTATION variable

* argument_spec fixed

allow_secondary argument type was changed according to allowed choices.
7 years ago
John R Barker e9e2d67035 Run vyos_command Network tests in Shippable (#24514)
* Run VyOS Network tests in Shippable

* net_command no longer exists

* network/ci

* Disable other network tests

* pep8 fix

* Fix PEP 8 issue.
7 years ago
Matt Clay 771b467941 Disable unstable win_psexec integration test. 7 years ago
Matt Clay af5db3e4a9 Revert "Add support for on-demand coverage on Shippable."
This reverts commit 7b3f0b8870.
7 years ago
Matt Clay 7b3f0b8870 Add support for on-demand coverage on Shippable.
Triggered by setting the COVERAGE environment var to a non-empty value.
Alternatively the string `ci_coverage` can be added to a commit message.
7 years ago
Matt Clay dfd19a812f Miscellaneous bug fixes for ansible-test.
- Overhauled coverage injector to fix issues with non-local tests.
- Updated integration tests to work with the new coverage injector.
- Fix concurrency issue by using random temp files for delegation.
- Fix handling of coverage files from root user.
- Fix handling of coverage files without arcs.
- Make sure temp copy of injector is world readable and executable.
7 years ago
Brian Coca c50cf22d52 deal with null/none connections
fixes #23621
pushed 'connection resolution' to play_context
override fieldattribute getter
7 years ago
Tom Melendez 4a5cf0b5c1 [GCE] [GCP] UrlMap module (#24422)
* [GCP] UrlMap module

This module provides support for UrlMaps on Google Cloud Platform.  UrlMaps allow users to segment requests by hostname and path and direct those requests to Backend Services.

UrlMaps are a powerful and necessary part of HTTP(S) Global Load Balancing on Google Cloud Platform.

UrlMap takes advantage of the python-api so the appropriate infrastructure has been added to module_utils.

More about UrlMaps can be found at:
https://cloud.google.com/compute/docs/load-balancing/http/url-map

UrlMap API:
https://cloud.google.com/compute/docs/reference/latest/

Google Cloud Platform HTTP(S) Cross-Region Load Balancer:
https://cloud.google.com/compute/docs/load-balancing/http/

* updated documentation, remmoved parens

* fixed tabs
7 years ago
Abhijeet Kasurde 728d3e6c84 Pep8 fixes for web_infra/ansible_tower (#24479)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay fb9efd3c7e Add `--remote-terminate` option to ansible-test.
Set `--remote-terminate success` for osx tests.
7 years ago
Jon Hadfield eb4cc31ae5 [cloud] migrate ec2_asg to boto3 and support application ELB target groups. (#19667)
* switch to boto3 and add support for application ELBs with target groups.

* use py23 compatible dict iterator.

* removing commented out fail_json calls

utilize sets to simplify logic

remove setting a redundant variable

add bounds checking in two places

add AWSRetry decorator - do we want this for other functions too?

change xrange to range so python3 doesn't fail

remove sorting lists of dicts; in python2 this returns None, in python3 this fails

* remove error variable from traceback.format_exc

* Remove boto2-style calls brought in by rebase

Old boto-style calls to `as_group` attributes break in boto3

Also remove module from legacy-PEP8 list

* Add  parameter to target_group_arn option

* Fix HAS_BOTO3 check

* use tags.items() instead of iteritems

* import botocore

* Fixed bugs in deleting autoscaling groups

* make changes in deleting autoscaling groups pep8

* more pep8

* fix version

* fix bugs so local integration tests run

* fix launch config check

* reflect changed status for ASG updates

* Fix existing exception handling and use traceback.

Fix imports

* line length

* Fix notification setup

* Fix mutually exclusive arguments
Only one of the AvailabilityZones and VPCZoneIdentifier arguments should be provided to the CreateAutoScalingGroup call.

* Allow desired_capacity, min_size, max_size, launch_config_name to be derived from the existing ASG if not specified

Remove code updating dict after ASG already uses it
7 years ago
Matt Clay 496280858d Revert "Temporarily disable test which fails in group run."
This reverts commit 99d328976d.
7 years ago
Matt Clay b8cb3f519b Detect and fix environment tampering in tests. 7 years ago
Matt Clay 99d328976d Temporarily disable test which fails in group run. 7 years ago
Abhijeet Kasurde 3d51081a59 Refactor nxos_reboot module (#24484)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Trishna Guha b2a2f69a6e nxos_vrf_af fix and unit test (#24399)
* nxos_vrf_af fix and unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* ansibot told me to do this

* use sorted() as the test list elements differ in order for python2.x and 3.x
7 years ago
Trishna Guha 62eafa8837 fixes nxos_evpn_vni and unittest (#24372)
* fixes nxos_evpn_vni

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fixes pep8 issue and syntax error

* ansibot tole me to do this

* Unit test
7 years ago
Dag Wieers e855274dc8 win_psexec: Enable -nobanner option by default (#23422)
* win_psexec: Enable -nobanner option by default

PR also includes:
- Option `nobanner:` to remove this flag
- Improvements to Examples
- Improvement to Return Value
- Add types to all parameters now
- Add (limited) integration tests

* Move sysinternals into C:\Windows\Temp
7 years ago
Nathaniel Case 09b2964dee nxos_bgp_af updates (#24171)
* update docs
* clean up nxos-bgp_af
* Remove useless params from bgp_af
* Add bgp_af tests
7 years ago
Abhijeet Kasurde 2f26c5285a Refactor nxos_file_copy module (#24314)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
jctanner e9c2546ffe Add integration test targets for core supported modules (#24217)
A preliminary set of test targets for "core" supported module that had no independent tests. These will also help us ensure python3 compatibility for those modules and prevent future regressions.
7 years ago
René Moser 2ef6713abb cloudstack: new module cs_vpn_gateway (#23954)
* cloudstack: new module cs_vpn_gateway
* add integration tests for cs_vpn_gateway
7 years ago
Matt Martz d3249e7875 pep8 fixes for contrib (#24344) 7 years ago
Matt Davis ead23783be slightly increase win_async_wrapper fire and forget sleeptime
* should fix Shippable timeouts when AWS CPU credits are low- right on the bubble of failure w/ 5s execution
7 years ago
Martin Kopta e1d896052d unit test for #24330 (#24346) 7 years ago
Dag Wieers bc806ff479 Windows: Small fix to Add-Warning and Add-DeprecationWarning (#23520)
Simplified the logic, and fix the issue of having a nested list as
entry.

Also indicate that we deliberately want to retain $null values
(and i.e. do not want them to be turned into a boolean).
7 years ago
Ganesh Nalawade 5b3ea6562b Add junos integration test (#24404) 7 years ago
Benjamin Jolivot e99815e9f5 Fortios file only mode + integration tests (#23275)
* WIP file_mode

* WIP

* Add file_mode + integration tests

* fix pep8

* Update doc fragments
Create mutualy_exclusive param
Fix yamllint problem in tests

* Add aliases file + main playbook for fortios

* Install pyfg before running tests

* Install pyfg before running tests in role

* Remove pre_task as it's done in roles

* Force pyFG minimal version for python3

* role_path not role_dir :(

* Change requirements

* Specify Error type when error on import

* Bug in pygf library with python 2.5 (PR is waiting https://github.com/spotify/pyfg/pull/19)

* Bad requirement format

* still bad format -_-'

* remove test/integration/fortios.py (auto generated by tests)
missing new lines at end of file

* pyFG is now fixed in 0.50
7 years ago
Abhijeet Kasurde e342b281d8 Check if api_key and app_key before proceeding (#24336)
Fix adds check if app_key and api_key provided by
user is correct or not. If this combination is wrong
then fail with appropriate error message given by
Datadog server

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay d999d613cb Python 3 fixes for CloudStack modules and tests. (#24400) 7 years ago
Matt Clay e6934e42be Update ansible-test change handling and CS plugin. (#24395)
* Use CloudStack simulator from Ansible repo.
* Recognize cloud specific ansible-test changes.
* Hide ansible-test cs notice in explain mode.
7 years ago
René Moser aaf4f04574 automated integration tests for cloudstack (#20552) 7 years ago
Nathaniel Case 830f19d444 nxos_bgp updates (#24270)
* Remove invoke from nxos_bgp
* Try to simplify get_existing
* Streamline state_present
* More testing, squash & compact get_value & get_custom_value
* Streamline main
* nxapi has problems reading CustomNetworkConfig directly
7 years ago
Abhijeet Kasurde 2425143cf2 Pep8 fixes for digital_ocean_*
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 9c5b55232c Pep8 fixes for Windows module (#24349)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 86bf27511c Migrate cs_sshkeypair test to ansible-test. 7 years ago
Matt Clay 0573b8bcd2 Fix ansible-test cloud integration bugs. 7 years ago
Matt Clay 17e07a27b2 Enable cloud tests for use with ansible-test. 7 years ago
Matt Clay ac72fd9d2c Add missing return statements. 7 years ago
Matt Clay 201242f302 Fix call to wrong method in ansible-test. 7 years ago
Trishna Guha ad0a01ffb5 nxos_vrf refactor (#24280)
* nxos_vrf refactor

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Unit test for nxos_vrf
Remove unnecessary keys() method
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay 1582e9bf7d Fix handling of Shippable env vars. 7 years ago
Matt Clay a07d42e16d Add support for cloud tests to ansible-test. (#24315)
* Split out ansible-test docker functions.
* Add cloud support to ansible-test.
7 years ago
Ganesh Nalawade 0e756a1cf9 Add junos unit test case (#24249)
* Add junos modules unit test case

* Fix CI issues
7 years ago
Toshio Kuratomi a0dfa8616a Make fetch default to fail on errors
Fixes #23501
7 years ago
Toshio Kuratomi 36d7c0c403 Fix places where path needs to be bytes on python3
These were discovered on python3 with fetch code that fails on errors.  Probably could be
provoked with particular sets of arguments to stat as well.
7 years ago
Sloane Hertel ad8cb903f4 rds: do not update multi-az unless specified - fixes #23385 (#23498)
* allow multi_az to be unmodified if not explicitly specified

* fix pep8 and remove from legacy files
7 years ago
Matt Martz 2fbfba0ef3 Make Reporter class hold all results, move line/col into results, and out of message (#24127)
* Make Reporter class hold all results, move line/col into results, and out of message

* Move line/col out of message for YAML parser errors

* We have lineno for the DOC var, use it for YAML parser errors

* Remove valdiate-modules files from legacy-files

* pep8 indentation fixes

* Add todo for line/col in _validate_docs_schema
7 years ago
Matt Clay 6522d703a1 Fix ansible-test pylint and pep8 issues. (#24245)
* Fix pylint useless-super-delegation issues.
* Fix miscellaneous pylint issues.
* Fix PEP 8 issues.
* Fix warnings reported by PyCharm.
7 years ago
Matt Clay 00f8e3d360 Fixes for EC2 module integration tests. 7 years ago
Ganesh Nalawade a42b892f70 Fix junos_rpc and junos_user broken issues (#24238)
* Fix junos_rpc and junos_user broken issues

Add persistent connection related changes.

* Fix CI issues
7 years ago
Abhijeet Kasurde 465c12ccdb Pep8 fixes for deploy_helper (#24237)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 7195c31753 Refactor openvswitch_port module (#24205)
Use current patterns from other network modules for better
maintainability.
7 years ago
Abhijeet Kasurde 53f0cd197e Pep8 fixes for jira (#24229)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde b6b3f84990 Pep8 fixes for htpasswd (#24230)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde fbb924ff24 Pep8 fixes for letsencrypt module (#24144)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde df5be2b8ea Pep8 fixes for django_manage (#24198)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Robin Roth 0cf00db750 Make git module pep8 compliant (#24196) 7 years ago
Sloane Hertel e13fc5d6bd elasticache_parameter_group: fix documentation and exception handling - fixes #23709 (#23718)
* fix documentation and correct exception handling

* follow AWS exception guidelines

* fix parameter_group_family req; only needed when creating cache parameter group

make pep8 and remove from legacy files
7 years ago
Sloane Hertel fcaa49b536 sns: move from notification directory to cloud/amazon directory - fixes #11874 (#23805)
* move sns to cloud directory

* make sns pep8 and remove from legacy files
7 years ago
Abhijeet Kasurde 9d9e9a79e2 Pep8 fixes for apache2 module (#24185)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Andrea Tartaglia 4e4fc9cb4c Added test for 'RETURN' field in validate-modules (#23322)
* Added test for 'RETURN' field in validate-modules

* print the field being tested.

Useful when the RETURN structure is complex.

* Fixed schema after CI traceback fail

* Fixed list_string_types

* Fixed line in 319 code for RETURN
7 years ago
Toshio Kuratomi 3428f42120 Add integration test that modules are loaded from the expected locations (#24170)
* Add integration test that modules are loaded from the expected locations
* Fix ping module to pass PEP8
7 years ago
Matt Martz 040fb4435a Fix password prompt matching (#24081)
* Fix password prompt matching

* Add some tests for check_password_prompt

* Prevent pep8 line ends with a space error
7 years ago
Abhijeet Kasurde d8f76bed97 Misc fixes and Pep8 fixes for proxmox_* modules (#24162)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde cdca648f15 Pep8 fixes for jenkins_* module (#24154)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Toshio Kuratomi d088030fa6 Facts Timeout was not settable via ansible.cfg
The timeout for gathering facts needs to be settable from three places
(highest precedence to lowest):

* programmatically
* ansible.cfg (equivalent to the user specifying it explicitly when
  calling setup)
* from the default value

The code was changed in b4bd6c80de to
allow programmatically and the default value to work correctly but
setting via ansible.cfg/parameter was broken.

This change should fix setting via ansible.cfg and adds unittests for
all three cases

Fixes #23753
7 years ago
Abhijeet Kasurde 806506c032 Pep8 fixes for taiga_issue module (#24143)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
René Moser 594d7d5d9d cloudstack: cs_region: fix pep8 (#24134) 7 years ago
Toshio Kuratomi 1c05ed7951 Fix circular import with unsafe_proxy, template, and vars
template/__init__.py imported unsafe_proxy from vars which caused
vars/__init__.py to load.  vars/__init__.py needed template/__init__.py
which caused issues.  Loading unsafe_proxy from another location fixes
that.
7 years ago
Toshio Kuratomi 500de1f557 Remove hack for backwards compatible v2_playbook_on_start callback
Just after release of 2.0.0 (in 2.0.0.1) we had a change to the API of
callbacks without bumping the API version.  We added the playbook to the
arguments passed to the callbacks.

This wasn't in the Tower callback at the time.  In order to prevent
breaking that callback we added a temporary hack to inspect the
callback's API to decide if we needed to call it with arguments or not.

We scheduled the hack for removal in January 2017.  Since that's now
past, removing the hack.

Change signed off by matburt on the Tower side.
7 years ago
Ricardo Carrillo Cruz 467a9bdd4e Refactor openvswitch_bridge (#24014)
Use common patterns from other network modules for better
maintainability.
7 years ago
SesquipedalianDefenestrator 3f321e7591 Add check_mode to get_url (#20532)
* Add check_mode to get_url that does a HEAD request to make sure the URL exists, but doesn't write the real file

* Add info about new --check behavior to docs.  Add tests for the new behavior.  Populate res_args with the info the tests are looking for.

* Add trailing comma

* Change nonexistent test URL to http://{{httpbin_host}/DOESNOTEXIST.  Fix spacing while I'm at it

* Further spacing cleanup

* State that this functionality is in Ansible 2.4+
7 years ago
Abhijeet Kasurde ca7616b4a1 Pep8 fixes for ha_proxy module (#24090)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
John R Barker ecbf8e933a Docs how to test (2nd) (#24094)
* Big testing doc refactor
* Combine all the testing documentation in to one place to make it easier to find
* Convert everything to RST
* Create testing_network guide
* Create testing landing page
* For each section detail "how to run" and "how to extend testing"
* More examples
* Lots more detail
7 years ago
Pierre-Louis Bonicoli a13d89da68 Debian: really generate locales
/usr/sbin/locale-gen differs between Debian and Ubuntu. With Debian,
locales must be added to /etc/locale.gen before calling locale-gen
command. With Ubuntu, /etc/locale.gen is updated by
/usr/sbin/locale-gen.

Use the locale-gen module which handles both distributions.
7 years ago
Pilou bf5d87af07 PostgreSQL Integration test suite: improvements (#23631)
* PostgreSQL tests: use package module
* PostgreSQL tests: use ansible_service_mgr in order to test init system
* PostgreSQL tests: fix a typo
* PostgreSQL tests: install only required packages
* PostgreSQL tests: use role default value when unchanged
7 years ago
Matt Clay 9f56f87770 Fix PEP 8 issue. 7 years ago
Trishna Guha 2741907cba Refactor nxos_interface and add unit test (#24008)
* [WIP] Refactor nxos_interface

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Modification in refactor
Unittest for nxos_interface
7 years ago
Nathaniel Case 689b93bf14 Junos_config unicode (#23369)
* Try to handle unicode output more sensibly

* Appears I'm getting latin1 instead

Ugh.
7 years ago
John R Barker 1c61b9bae7 Split modules/network into two parts (#24024)
* Split modules/network into two parts

Given the dedicated team we we have working on Ansible Networking a
clearer split is needed between Networking modules and "things that
happen to use the network"

* nmcli to net_tools

* nmcli moved
7 years ago
Colin Chan 2d9d1762ba Improve parsing of 'systemctl show' output 7 years ago
Nathaniel Case fc0bf87c20 Run `save` inside config mode. (#23977)
* Run `save` before exiting config mode.

* Fix unit tests for `save`

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

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

Move `save` tests to integration tests
7 years ago
Ganesh Nalawade 9c4daded94 Add junos_config unit test (#24005) 7 years ago
Ricardo Carrillo Cruz 2716fad38f Return commands instead of command (#24061)
Ok, so for openvswitch_db in particular we just return one command
but in the sake of consistency and code re-use, let's return a list
of "commands", even if it's just one.
7 years ago
Abhijeet Kasurde 9456f93ea8 Pep8 fixes for known_hosts.py (#24029)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 7c1b8da1a1 Refactor openvswitch unit tests (#24055)
Rather than passing a file to load fixture, build a matrix containing
the run_command side_effect per test.
This will allow more code-reuse for other ovs modules unit tests.
7 years ago
Senthil Kumar Ganesan ce99ffe205 Fixed PEP8 issues (#24030) 7 years ago
Matt Clay d662f6f0db Fix bugs in ansible-test units command. (#24044)
* Handle old versions of coverage.
* Handle old versions of setuptools.
* Detect python version for docker/remote units.
* Add sanity override for test constraints.
7 years ago
Nathaniel Case 0d67a49d5a nxos_bgp fixes (#23927)
* Pre-emptively fix sanity/pep8

* fix for commands

* Quick unit test
7 years ago
Nathaniel Case c0ebdf144d nxos_acl_interface fixes (#23917)
* Update nxos_acl_interface

* Add basic unit tests to nxos_acl_interface
7 years ago
Nathaniel Case f0914ee3c2 nxos_acl fixes (#23915)
* Update nxos_acl

* unit tests for nxos_acl

* Remove nxos_acl from pep8-legacy
7 years ago
Toshio Kuratomi bffccb5396 fetch idempotence test and deprecate validate_md5
Added an integration test for fetch module idempotence.  (Testing
that validate_checksum is doing what it's supposed to is harder as we'd
have to create a race condition with the downloaded data to trigger it.
Probably need to make that a unittest eventually).

Also give a deprecation message to the validate_md5 parameter so that we
can eventually get rid of it.
7 years ago
Abhijeet Kasurde d16fe5bef3 Minor typo and PEP8 fixes for dnf module (#23845)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 9fbbb5e10f Pep8 fixes for mysql module (#23923)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay a871e590a8 Update validate-modules to ignore *.rst files. 7 years ago
Matt Clay 0587d59266 Use Shippable image: drydock/u16pytall:master (#23997)
* Use Shippable image: drydock/u16pytall:master
* Do not install python 3.6 on Shippable.
7 years ago
Matt Clay d3c006c496 Fix module validator report if skipping all files. 7 years ago
Toshio Kuratomi 78dd3496e2 Update version and change remove files from pep8 blacklist 7 years ago
Brian Coca e29dc49a49 moved to exceptions for basic skip/fails
better handling of checkmode and async
fix test to follow new flow control
7 years ago
Ricardo Carrillo Cruz a3a970180a Unit tests for openvswitch_db module (#23974) 7 years ago
Sloane Hertel 00ebd0c89d make lineinfile docs clearer and make module pep8 (#23857) 7 years ago
Brian Coca 4594bee65a keep unsafe .. unsafe (#23742)
* keep unsafe .. unsafe

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

* deal with complex data for is_template

* typos
7 years ago
Ganesh Nalawade 1cdfcf0bb9 Add junos_command module unit test (#23819)
* Add junos_command module unit test
7 years ago
Ricardo Carrillo Cruz 60de93c31d Add assertion on test_iosxr_facts (#23852)
We hit bug #23737 due to bad coverage on test_iosxr_facts, we
were not checking memory facts at all.
7 years ago
Guillaume Coré c7f4c97b18 async+script: add integration test (#23818)
see #23729
7 years ago
Sloane Hertel 91644167c9 improve exception handling (#23722)
make pep8
7 years ago
Sloane Hertel 11c292bac2 route53_facts: add example for how to use next_marker option - fixes #23625 (#23802)
* Add example for using route53 next_marker option

* make route53_facts pep8 and remove from legacy files
7 years ago
Ricardo Carrillo Cruz 0bbfd3d4e0 Add missing aliases file to ios_system integration target (#23795) 7 years ago
Ricardo Carrillo Cruz 82fd038998 Add missing aliases file to iosxr integration tests targets (#23796) 7 years ago
Sloane Hertel d63af51f90 s3_sync: removing irrelevant s3.list_buckets() call - fixes #23409 (#23492)
* Removing irrelevant s3 call

Fix exception handling

Make s3_sync pep8 and remove from legacy file
7 years ago
Adrian Likins ae3d7fb29e Fix vault reading from stdin (avoid realpath() on non-links) (#23583)
* Fix vault reading from stdin (avoid realpath() on non-links)

os.path.realpath() is used to find the target of file paths that
are symlinks so vault operations happen directly on the target.

However, in addition to resolving symlinks, realpath() also returns
a full path. when reading from stdin, vault cli uses '-' as a special
file path so VaultEditor() will replace with stdin.
realpath() was expanding '-' with the CWD to something like
'/home/user/playbooks/-' causing errors like:

        ERROR! [Errno 2] No such file or directory: u'/home/user/ansible/-'

Fix is to specialcase '-' to not use realpath()

Fixes #23567

* to_text decrypt output when writing to stdout
7 years ago
Daniel Shepherd 698fa37a44 [cloud] Fix #23152 in route53 module and pep8 cleanup (#23156)
update module to support more standard state=present/absent syntax

update module to use required_if, required_together, mutually_exclusive functions where possible

per ryansb review: make documentation section more clear, fix some extra quotes, remove FIXME comment

pre willthames review: force private_zone to True if vpc_id is set and fix word wrap
7 years ago
Nathaniel Case 0b4cebfb8b nxos_vlan tweaks (#23194)
* Remove commented code

Remove a lot of unnecessary output

* Tests

* Sort vlan ids _after_ running set operations, so order is not lost
7 years ago
Kevin Brebanov 5775bb2a4e apk: Fix regex search patterns
Regex patterns were not being escaped properly so package names
containing characters that could be interpreted as regex symbols
were causing failures.

Fixes: #19714
7 years ago
Will Thames 9229d53143 [cloud] Add ec2_vpc_dhcp_options_facts check mode (#23106)
* Support check mode in ec2_vpc_dhcp_options_facts

As a facts module, ec2_vpc_dhcp_options_facts supports check mode
by default

* ec2_vpc_dhcp_options_facts tidy up

Use named method imports, move imports to top of code
Use shared code to handle filters and tags
Use snake case for parameter names while retaining backward compatibility
7 years ago
Nathaniel Case e518b6f5b4 Clean up import statements for nxos_rollback (#23540)
* Clean up import statements for nxos_rollback

* Don't try to deal with pre-2.3 logic
7 years ago
Matt Clay 4ad869b407 Expand test documentation. (#23598)
* Replace test README.md with new README.rst.
* Add compile and sanity README.rst docs.
7 years ago
Matt Clay cb1f57d4e5 Add rstcheck to ansible-test and correct issues. (#23550)
* Add rstcheck to ansible-test.
* Fix rst code-block languages and syntax errors.
* Fix rst inline literals.
* Update python 2 code block to pass tests on py 3.
7 years ago
Matt Clay 4ee96b20a3 Temporarily cap pylint version < 1.7.0 in tests. 7 years ago
Matt Clay e7bb508ad6 Fix var precedence check to support python 3. (#23552)
* Fix var precedence check to support python 3.
* Run CI sanity tests using python 3.5.
* Disable pylint non-iterator-returned test to pass on python 3.5.
7 years ago
Matt Clay 442768c45e Fix module validator blacklist handling.
Process the blacklist before creating a validator instance.
7 years ago
Brian Coca 8382ed7200 added test emulating #23180 use case 7 years ago
Toshio Kuratomi 4e8e366739 Ryanpineo fix ipaddr netmask with 32 cidr (#23506)
* Fix bug in ipaddr netmask filter when cidr is 32

* Add requirement on netaddr to the units.txt file
7 years ago
Sloane Hertel 5f517fdfa9 [cloud] route53_zone: allow split horizon for route53_zone and refactor - fixes #22939 (#23190)
* allow split horizon for route53_zone and refactor

* fix documentation

remove comment

fix version_added

* Remove unused imports

* Only include zone as matching if it has the same privacy setting

* Use `.endswith` instead of indexing into a string

* Update public zone behavior to only create new if there is no matching public zone

* Remove from legacy PEP8 files
7 years ago
Lumír 'Frenzy' Balhar 9d41aefd71 Add Python 3 support for validate-modules test. (#21195)
* Improve PEP8 compatibility

* Fix Python 3 incompatibility

Is prohibited to mutate OrderedDict during iteration through it so
is better to add records with error or warning to empty dictionary
instead of delete records from copy of dictionary during iterating.

* Decode output of subprocess from bytes to unicode.

* Add Python 3 support for validate-modules test.

Fix #18367
7 years ago
Matt Clay eec01e2137 Set IO encoding for ansible-test on Shippable. 7 years ago
Matt Clay 92ad9a19b6 Fix ansible-test empty diff handling on Shippable. 7 years ago
Dmitry Sobolev 1cf607d8a8 Telegram notification module updated (#22858)
* msg_format parameter added
error message received from telegram API is added to fail json
compatibility with python3 added
* pep8 formatted
* version_added property added for msg_format
* bot token must be set without 'bot' prefix in module parameters
* formatting options described in documentation
* six module for compatibility used
telegram.py removed from legacy-files.txt
7 years ago
Matt Clay 0cf1e8e061 Fix ansible-test handling of import/syntax errors. 7 years ago
Matt Martz 621e27b5dd Urls client cert auth (#18141)
* Build HTTPSClientAuthHandler more similarly to how HTTPSHandler works

* Add docs for new client cert authentication

* Support older versions of python

* Simplify logic

* Initial support for client certs in urls.py

* Add an extra test

* Add a get_url test for client cert auth

* Add additional test for client cert auth, with validation and ssl mismatch

* Skip assert when http tester not available

* Update version_added for new options
7 years ago
Toshio Kuratomi 78ced5318f Fix for recursive copy slowness
Copy module was walking over files in subdirectories repeatedly (a
directory tree a few levels deep could bring the time spent into the
tens of minutes)

This was traced to the fix for this bug report: https://github.com/ansible/ansible/issues/13013

Fixed #13013 a different way and added an integration test to check for
regressions of #13013 as we optimize this code.

Fixes #21513
7 years ago