Commit graph

2605 commits

Author SHA1 Message Date
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
2017-06-02 09:04:57 +05:30
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
2017-06-02 00:18:02 +02:00
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
2017-06-01 14:50:12 -07:00
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
2017-06-01 11:17:49 -04:00
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.
2017-06-01 16:23:32 +08:00
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>
2017-06-01 08:58:35 +05:30
Trishna Guha
fb87680046 fix state present nxos_evpn_vni (#25212)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-01 08:57:17 +05:30
Dag Wieers
c13b1a718a plugins/terminal/: PEP8 compliancy (#25207)
- Make PEP8 compliant
2017-05-31 18:28:03 +01:00
Chris Alfonso
b937bad52e Narrowing the match for python 3 cmp check (#25220)
Allowing the yaml examples in python documentation.
2017-05-31 17:54:20 +01:00
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
2017-05-31 11:48:35 -04:00
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
2017-05-30 16:10:33 -07:00
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.
2017-05-30 14:56:31 -07:00
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
2017-05-30 16:09:43 -04:00
Dag Wieers
758cfeb73e contrib: PEP8 compliancy (#24680)
- Make PEP8 compliant
2017-05-30 21:08:09 +01:00
Ricardo Carrillo Cruz
69efb61008 Add provider param to prepare_iosxr_tests role tasks (#25163)
This will avoid passing -u -k to ansible-playbook
2017-05-30 20:32:50 +02:00
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
2017-05-30 14:11:15 -04:00
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.
2017-05-30 10:55:49 -07:00
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.
2017-05-30 10:55:49 -07:00
Pierre-Louis Bonicoli
ce856c2123 postgresql_user: add tests with hashed password 2017-05-30 10:55:49 -07:00
Dag Wieers
09ba70f7c4 stat: PEP8, imports, cosmetics (#24653)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-05-30 18:31:56 +01:00
Dag Wieers
8d962209f4 mod_utils/cloudengine: PEP8 compliancy (#24659)
- Make PEP8 compliant
2017-05-30 18:28:02 +01:00
Dag Wieers
b3b11fbce2 get_url: PEP8, imports, cosmetics (#24676)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-05-30 18:24:07 +01:00
Dag Wieers
630185cb20 ansible/executor: PEP8 compliancy (#24695)
- Make PEP8 compliant
2017-05-30 18:13:53 +01:00
Dag Wieers
51b595992b ansible/utils/: PEP8 compliancy (#24686)
- Make PEP8 compliant
2017-05-30 18:09:44 +01:00
Dag Wieers
47738eb1dd docs: PEP8 compliance (#24681)
- Make PEP8 compliant
2017-05-30 18:08:25 +01:00
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
2017-05-30 18:05:19 +01:00
Trishna Guha
31c59ad5f9 nxos_portchannel fix and unit test (#25019)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-05-30 21:22:24 +05:30
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
2017-05-30 14:54:22 +01:00
Rene Moser
9cbae80c3b cloudstack: fix pep8 cs_pod 2017-05-29 01:28:19 +02:00
Rene Moser
3ef37e88fe cloudstack: fix pep8 cs_facts 2017-05-29 01:28:19 +02:00
Rene Moser
439f0beca5 cloudstack: fix pep8 cs_domain 2017-05-29 01:28:19 +02:00
Rene Moser
1778e23fad cloudstack: fix pep8 cs_account 2017-05-29 01:28:19 +02:00
Rene Moser
e3f75227bc cloudstack: fix pep8 cs_affinitygroup 2017-05-29 01:28:19 +02:00
Rene Moser
9fe3891d65 cloudstack: fix pep8 cs_cluster 2017-05-29 01:28:19 +02:00
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
2017-05-26 12:56:42 -04:00
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.
2017-05-26 12:19:47 +02:00
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
2017-05-25 14:18:20 -07:00
Robin Roth
8fca263560 Refactor zypper version parsing and handling (#24056)
Fixes #23516
2017-05-25 17:05:25 -04:00
Nathaniel Case
8985f7c930 nxos_static_route updates (#24992)
* Add static_route tests
* Add VRF tests
2017-05-25 12:19:04 -04:00
Trishna Guha
6a3ce18e4b add more testcases for nxos_evpn_vni (#24996) 2017-05-25 10:50:42 +05:30
Brendan Almonte
b820d024fc Add alternative syntax for upgrading all installed packages via apt (#25007)
syntax: 'apt: name=* state=latest'

feature #24189
2017-05-24 16:04:38 -07:00
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
2017-05-24 15:59:59 -07:00
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.
2017-05-24 12:57:30 -04:00
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
2017-05-24 19:40:38 +05:30
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
2017-05-24 05:53:40 -07:00
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
2017-05-23 15:51:46 -07:00
Dag Wieers
66355df917 module_utils/six: PEP8 compliancy
- Make PEP8 compliant
2017-05-23 15:43:52 -07:00
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
2017-05-23 17:16:49 -04:00
Brian Coca
6fa5dbdb5c fixed pep8 issues 2017-05-23 15:39:22 -04:00
bengerman13
25aac6151f add integration tests for xattr module (#24947)
* add integration tests for xattr module

* fix whitespace
2017-05-23 12:02:56 -07:00
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
2017-05-23 10:57:24 -07:00
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
2017-05-23 12:43:55 -04:00
Brian Coca
e0e94a4d02 reinstated to legacy
(cherry picked from commit a6484da0f11d03056b446526ef1cf78f968ae3ee)
(cherry picked from commit f23e766efa859b25557537d5098de557e85120cf)
2017-05-23 10:40:44 -04:00
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>
2017-05-23 14:54:54 +05:30
pdasilva
f8e47e2204 Changed assemble_from_fragments to use os.path.join (#24909)
Fixes #19437
2017-05-22 15:38:11 -07:00
pdasilva
3b45a9eb58 Test for _get_url_data in jenkins_plugin.py (#24905)
* Test for _get_url_data in jenkins_plugin.py

* PEP8 fix
2017-05-22 14:40:13 -07:00
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.
2017-05-22 20:11:34 +01:00
Ricardo Carrillo Cruz
b12beca3ed Refactos nxos_ip_interface module (#24885) 2017-05-22 19:48:59 +02:00
René Moser
d96195131f cloudstack: test: improve startup time, fix network dependency on run (#24876) 2017-05-22 10:58:16 +01:00
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
2017-05-20 01:45:53 +05:30
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
2017-05-19 10:40:42 -06:00
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
2017-05-19 10:37:01 -06:00
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.
2017-05-18 22:33:05 -07:00
Trishna Guha
998305a493 nxos_ospf_vrf fix and unittest (#24495) 2017-05-19 10:09:46 +05:30
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
2017-05-18 20:21:18 +01:00
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
2017-05-18 14:00:51 -04:00
Matt Clay
53180ebb57 Fix Shippable BASE_BRANCH lookup on merges. 2017-05-19 01:51:24 +08:00
Dag Wieers
c4a7f64c02 ansible/galaxy: PEP8 compliancy (#24696)
- Make PEP8 compliant
2017-05-18 18:43:35 +01:00
Dag Wieers
6f6bdf7914 ansible/parsing: PEP8 compliancy (#24701)
- Make PEP8 compliant
2017-05-18 18:41:00 +01:00
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.
2017-05-19 01:37:53 +08:00
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
2017-05-18 12:49:50 -04:00
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
2017-05-18 12:07:16 -04:00
Dag Wieers
ac1017b7ad ansible/constants: PEP8 compliancy (#24692)
- Make PEP8 compliant
2017-05-18 10:39:01 +01:00
Dag Wieers
37bfca23c9 slurp: PEP8, imports, cosmetics (#24677)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-05-18 08:40:24 +01:00
Dag Wieers
ea27baf7ff examples/: PEP8 compliancy (#24682)
- Make PEP8 compliant
2017-05-18 08:38:40 +01:00
Dag Wieers
de907a8e36 ansible/compat/: PEP8 compliancy (#24689)
- Make PEP8 compliant
2017-05-18 08:36:11 +01:00
Dag Wieers
ac27c54c2e ansible/errors: PEP8 compliancy (#24693)
- Make PEP8 compliant
2017-05-18 08:34:57 +01:00
Matt Clay
f5332de83d PEP 8 fixes. 2017-05-17 23:13:16 +08:00
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
2017-05-17 20:00:52 +05:30
Matt Clay
c4a2deda9d Restore disabled opensuse integration tests. 2017-05-17 17:13:27 +08:00
Abhijeet Kasurde
ad41d0e88f Pep8 fixes for parted (#24713)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-17 09:23:41 +01:00
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.
2017-05-17 14:56:40 +08:00
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>
2017-05-17 11:16:41 +05:30
Matt Clay
6e160650e9 Fix run filter on Shippable downloader. 2017-05-17 10:08:08 +08:00
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
2017-05-16 16:45:03 -04:00
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
2017-05-16 16:40:34 -04:00
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
2017-05-17 00:33:36 +05:30
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
2017-05-17 00:32:59 +05:30
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
2017-05-17 00:32:41 +05:30
Dag Wieers
9a5a61bdca hacking/: PEP8 compliancy (#24683)
- Make PEP8 compliant
2017-05-16 18:52:07 +01:00
Dag Wieers
4f29662a9e ansible/vars/: PEP8 compliancy (#24685)
- Make PEP8 compliant
2017-05-16 18:51:27 +01:00
Matt Clay
9178e176b5 Limit sphinx version on python 2.6. (#24678)
* Limit sphinx version on python 2.6.
* Fix issues identified by rstcheck.
2017-05-17 01:00:15 +08:00
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
2017-05-16 11:14:05 -04:00
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
2017-05-16 19:54:36 +05:30
Dag Wieers
c6533d4da9 utils/unicode: PEP8 compliancy (#24668)
- Make PEP8 compliant
2017-05-16 15:24:22 +01:00
Nathaniel Case
f240ba6b60 nxos_bgp_neighbor cleanup (#24446) 2017-05-16 10:14:10 -04:00
Dag Wieers
61d68275e8 module_utils/asa: PEP8 compliancy (#24655)
- Make PEP8 compliant
2017-05-16 12:16:05 +01:00
Matt Clay
4daa16f9ce Add --all and --stub coverage options.
ci_coverage
ci_complete
2017-05-16 12:02:03 +08:00
Rene Moser
e34fd20452 cloudstack: test: fix setup cs_vpc not using zone 2017-05-15 23:31:15 +08:00
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>
2017-05-15 09:32:17 -04:00