Commit graph

16669 commits

Author SHA1 Message Date
MechaXL
c1f0260ae3 Convert basestring to string_types (#25228) 2017-06-01 10:24:33 -07:00
evancarter-iex
3a2699f1bf gce_instance_template: Fix subnetwork not working (#25231)
* Fix problem with subnetwork not working

It is broken in the current master branch. This fixes it.

* Fix missing version_added
2017-06-01 10:19:19 -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
Will Thames
3ca006ecbb Allow removal of target groups from ASGs (#25126)
An empty `target_group_arns` list represents no target groups.
This is different to not passing a `target_group_arns` list at all
which can signify no change.

Remove unnecessary empty list construction, as it must already be
an empty list to get to that point.
2017-06-01 08:53:31 -04:00
Abhijeet Kasurde
07be5f2b67 spelling fixes (non-trivial, changing messages) (#25094)
Multiple spell fixes in single commit.
Taking over existing PR as per comment -
https://github.com/ansible/ansible/pull/23645#issuecomment-304312275

Original Author: klemens <ka7@github.com>

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-01 10:45:19 +01: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
Brian Coca
ea8c9a9b73 minor doc update 2017-05-31 19:39:30 -04:00
Brian Coca
16cc07a016 made doc more tolerant and recursive for spec 2017-05-31 19:38:20 -04:00
Chen Zhiwei
a44d57bf91 Allow customize fail message of wait_for module 2017-05-31 19:38:44 -04:00
Łukasz Jendrysik
bdd5adf21e Fix module name in example
'sv' module name in example refers to non-existent module.
2017-05-31 17:53:58 -04:00
Aurimas Lapiene
10167d83ee Add Cloudlinux support for hostname.py
**SUMMARY**

Add Cloudlinux 6 and Cloudlinux 7 support

**ISSUE TYPE**

Feature Pull Request

**COMPONENT NAME**

lib/ansible/modules/system/hostname.py

**ANSIBLE VERSION**
```
2.4
```
2017-05-31 17:01:22 -04:00
Esteban Echeverry
b7662f7e5b Import from urllib and not url (#25102)
* Import from urllib and not url

In Python 3, the correct way to import
urlparse is through urllib.parse.

* Use six module to import urlparse

Import urlparse from ansible.module_utils.six.
This way, the import statement is compatible both
with Python 3 and Python 2.

* Fix urlparse import using six module

The correct import is:
from six.moves.urllib.parse import urlparse

* Import six from ansible.compat

* Import from six.moves. Don't make six global.

Prevent code smell by not making six available
in the global namespace and instead importing from
one of its subpackages.
2017-05-31 15:27:22 -04:00
piotrsmolinski
c3ffc49914 reset_connection fixes: #23621 (#25211)
* moved the logging statement

moved the logging statement before the actual action

* added status code check

In the existing implementation when the ssh command fails the command
result is silently discarded. It hides the fact that the disconnection
did not go as expected. Effectively the intended action was not
successful, but the play continues.

* Revert "added status code check"

This reverts commit fe2eb2ae4a.

* added command status code check

In the existing implementation the command is checked for the success.
As a result failed execution is silently discarded. The change tests for
return code and fails if it did not work.
2017-05-31 13:40:57 -04:00
Dag Wieers
c13b1a718a plugins/terminal/: PEP8 compliancy (#25207)
- Make PEP8 compliant
2017-05-31 18:28:03 +01:00
Brian Coca
caf5868ec9 removed debugging prints 2017-05-31 13:08:50 -04:00
Brian Coca
798d05ea41 corrected object with columns 2017-05-31 13:03:10 -04:00
Brian Coca
5667603a27 fixed format 2017-05-31 12:52:44 -04:00
Brian Coca
05caa3654c fix to alwasy use param in case subpec is used 2017-05-31 12:39:47 -04:00
Philippe Dellaert
3ae69302a2 Fixes ansible/ansible#25096 (#25098) 2017-05-31 12:37:12 -04:00
Senthil Kumar Ganesan
e0db5d23cc Update facts module to support the new OS10 10.3 release (#25090)
* Update facts module to support the new OS10 10.3 release

* Address PEP8 issues reported by ansibot
2017-05-31 17:09:10 +01:00
Brian Coca
62a434141e ensure display is terminal sensistive
fixes #18248 by using display width intead of hardcoded length
2017-05-31 11:15:45 -04:00
Yap Sok Ann
24cfb10ce9 gce_net: change default to match with b7e78656 for idempotency (#23555)
After b7e78656, if `src_range`, `src_tags` or `target_tags` is left as
null, the firewall rule would always be recreated.
2017-05-31 11:02:22 -04:00
Yury V. Zaytsev
c559567f16 [cloud] s3_bucket: fix connections for buckets with dots in names (#24720)
Refer to 689f135 for similar fix in s3 module. This change makes `OrdinaryCallingFormat` default for handling S3 connections. 

Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
2017-05-31 10:36:17 -04:00
Will Thames
bc24ae88a8 Allow iam_role to work with friendly policy names (#22630)
Basically obtain all the policies and create a mapping
from friendly name to ARN

Tidy up module argument specification to remove unneeded
settings.
2017-05-31 10:15:13 -04:00
Rob
2f0ce790d1 [cloud] New module to support ALB/ELBv2 elb_target_group (#19492)
* New module = elb_target_group

* Update elb_target_group.py

Adds support for adding and removing targets from a target group

* Better error handling

* Bump version_added

* Minor fixes

* Scope ec2 imports, add better doco, fix up examples, allow for both upper and lower case in protocol

* Yaml fixes

* ci fix

* Added targets parameter to doc and added new modify_targets flag to prevent runs from modifying targets

* Update to metadata_version

* Update to metadata support

* Remove defaults for some params. Add tags parameter

* Use paginator to get target groups

* Add tag support

* Add tg attributes to module

* Quote multilines

* Remove unnecessary defaults. Fix multiline

* Fix line ending
2017-05-31 10:09:20 -04:00
Rob
76e56bf48e [cloud] New module = elb_application_lb (#19491)
* New module = elb_application_lb

* Update elb_application_lb.py

Adds support for rules, adds wait option for ALB creation, adds support for using target group names instead of ARNs when referencing target groups in rules. All additional features should be idempotent.

* Better exception error messages. Bump version_added. Pep8 fixes

* Add missing full stop to description

* Review changes and fixes

* Fix pep issues

* Fix up examples

* Fix pep8

* half way through sorting elb attributes

* Add access logs enabled param

* Finish implementing elb attributes

* Use paginator to get elbs

* Dont snake_case the tags

* Add listeners to return output and fixed up examples

* review changes

* fix line lengths

* pep8 fixes
2017-05-31 09:29:49 -04:00
Sloane Hertel
b04cf04f59 Prior to 2.4 only one source is permitted for ec2_group rules/rules_egress. 2.4 and after a list of sources is accepted. (#25165) 2017-05-31 08:51:33 -04:00
Will Thames
5c1a914002 Fix ec2_asg exception handling (#25121)
`e.message` is a string, and `camel_dict_to_snake_dict` fails when
given a string. The intended code is to run `camel_dict_to_snake_dict`
on `e.response`, the result of which includes a `message` key.

Make exception handling lines more consistent and wrap for slightly
shorter lines.
2017-05-31 08:50:32 -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
Benjamin Curtis
16c2207d21 Fix return code (#23592)
The Honeybadger API returns 201 for success, not 200.
2017-05-30 22:01:42 +02:00
Will Thames
23324bdda0 Ensure when warning is checked before expanding (#25092)
The `when` condition templating warning should only happen
if the condition itself contains templating, not if variables
in the condition are themselves composed through templating

Before

```
vars:
  x: hello
  y: "{{ x }}"

tasks:
- debug: msg=hello
  when: y
```

would fire a warning because `y` would get expanded to `{{ x }}`.
This checks whether a warning is required prior to expansion.
2017-05-30 15:48:45 -04: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
69edd9e0bb Avoid useless queries: use standard module hashlib
When an unchanged MD5-hashed password was used and passlib was
unavailable, an useless 'ALTER USER' query was executed.

Once this useless query avoided, the last 'SELECT' query becomes
useless too.
2017-05-30 10:55:49 -07:00
Pierre-Louis Bonicoli
f59f042bb0 postgresql_user: fix doc
See: https://www.postgresql.org/docs/current/static/sql-createrole.html
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
Ganesh Nalawade
d5ad3093d6 Add config_format note in junos_facts docs (#25125)
Fixes #24610

Add note to mention config_format value
dependency.
2017-05-30 22:39:09 +05:30
Ganesh Nalawade
44121352fe Update requirements in junos module docs (#25154)
Fixes #24975

Update requirements section in junos
module docs
2017-05-30 22:37:48 +05:30
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
John R Barker
24fb567c40 MAX_FILE_SIZE_FOR_DIFF (#25170) 2017-05-30 16:18:13 +01:00
Brian Coca
5d572055b3 fixed script plugin
fixes #25130
2017-05-30 11:10:43 -04:00
Brian Coca
bc403934ef properlly report plugin name 2017-05-30 11:10:43 -04:00
Sander Steffann
06f76a2741 Fix IndexError when junos_config contains multiple delete lines (#25139)
* Prevent IndexError when deleting multiple lines

The old code will raise `IndexError: list assignment index out of range` when deleting multiple lines because the indexes of the original and the copy get out of sync. Solved by deleting from the high indexes first so the lower ones remain stable.

* Don't load configuration if nothing to load

Instead of sending an empty candidate config (for example because the candidate only consisted of `delete` lines, and all of them were filtered out by `filter_delete_statements`) just return. JunOS seems to get confused by empty changes, and if the candidate config is empty then it's a no-op anyway.
2017-05-30 11:55:25 +05:30
Kei Nohguchi
6dd8a4cf78 openvswitch_bridge.py: Avoid runtime error with no external_ids (#25128)
This happens when there is external_ids configured on the existing
OvS bridge, though playbook doesn't.
2017-05-29 14:44:17 +02: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
Brian Coca
fd6302bcb8 only set ansible_host if i have data 2017-05-28 11:19:44 -04:00
Brian Coca
68936d0530 updated vbox docs 2017-05-28 11:14:03 -04:00
Brian Coca
21da284f5d added ability to create vars from vbox properties 2017-05-28 10:55:50 -04:00
Brian Coca
5cd0074831 fixed virtualbox plugins, expanded docs 2017-05-28 10:37:18 -04:00
Brian Coca
46a3e6088b fixed shared 'compose' method for inventory plugins 2017-05-28 10:37:06 -04:00
Brian Coca
e19109fb3d made inventory plugins list to keep config order 2017-05-28 10:36:36 -04:00
Abhijeet Kasurde
757758cd1a Remove redundant find_content_view method (#24851)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-26 20:06:02 +01: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
Esa Varemo
603366863f Correct nmcli dns example and documentation. Fix example indent (#20203)
Fixes https://github.com/ansible/ansible-modules-extras/issues/1910
and https://github.com/ansible/ansible-modules-extras/issues/1843
2017-05-26 15:58:00 +01:00
Eric Workman
797259f757 Add monitor and failover support to DNSMadeEasy module (#23434)
* Add monitor and failover support to DNSMadeEasy module

* Fix pep8 and add version_added to new parameters

* Change versions and improve descriptions
2017-05-26 15:22:46 +01:00
John R Barker
3740ad2828 Minor fixes (#25059)
1) Examples: Remove double space between "option:" and "value"
2) Documentation: Fix rendering usses
3) Documentation: Remove `required: true` to match argspec
2017-05-26 15:17:08 +01:00
Evan Kaufman
ce584571e8 Fixed backup file behavior in check mode (#24899)
Fixes ansible/ansible#21523
2017-05-26 16:16:15 +02:00
Michael Eaton
8bfa19c4af New module: Add module to manage Windows Firewall (windows/win_firewall) (#23224)
* added win_firewall module and updated to use list for profiles

* removed unnecessary cast and bug/typo in ForEach block
2017-05-26 09:26:48 -04:00
Damien
6dd1fc6f34 aos_login change default port and add version check (#24752)
* Change default port for aos_login and force type to Integer

* Add check to make sure aos-pyez is present and has the right version

* Update min version requirement in doc

* Change default port in documentation as well
2017-05-26 11:59:51 +01:00
tdtrask
8c50105a6c New module: awall: add new module for alpine wall (#24748)
* awall: add new module for alpine wall

* awall: Fix is_policy_enabled bug when policy has description
2017-05-26 11:54:02 +01:00
Steven Bambling
330ad92425 New module: Add Sensu Silence module (monitoring/sensu_silence.py) (#24332)
* adding module to control management of sensu silence entries

* adding doc stanza

* fixing some issues

* more cleanup

* fixing defaults

* fixing more doc issues

* fixing examples

* more fixes
2017-05-26 11:49:52 +01: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
Brian Coca
110fd917d6 adding caching to script plugin 2017-05-25 15:37:39 -04:00
Brian Coca
b8448fdb90 path cli options now resolve relative paths to cli 2017-05-25 14:29:27 -04:00
QijunPan
93ddfeb98a Contributing lib/ansible/modules/network/cloudengine/ce_bgp_af.py module to manage HUAWEI data center CloudEngine (#22031)
* add cd_bgp_af module

add cd_bgp_af module

* fix review issues
2017-05-25 17:35:12 +01:00
QijunPan
e86279cee4 Contributing new /lib/ansible/plugins/action/ce.py module to manage HUAWEI data center CloudEngine switch (#21645)
* commit plugins action ce module

commit plugins action ce module

* update plugins/action/ce.py

update plugins/action/ce.py

* update action ce.py

update action ce.py

* fix CI issues

* update ce.py

* add ce action
2017-05-25 17:33:57 +01:00
QijunPan
e9f2c080f4 Contributing lib/ansible/modules/network/cloudengine/ce_mlag_config.py module to manage HUAWEI data center CloudEngine (#22054)
* add ce_mlag_config

add ce_mlag_config

* update ce_mlag_config

update ce_mlag_config

* fix CI issues
2017-05-25 17:31:53 +01:00
QijunPan
f89d12f26e Contributing lib/ansible/modules/network/cloudengine/ce_link_status.py module to manage HUAWEI data center CloudEngine (#22053)
* add ce_link_status

add ce_link_status

* upgrade ce LinkStatus

* fix CI issues
2017-05-25 17:31:17 +01:00
QijunPan
1359d39f9a Contributing lib/ansible/modules/network/cloudengine/ce_ip_interface.py module to manage HUAWEI data center CloudEngine (#22052)
* add ce_ip_interface

add ce_ip_interface

* fix CI issues
2017-05-25 17:30:42 +01:00
QijunPan
16bea773b8 Contributing lib/ansible/modules/network/cloudengine/ce_interface_ospf.py module to manage HUAWEI data center CloudEngine (#22051)
* add ce_interface_ospf

add ce_interface_ospf

* upgrade Interface OSPF

* fix CI issues
2017-05-25 17:30:10 +01:00
QijunPan
7c78a86338 Contributing lib/ansible/modules/network/cloudengine/ce_interface.py module to manage HUAWEI data center CloudEngine (#22050)
* add ce_interface

add ce_interface

* fix review issue
2017-05-25 17:28:54 +01:00
QijunPan
9aa58dd4ca Contributing lib/ansible/modules/network/cloudengine/ce_info_center_log.py module to manage HUAWEI data center CloudEngine (#22048)
* add ce_info_center_log

add ce_info_center_log

* fix review issues
2017-05-25 17:28:05 +01:00
QijunPan
2e126edb91 Contributing lib/ansible/modules/network/cloudengine/ce_info_center_global.py module to manage HUAWEI data center CloudEngine (#22047)
* add ce_info_center_global

add ce_info_center_global

* fix review issue
2017-05-25 17:27:24 +01:00
QijunPan
2b9ac69692 Contributing lib/ansible/modules/network/cloudengine/ce_info_center_debug.py module to manage HUAWEI data center CloudEngine (#22046)
* add ce_info_center_debug

add ce_info_center_debug

* fix review issues
2017-05-25 17:26:52 +01:00
QijunPan
a137349522 Contributing lib/ansible/modules/network/cloudengine/ce_file_copy.py module to manage HUAWEI data center CloudEngine (#22045)
* add ce_file_copy

add ce_file_copy

* fix review issue
2017-05-25 17:26:11 +01:00
QijunPan
182d65d519 Contributing lib/ansible/modules/network/cloudengine/ce_evpn_bd_vni.py module to manage HUAWEI data center CloudEngine (#22038)
* add ce_evpn_bd_vni

add ce_evpn_bd_vni

* upgrade evpn bd vni

upgrade evpn bd vni

* fix review issue
2017-05-25 17:25:47 +01:00
Nathaniel Case
8985f7c930 nxos_static_route updates (#24992)
* Add static_route tests
* Add VRF tests
2017-05-25 12:19:04 -04:00
Abhijeet Kasurde
650b5fedb1 Handle None and Blank value for sysctl module (#24871)
Fix adds check for values provided by user for
name and value in sysctl module.
While providing name and value as in-line params,
check for blank values

Fixes #20176

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-25 11:49:20 -04:00
Brian Coca
7c325470e2 Pepe Ate 2017-05-25 11:38:53 -04:00
Brian Coca
f23920aa5e optimize file finding 2017-05-25 11:38:53 -04:00
QijunPan
deeffc61d7 Contributing lib/ansible/modules/network/cloudengine/ce_dldp_interface.py module to manage HUAWEI data center CloudEngine (#22036)
* add ce_dldp_interface

add ce_dldp_interface

* fix review issues
2017-05-25 16:08:43 +01:00
QijunPan
645eb03eeb Contributing lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py module to manage HUAWEI data center CloudEngine (#22033)
* add ce_bgp_neighbor_af

add ce_bgp_neighbor_af

* upgrade bgp neighbor af

upgrade bgp neighbor af

* fix review issues
2017-05-25 16:03:33 +01:00
QijunPan
d43fb67583 Contributing lib/ansible/modules/network/cloudengine/ce_bgp_neighbor.py module to manage HUAWEI data center CloudEngine (#22032)
* add ce_bgp_neighbor

add ce_bgp_neighbor

* fix review issues
2017-05-25 16:02:54 +01:00
Brian Coca
85c7a7b844 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
2017-05-25 10:37:52 -04:00
Abhijeet Kasurde
211d0656f8 Misc Typo correction (#25025)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-25 16:14:39 +02:00
Fabrizio Colonna
78fff751ab Fixed issue idempotence issue on label an name. (#23411) 2017-05-25 16:12:25 +02:00
QijunPan
7df246cebb Contributing lib/ansible/modules/network/cloudengine/ce_bgp.py module to manage HUAWEI data center CloudEngine (#22030)
* add ce_bgp module

add ce_bgp module

* upgrade ce bgp

upgrade ce bgp

* fix review issues
2017-05-25 14:51:26 +01:00
QijunPan
079590b589 Contributing lib/ansible/modules/network/cloudengine/ce_ospf_vrf.py module to manage HUAWEI data center CloudEngine (#21881)
* add ce_ospf_vrf module

add ce_ospf_vrf module

* update ce_ospf_vrf

update ce_ospf_vrf

* upgrade ospf vrf

* fix review issues

* fix CI issues
2017-05-25 14:49:29 +01:00
QijunPan
eaf23d2ec4 Contributing lib/ansible/modules/network/cloudengine/ce_mtu.py module to manage HUAWEI data center CloudEngine (#21879)
* add ce_mtu module

add ce_mtu module

* update ce_mtu

update ce_mtu

* fix review issues
2017-05-25 14:36:11 +01:00
QijunPan
a1578cc01a Contributing lib/ansible/modules/network/cloudengine/ce_acl_advance.py module to manage HUAWEI data center CloudEngine (#21877)
* add ce_acl_advance module

add ce_acl_advance module

* update ce_acl_advance.py

* fix review issues
2017-05-25 14:33:59 +01:00
QijunPan
c0ef52cf40 Contributing lib/ansible/modules/network/cloudengine/ce_netstream_template.py module to manage HUAWEI data center CloudEngine (#21818)
* add ce_netstream_template

add ce_netstream_template

* update

* fix review issues
2017-05-25 14:29:19 +01:00
QijunPan
76b9c84cac Contributing new lib/ansible/modules/network/cloudengine/ce_config.py module to manage HUAWEI data center CloudEngine switch (#21667)
* commit ce_config

commit ce_config

* update ce_config

update ce_config

* add module ce_config

add module ce_config

* update ce_config module

update ce_config module

* update ce_config

update ce_config

* fix CI issues

* fix review issues

* fix review issues
2017-05-25 14:01:50 +01:00
Trishna Guha
307fd1b3dc nxos_vlan fix (#24973) 2017-05-25 09:45:43 +05:30
Will Thames
30fec68931 Expose variable_manager to PlayIterator
`variable_manager` is passed to the constructor of `PlayIterator`,
and then used to access the fact cache when fact gathering.
Make `_variable_manager` an attribute of the `PlayIterator` class
2017-05-24 21:59:13 -04:00
Benjamin Schwarze
5668c97850 enable su support for docker connection 2017-05-24 16:53:08 -07:00
louis
7363776174 fixes #19550 (docker_container with empty links list always restarts) 2017-05-24 16:14:10 -07:00
Konrad Klimaszewski
5f3c887c38 Docker does not output Status after pull anymore.
- Docker 1.12 on CemtoOS7 does not output status line anymore.
- Do not rely on Docker output to verify if the image was the latest.
2017-05-24 16:07:17 -07:00
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
Konrad Klimaszewski
64f63a3cac Properly handle Docker image comparison for published_ports defined as IP::PORT
- Published port defined as IP::PORT where parsed in expected.parameters
  as 0.0.0.0::PORT leading to changed==True on every playbook run.
2017-05-24 15:55:30 -07:00
bengerman
5b39368108 use two-tuples rather than dicts to allow multiple aliases for the same target 2017-05-24 15:48:12 -07:00
Nikolay Murga
3610a2457f Fixed #21464 - docker_network: TypeError with existing network (#24266)
Fixed #22530 - docker_network Failed but Overlay network created successfully on Docker swarm mode
2017-05-24 14:21:24 -07:00
bengerman
cb3026f769 rebuild docker containers if there are less ports exposed 2017-05-24 12:37:29 -07:00
Guillaume Coré
a5c70dc672 os_user: fix module undefined
module variable in the function is undefined. Pass it.

fix "NameError: name 'module' is not defined"
2017-05-24 12:26:53 -07:00
Brian Coca
a86878c425 fixes for insserv on SLES11
fixes #23700, seems SLES11 has diff behaviour of insserv
these changes are compatible with debian/ubuntu.
2017-05-24 15:19:23 -04:00
bengerman
fab2dfd1c6 typo in security opts 2017-05-24 12:16:31 -07:00
Adrian Likins
ea3914f438 Show the ansible version if invoked with more than one -v (#22091)
* Show the ansible version if invoked with more than one -v

* use display.vv directly
2017-05-24 14:45:35 -04:00
Michael Sheinberg
272125023f Add working_dir to docker_container (#20044) (#24977)
* docker_container: add working_dir (fixes #20044)

Added a working directory option that will get passed with the other
docker container parameters. This is optional and addresses feature
request #20044.
2017-05-24 11:41:54 -07:00
Brian Coca
e558ec19cd Solaris fact fix (#24793)
* ensure locale for solaris fact gathering

fixes issue with locale interfering with proper reading of decimals
fixes #24542

* fixed typoe
2017-05-24 14:31:38 -04:00
Brian Coca
1e1caaad06 docs update, use connection: local vs local_action 2017-05-24 14:09:25 -04: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
Brian Coca
40b222867f ensure fullpaths on vars files (#24990)
fixes #24970
now correctly picks up group/host vars inside group/host named directories
2017-05-24 12:50:05 -04:00
tdtrask
0d761e4568 Add apk available and repository (#24146)
* apk: Allow update and upgrade in same task

* apk: Add repository option

* apk: Add available option

* apk: Add stdout and stderr output where possible

* apk: Add packages return with list of changed packages
2017-05-24 12:28:41 -04:00
Abhijeet Kasurde
625ee36e06 Make os_volume idempotent (#24881)
Fix adds idempotency while deleting volume in os_volume
module

Fixes #19619

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-24 18:16:23 +02:00
Damien
a611449cad eos_user Add documentation and example to change password (#24750)
* Add doc for password

* Add example to change user password

* Add dot at the end of the doc for password

* Add disclaimer in documentation for password

* Correct provider option name in description
2017-05-24 21:27:50 +05:30
Brian Coca
0cde9489fb removed unused import 2017-05-24 11:55:56 -04:00
Brian Coca
f2e4a90c93 clarified error messages 2017-05-24 11:55:56 -04:00
John R Barker
c158705c48 Fix pep8 issue
lib/ansible/plugins/vars/host_group_vars.py:74:41: E261 at least two spaces before inline comment
Caused by daef6f0911
2017-05-24 16:53:02 +01:00
Jiri Tyr
09e80a1306 Removing unecessary exception in jenkins_plugin (#24968) 2017-05-24 07:15:05 -07: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
Brian Coca
daef6f0911 allow empty files in host/group_vars
also remove unused import
fixes #24963
2017-05-24 09:32:34 -04:00
Alexander Teves
d2032116cd Added timeout to jenkins_script POST request (#24924)
* Added timeout to jenkins_script POST request

The timeout value is passed to fetch_url to allow a custom timeout
bigger than the predefined 10 seconds.

* Added version, removed no_log
2017-05-24 11:16:05 +01:00
Ricardo Carrillo Cruz
cd13b70903 Add name_servers alias to name_server vyos_system parameter (#24972)
Other modules use name_servers, we need to have a consistent interface
for the platform agnostic modules work.
2017-05-24 12:15:51 +02:00
Abhijeet Kasurde
2039abbbfa Fix typos in eos module_utils (#24966)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-24 15:22:09 +05:30
Brian Coca
6dc2a6ce8b fixed docs for host list examples 2017-05-23 22:53:12 -04:00
Joseph Callen
8ca836ad14 Fix script inventory plugin 2017-05-23 22:25:10 -04:00
Nathaniel Case
9737c6b90d Python3 chokes on casting int to bytes (#24952)
But if we tell the formatter that the var is a number, it works
2017-05-23 15:58:37 -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
Abhijeet Kasurde
91a72ce7da Remove redundant return statement from a10_ser* (#24930)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-23 16:45:24 -04:00
Brian Coca
77be724913 fixed extension matching
and name is valid for all
2017-05-23 15:50:35 -04:00
Brian Coca
6fa5dbdb5c fixed pep8 issues 2017-05-23 15:39:22 -04:00
Brendan Almonte
8d8cfb5fcd Read directory_mode as 'raw' type
Reads the directory_mode param as 'raw' type to mirror the same behavior as mode.
This'll cause non-quoted values to be represented as an int, rather than a str.

Covered by 'assert recursive copied directories mode' test.

Fixes #24202
2017-05-23 11:33:19 -07:00
cheko
0dc5e8bf71 Bugfix: Directories in /etc/skel will get users ownership when home dir is created (#24943)
* Bugfix: Directories in /etc/skel will get users ownership when home dir is created
* Bugfix: Chmod works now recursive for the home dir
2017-05-23 11:31:28 -07:00
kgottholm
5240e5a230 Vertica schema fix (#24915)
* replace deprecated cmp() with custom conditional
cmp is not present in Python3 but several modules use it
Reference 24756
2017-05-23 10:49:54 -07:00
Dag Wieers
9cd6f1bf91 win_copy: Fix recursive copy (#23581)
This fixes #23559.

This should be backported to v2.3 branch too.
2017-05-23 10:46:13 -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
kgottholm
1e4b227e6f Os port fix (#24913)
* replace deprecated cmp() with custom conditional
cmp is not present in Python3 but several modules use it
Reference 24756
2017-05-23 09:40:56 -07: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
Kevin Clark
04073dfa9b adds privilege escalation method for pmrun(Unix Privilege Manager 6.0) 2017-05-23 10:39:48 -04:00
Abhijeet Kasurde
f9b836a901 Include error exception in AnsibleError
- Use to_native instead of str

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-23 10:19:14 -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
Matt Martz
4ac135c1b5 Fix logic surrounding copy and remote_src, remote_src is preferred, make copy action plugin only. Fixes #23591 (#24732) 2017-05-22 17:19:56 -07:00
Andrew Shewmaker
f5fd32eae6 docker_container: do not split command on commas (#24900)
* docker_container: do not split command on commas

Fix issue #24430

* docker_container: document command parameter

Prior behavior was strange, splitting strings on commas
only to join them again ... replacing commas with spaces.

FYI, docker-py accepts strings or lists, using shlex.split
on strings ... splitting on spaces while respecting things
like quotes.

https://github.com/docker/docker-py/blob/master/docker/api/container.py
https://github.com/docker/docker-py/blob/master/docker/types/containers.py
https://github.com/docker/docker-py/blob/master/docker/utils/utils.py

More info regarding Dockerfile syntax for CMD strings and lists
can be found at https://docs.docker.com/engine/reference/builder/#cmd
2017-05-22 15:39:57 -07:00
pdasilva
f8e47e2204 Changed assemble_from_fragments to use os.path.join (#24909)
Fixes #19437
2017-05-22 15:38:11 -07:00
Anton Kasimov
2e392f47c8 Bugfix for setting user groups on OpenBSD 2017-05-22 18:16:28 -04:00
Brian Coca
e506b5da14 only set executable from shell if not set already 2017-05-22 18:06:55 -04:00
Brian Coca
55135c0825 enable run_command to use non /bin/sh shells
fixes #24169
2017-05-22 18:06:55 -04:00
kgottholm
16d522cf2c Letsencrypt fix (#24906)
* Replaced deprecated cmp with custom condition

References  #24756

* Fix PEP 08 indention
2017-05-22 14:41:47 -07:00
Rob
43fc97cad3 [cloud] Fix iam_role to compare trust policies accurately (#22936)
* Fix iam_role to compare trust policies accurately

* Better exception handling and better handling of detaching all managed policies
2017-05-22 15:13:35 -04: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
pdasilva
45e4b8f97a Converted the response from _get_url_data using to_native (#24901)
Updated the exception message to no longer use e.message.
Fixes #24526
2017-05-22 12:09:51 -07:00
Ricardo Carrillo Cruz
b12beca3ed Refactos nxos_ip_interface module (#24885) 2017-05-22 19:48:59 +02:00
Abhijeet Kasurde
7fba31677e Remove redeclared module variable
Fix removes redeclared module variable defined
previously without any usage.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-22 12:22:54 -04:00
Trishna Guha
9fb9c00092 Remove deprecation for username/password eos_user, nxos_user and Doc update (#24880)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-05-22 20:02:36 +05:30
glassresistor
4a718645e8 fixed minor py3 compliance issue in ec2_vpn_nacl (#24758)
wrapped a dict.items() with list
2017-05-19 13:58:48 -07: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
Michael
b65ebf3519 Fixed import of urlencode and pathname2url from urllib for python3 (#24424) 2017-05-19 12:22:16 -05:00
Phil Huang
98a8b967d2 Fixed wrong variable in cumulus network module (#23950)
Signed-off-by: Phil Huang <phil_huang@edge-core.com>
2017-05-19 12:49:07 -04:00
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
QijunPan
68f38c5e9d Contributing lib/ansible/modules/network/cloudengine/ce_info_center_trap.py module to manage HUAWEI data center CloudEngine (#22049)
* add ce_info_center_trap

add ce_info_center_trap

* upgrade Info Center Trap

* fix CI issues
2017-05-19 17:01:52 +01:00
QijunPan
8086f12ddb Contributing lib/ansible/modules/network/cloudengine/ce_facts.py module to manage HUAWEI data center CloudEngine (#22044)
* add ce_facts

add ce_facts

* fix CI issues
2017-05-19 16:59:36 +01:00
QijunPan
35bc99156a Contributing lib/ansible/modules/network/cloudengine/ce_evpn_bgp_rr.py module to manage HUAWEI data center CloudEngine (#22043)
* add ce_evpn_bgp_rr

add ce_evpn_bgp_rr

* fix CI issues
2017-05-19 16:58:55 +01:00
QijunPan
4961778732 Contributing lib/ansible/modules/network/cloudengine/ce_eth_trunk.py module to manage HUAWEI data center CloudEngine (#22037)
* add ce_eth_trunk

add ce_eth_trunk

* fix CI issues
2017-05-19 16:58:21 +01:00
QijunPan
a54c3398e1 Contributing lib/ansible/modules/network/cloudengine/ce_dldp.py module to manage HUAWEI data center CloudEngine (#22035)
* add ce_dldp module

add ce_dldp module

* fix CI issues
2017-05-19 16:57:25 +01:00
QijunPan
9f297ff0c6 Contributing lib/ansible/modules/network/cloudengine/ce_acl_interface.py module to manage HUAWEI data center CloudEngine (#21878)
* add ce_acl_interface module

add ce_acl_interface module

* update ce_acl_interface.py

* fix CI issues
2017-05-19 16:55:41 +01:00
QijunPan
b5805d5aa3 Contributing lib/ansible/modules/network/cloudengine/ce_aaa_server.py module to manage HUAWEI data center CloudEngine (#21757)
* commit ce_aaa_server module

commit ce_aaa_server module

* update ce_aaa_server.py

update ce_aaa_server.py

* update ce_aaa_server module

* upgrade ce aaa server

upgrade ce aaa server

* fix CI issues
2017-05-19 16:53:59 +01:00
QijunPan
365f816e46 Contributing lib/ansible/modules/network/cloudengine/ce_evpn_bgp.py module to manage HUAWEI data center CloudEngine (#21759)
* commit ce_evpn_bgp.py

commit ce_evpn_bgp.py

* update ce_evpn_bgp

update ce_evpn_bgp

* fix CI issues
2017-05-19 16:51:51 +01:00
QijunPan
ea0060ba64 Contributing lib/ansible/modules/network/cloudengine/ce_netstream_global.py module to manage HUAWEI data center CloudEngine (#21817)
* add ce_netstream_global module

add ce_netstream_global module

* update ce_netstream_global

update ce_netstream_global

* fix CI issues

* fix pep8 error
2017-05-19 16:50:53 +01:00
QijunPan
4ef5177e62 Contributing lib/ansible/modules/network/cloudengine/ce_netstream_export.py module to manage HUAWEI data center CloudEngine (#21816)
* add ce_netstrem_export module

add ce_netstrem_export module

* update ce_netstream_export

update ce_netstream_export

* fix CI issues
2017-05-19 16:50:01 +01:00
QijunPan
c291e5d895 Contributing lib/ansible/modules/network/cloudengine/ce_acl.py module to manage HUAWEI data center CloudEngine (#21815)
* add ce_acl module

add ce_acl module

* update ce_acl.py

update ce_acl.py

* fix CI issues
2017-05-19 16:49:31 +01:00
QijunPan
e2cd0ee18b Contributing lib/ansible/modules/network/cloudengine/ce_netstream_aging.py module to manage HUAWEI data center CloudEngine (#21761)
* commit ce_netstream_aging

commit ce_netstream_aging

* update ce_netstream_aging

update ce_netstream_aging

* update ce_netstream_aging

update ce_netstream_aging

* fix CI issues
2017-05-19 16:48:43 +01:00
QijunPan
594dcbcaa2 Contributing lib/ansible/modules/network/cloudengine/ce_evpn_global.py module to manage HUAWEI data center CloudEngine (#21760)
* commit ce_evpn_global

commit ce_evpn_global

* update ce_evpn_global

update ce_evpn_global

* fix CI issues
2017-05-19 16:47:36 +01:00
QijunPan
04d5a80f96 Contributing lib/ansible/modules/network/cloudengine/ce_aaa_server_host.py module to manage HUAWEI data center CloudEngine (#21758)
* commit ce_aaa_server_host.py

commit ce_aaa_server_host.py

* update ce_aaa_server_host.py

* fix CI issues
2017-05-19 16:27:47 +01:00
QijunPan
0fe0538a43 Contributing lib/ansible/modules/network/cloudengine/ce_command.py module to manage HUAWEI data center CloudEngine (#21669)
* update ce_command.py

update ce_command.py

* update ce_command

update ce_command

* update ce_command.py

update ce_command.py

* update ce_command module

update ce_command module

* update ce_command module

update ce_command module
2017-05-19 16:22:20 +01:00
Sergey Bondarev
f39fa7fd22 fix from https://github.com/ansible/ansible/pull/23001 2017-05-19 09:41:09 -04:00
Sergey Bondarev
72fc9f5cbe fix deprecation import ansible.vars.unsafe_proxy to ansible.utils.unsafe_proxy 2017-05-19 09:41:09 -04:00
Niall Donegan
29fb573fd6 Tiny Typo Fix (#24828) 2017-05-19 14:31:02 +01:00
Abhijeet Kasurde
d4857ed6c4 Add Password for login method in github_release (#23661)
Fix allows user to specify username and password for
using github_release to perform various operations

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-19 08:49:05 +01:00
QijunPan
6352a54f19 Contributing new lib/ansible/plugins/terminal/ce.py module to manage HUAWEI data center CloudEngine switch (#21653)
* commit plugins terminal ce.py module

commit plugins terminal ce.py module

* update plugins/terminal/ce.py

update plugins/terminal/ce.py

* deal with pep8 error
2017-05-19 08:43:37 +01:00
QijunPan
ad85f2b483 Contributing new /lib/ansible/plugins/action/ce_template.py module to manage HUAWEI data center CloudEngine switch (#21649)
* commit plugins action ce_template.py

commit plugins action ce_template.py

* deal with pep8 error
2017-05-19 08:42:55 +01:00
QijunPan
627ac2493d commit plugins action ce_config module. (#21648)
commit plugins action ce_config module.
2017-05-19 08:42:36 +01:00
Gaurav Rastogi
32b4eab3dc Avi module to setup GSLB Geo DB profile. (#24812) 2017-05-19 08:34:12 +01:00
Gaurav Rastogi
ea6955109b New module to setup HTTP Policy set objects (#24813) 2017-05-19 08:33:37 +01:00
Gaurav Rastogi
1960aa8d96 New module to setup GSLB Application persistence profile (#24814) 2017-05-19 08:31:49 +01:00
Gaurav Rastogi
e90d63edd1 New Avi Module for setup of network security policy (#24815) 2017-05-19 08:31:00 +01:00
Gaurav Rastogi
d6e2943c97 New Avi Module to setup virtualservice datascripts (#24818) 2017-05-19 08:30:19 +01:00
Gaurav Rastogi
b26bc5be88 New Avi Module to setup DNS policies. (#24819) 2017-05-19 08:29:34 +01:00
Gaurav Rastogi
788e2efe2a New Avi Module to setup various controller properties. (#24811) 2017-05-19 08:29:00 +01:00
Gaurav Rastogi
fd94b5b20d New Avi Module to setup SE properties. (#24816) 2017-05-19 08:28:26 +01:00
Gaurav Rastogi
b44f3cbcf6 New Avi Module to setup user account profile settings. (#24817)
* New Avi Module to setup user account profile settings.

* removed blank line failing pep8
2017-05-19 08:27:48 +01:00
Gaurav Rastogi
61882cfdfa New Avi Module to create VIP objects that can be used in shared VIP and multiple VIP use cases for application deployment. (#24809) 2017-05-19 08:26:22 +01:00
QijunPan
d53136cf1b Contributing lib/ansible/modules/network/cloudengine/ce_ntp_auth.py module to manage HUAWEI data center CloudEngine (#22058)
* add ce_ntp_auth

add ce_ntp_auth

* fix review issues
2017-05-19 08:24:40 +01:00
QijunPan
21b778ddb0 Contributing lib/ansible/modules/network/cloudengine/ce_ospf.py module to manage HUAWEI data center CloudEngine (#22059)
* add ce_ospf

add ce_ospf

* upgrade OSPF

* fix review issues.
2017-05-19 08:24:22 +01:00
QijunPan
f8193622d6 Contributing lib/ansible/modules/network/cloudengine/ce_reboot.py module to manage HUAWEI data center CloudEngine (#22060)
* add ce_reboot

add ce_reboot

* fix review issues.

* update requirements.
2017-05-19 08:23:48 +01:00
QijunPan
7353b357e9 Contributing lib/ansible/modules/network/cloudengine/ce_rollback.py module to manage HUAWEI data center CloudEngine (#22061)
* add ce_rollback

add ce_rollback

* fix review issues
2017-05-19 08:23:30 +01:00
QijunPan
954906c143 Contributing lib/ansible/modules/network/cloudengine/ce_snmp_location.py module to manage HUAWEI data center CloudEngine (#22065)
* add ce_snmp_location.py

* fix review issues
2017-05-19 08:23:13 +01:00
QijunPan
9b20d6ac34 Contributing lib/ansible/modules/network/cloudengine/ce_sflow.py module to manage HUAWEI data center CloudEngine (#22062)
* add ce_sflow

add ce_sflow

* fix review issue
2017-05-19 08:22:51 +01:00
QijunPan
3927341872 Contributing lib/ansible/modules/network/cloudengine/ce_snmp_target_host.py module to manage HUAWEI data center CloudEngine (#22066)
* add ce_snmp_target_host

* fix review issues.
2017-05-19 08:22:34 +01:00
QijunPan
dda49ca7c9 Contributing lib/ansible/modules/network/cloudengine/ce_snmp_traps.py module to manage HUAWEI data center CloudEngine (#22067)
* add ce-snmp_traps

* fix review issues

* fix pep8 error
2017-05-19 08:22:19 +01:00
QijunPan
0172522406 Contributing lib/ansible/modules/network/cloudengine/ce_snmp_user.py module to manage HUAWEI data center CloudEngine (#22069)
* add ce_snmp_user.py

* upgrade snmp user

* fix review issues

* fix review issue

* fix CI issue

* fix CI issue
2017-05-19 08:21:55 +01:00
QijunPan
45fda73653 Contributing lib/ansible/modules/network/cloudengine/ce_vxlan_global.py module to manage HUAWEI data center CloudEngine (#22082)
* add ce_vxlan_global.py

* upgrade Vxlan Global

* metadata_version update
2017-05-19 08:21:42 +01:00
QijunPan
1c0d74339a Contributing lib/ansible/modules/network/cloudengine/ce_vxlan_tunnel.py module to manage HUAWEI data center CloudEngine (#22083)
* add ce_vxlan_tunnel.py

* update

* upgrade Vxlan Tunnel

* metadata_version update

* deal with review issue.

* deal with review issue
2017-05-19 08:21:27 +01:00
Michael Scherer
f88c2b8ac5 Fix wrongly named variable, introduced by error on ac1017b7ad (#24795)
This broke ansible-playbook -D for template module
2017-05-18 22:29:05 -07:00
Trishna Guha
21e28a431b Remove unused method from nxos_ospf (#24820) 2017-05-19 10:57:16 +05:30
Trishna Guha
998305a493 nxos_ospf_vrf fix and unittest (#24495) 2017-05-19 10:09:46 +05:30
Matt Martz
1eed6c5b3d Convert some more base64 strings to text for winrm, to support async and become (#24796) 2017-05-18 16:06:51 -07:00
Lee Shakespeare
def76a3c3b Lookup credential id and pass in credential rather than scm_credential (#24624)
* Lookup credential id and pass in credential rather than scm_credential

* Change the excepting handling to catch missing credentials

* Make error messages for not found lookups more useful
2017-05-18 15:44:33 -07:00
QijunPan
1487ec0ea2 Contributing lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py module to manage HUAWEI data center CloudEngine (#22081)
* add ce_vxlan_gateway.py

* metadata_version update

* deal review issues
2017-05-18 23:12:04 +01:00
QijunPan
b20c550426 Contributing lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py module to manage HUAWEI data center CloudEngine (#22080)
* add ce_vxlan_arp.py

* metadata_version update

* deal review issues
2017-05-18 23:11:42 +01:00
QijunPan
a8475f6ef5 Contributing lib/ansible/modules/network/cloudengine/ce_vrf_interface.py module to manage HUAWEI data center CloudEngine (#22079)
* add ce_vrf_interface.py

* metadata_version update

* fix code review issues

* fix ci_verified

* tab to space
2017-05-18 23:11:09 +01:00
QijunPan
cb75f2a43d Contributing lib/ansible/modules/network/cloudengine/ce_vlan.py module to manage HUAWEI data center CloudEngine (#22076)
* add ce_vlan.py

* metadata_version update

* fix review issues

* Update ce_vlan.py

* fix check issue

required_if not work well when the option value is "not None"
2017-05-18 23:10:11 +01:00
QijunPan
fb54e47491 Contributing lib/ansible/modules/network/cloudengine/ce_switchport.py module to manage HUAWEI data center CloudEngine (#22075)
* add ce_switchport.py

* metadata_version update

* fix review issues

* fix review issue

* fix CI issue
2017-05-18 23:09:49 +01:00
QijunPan
a1cbecd23c Contributing lib/ansible/modules/network/cloudengine/ce_stp.py module to manage HUAWEI data center CloudEngine (#22073)
* add ce-stp

* fix review issues

* fix CI issues
2017-05-18 23:09:26 +01:00
QijunPan
55d0f97ace Contributing lib/ansible/modules/network/cloudengine/ce_snmp_contact.py module to manage HUAWEI data center CloudEngine (#22064)
* add ce_snmp_connect

add ce_snmp_connect

* fix review issues
2017-05-18 23:08:05 +01:00
QijunPan
f5fc565721 Contributing lib/ansible/modules/network/cloudengine/ce_startup.py module to manage HUAWEI data center CloudEngine (#22070)
* add ce_startup

add ce_startup

* fix review issues
2017-05-18 23:07:16 +01:00
Lars Larsson
53baa36a8b [cloud][GCE] fix bug in persistent disk snapshot naming (#23218)
snapshot_name keeps on prepending the device_name to the same string if more than one device.
result is: disk3-disk2-disk1-MySnapshot
2017-05-18 16:08:14 -04:00
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
Matt Davis
569377e951 add segfault detection to TQM
* prevents indefinite hangs when a worker segfaults
2017-05-18 14:59:07 -04:00
QijunPan
ba3a0e8e34 Contributing lib/ansible/modules/network/cloudengine/ce_snmp_community.py module to manage HUAWEI data center CloudEngine (#22063)
* add ce_snmp_community

add ce_snmp_community

* upgrade snmp community

* fix review issues
2017-05-18 19:46:45 +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
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
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
John R Barker
ed2f13b3db Fix more module returns (#24782)
* Correct return structure

* typo
2017-05-18 17:38:10 +01: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
Dylan Silva
bba4549b43 Downgraded more modules from Curated to Community (#24751) 2017-05-18 08:28:41 -07:00
Will Thames
5741712a09 ec2_group_facts tag list should have case preserved (#24760)
Tags should retain case, and should not be snake cased.
Easiest way to do this is to snake before converting tag
list as while that affects the keys of the boto3 tag lists,
it doesn't affect the values. Need to use `tag_value_key_name`
and `tag_name_key_name` following recent change to
`boto3_tag_list_to_ansible_dict`, which used to handle both
`key`/`Key` and `value`/`Value`
2017-05-18 09:34:53 -04:00
Trishna Guha
feafae70b5 Fix transport getting set to None when not set explicitly (#24769)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-05-18 15:11:09 +05:30
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
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
Dag Wieers
7a5e46c732 aix_lvol: PEP8, imports, cosmetics (#24717)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-05-18 08:31:07 +01:00
James Cammarata
5728bd9065 Merge branch 'modules_issue_1568' of https://github.com/ajdecon/ansible into ajdecon-modules_issue_1568 2017-05-18 02:28:08 -05:00
Dag Wieers
6b7d669a2b win_psexec: Change default for -nobanner (#24739)
* win_psexec: Change default for -nobanner

* Update documentation too
2017-05-18 08:25:38 +01:00
Abhijeet Kasurde
2f955e7da8 Save commit_timeout as string in junos_config (#24761)
Fix converts commit_timeout to string as
Elementree.SubElement requires text as string.

Fixes #24611

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-18 12:38:26 +05:30
Matt Martz
e7d8ebf080 Base changes required to allow winrm to work on py3 (#24744) 2017-05-17 14:26:32 -07:00
James Cammarata
f217dae938 Also check the iterator for failed host status in linear strategy
When only looking at the failed state of the TaskResult, certain failures
cause the linear strategy to fail out sooner than it should and not execute
the always portion of blocks.

Fixes #24301
2017-05-17 13:41:29 -05:00
Lee Shakespeare
e2c08edfcc Tower user remove organization (#24544)
* Remove organization field from the tower_user module re: issue #24510

* Fix trailing spaces.

* Fixes for Shippable errors, pep8

* Remove a random inserted space.
2017-05-17 14:30:14 -04:00
QijunPan
40c2b8cac9 Contributing new lib/ansible/module_utils/ce.py module to manage HUAWEI data center CloudEngine switch (#21666)
* add module_utils ce.py

add module_utils ce.py

* update module_utils/ce.py to support netconf

update module_utils/ce.py to support netconf

* update module_utils ce.py

update module_utils ce.py
2017-05-17 18:36:34 +01:00
Monty Taylor
6e85ac2ba6 Deal with server.security_groups being None (#24742)
It shouldn't happen - but there is a bug in shade where it can be None
but should be [] instead. Work around it.

Fixes #24675
2017-05-17 12:17:31 -05:00
Jonathan Mainguy
3ad09604f2 add catapult as a sms /mms api notification provider. (#23052) 2017-05-17 16:23:38 +01: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
Jose Armesto
3eb8142a41 [cloud] Fixes #24578: ROLLBACK_COMPLETE is a failure state for CloudFormation module (#24596)
* ROLLBACK_COMPLETE is a failure state

Fixes #24578

* Adding AWS documentation on Stack status

* Fixed comment
2017-05-17 09:17:47 -04:00
Andrea Tosatto
b230b03045 [cloud] Rebase and fix ENI lookup logic to only hit unique ENIs (rebase of #20039) (#23404)
* fix eni lookup logic to update them only when univocally specified (Fixes #19972)

remove redundant eni lookup

* Rename the univocally_find_eni method to uniquely_find_eni

* Idempotency logic minor fixes

* Fixing pep8 reported issues

* Adding a required_together constraint for instance_id and device_index

* Fix ec2_eni private_ip_address matching

* Adding an example of matching via subnet_id and private_ip_address

* Removing the required_together and subnet_id constraints

* Addding some notes to explain the module assumptions

* Implementing Ryan's wording proposal
2017-05-17 08:54:37 -04: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
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
QijunPan
05d8b64cc9 Contributing lib/ansible/modules/network/cloudengine/ce_vrf_af.py module to manage HUAWEI data center CloudEngine (#22078)
* add ce_vrf_af.py

* upgrade ce vrf af

* metadata_version update

* fix review issues

* fix CI issues
2017-05-16 22:52:41 +01:00
QijunPan
a8570db624 Contributing lib/ansible/modules/network/cloudengine/ce_ntp.py module to manage HUAWEI data center CloudEngine (#22057)
* add ce_ntp

add ce_ntp

* fix review issues

* deal pep8 issues
2017-05-16 22:51:09 +01:00
QijunPan
7722b95dd4 Contributing lib/ansible/modules/network/cloudengine/ce_static_route.py module to manage HUAWEI data center CloudEngine (#22072)
* add ce_static_route

add ce_static_route

* upgrade Static Route

* fix review issues

* fix CI issues

* fix CI issue

* fix CI issue
2017-05-16 22:49:37 +01:00
QijunPan
d7e6a6bff3 Contributing lib/ansible/modules/network/cloudengine/ce_vrf.py module to manage HUAWEI data center CloudEngine (#22077)
* add ce_vrf.py

* update ce_vrf.py

update ce_vrf.py

* upgrade vrf

* metadata_version update

* fix review issues

* fix RETURN doc
2017-05-16 22:48:10 +01:00
QijunPan
7bb64bb9a4 Contributing lib/ansible/modules/network/cloudengine/ce_vxlan_vap.py module to manage HUAWEI data center CloudEngine (#22084)
* add ce_vxlan_vap.py

* metadata version upate

* fix fail_json msg
2017-05-16 22:46:45 +01:00
QijunPan
45f05ca8aa Contributing lib/ansible/modules/network/cloudengine/ce_mlag_interface.py module to manage HUAWEI data center CloudEngine (#22055)
* add ce_mlag_interface

add ce_mlag_interface

* upgrade ce mlag interface

* fix CI issues
2017-05-16 22:44:49 +01:00
QijunPan
fbeec055a4 Contributing lib/ansible/modules/network/cloudengine/ce_netconf.py module to manage HUAWEI data center CloudEngine (#22056)
* add ce_netconf

add ce_netconf

* update

* upgrade netconf

* fix review issues

* fix review issue.
2017-05-16 22:43:33 +01:00
Ricardo Carrillo Cruz
14b1405ee4 Fix conn_type assignment (#24697)
This should be a single equal, not a double-one
2017-05-16 23:14:17 +02:00
Brandon Davidson
0210a1a7dc [cloud] Add vpc_id option for ec2_lc security group lookups by name (#24459) 2017-05-16 16:46:28 -04: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
Tom Melendez
29decad261 [GCP] Target Proxy Module (#24527)
* [GCP] Target Proxy Module

* pep8 fix

* updates from review: removed 26 check, fix get method, typos, renamed url_map to url_map_name

* removed blank line
2017-05-16 15:25:12 -04:00
Ganesh Nalawade
e52d06b401 Add dellos9 changes for Python3 (#24607)
* Add dellos9 changes for Python3

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

* Minor changes
2017-05-17 00:36:52 +05:30
Ganesh Nalawade
a883635aeb Add dellos6 changes for Python3 (#24606)
Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
2017-05-17 00:36:32 +05:30
Ganesh Nalawade
442df927f1 Add dellos10 changes for python3 (#24608)
Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
2017-05-17 00:36:15 +05:30
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
4f29662a9e ansible/vars/: PEP8 compliancy (#24685)
- Make PEP8 compliant
2017-05-16 18:51:27 +01:00
jctanner
bfc551b3f8 Add vmware_guest_find.py module (#24260)
* Add vmware_guest_find.py module

* Fixup linter errors

* Add missing empty line
2017-05-16 08:48:40 -07:00
Lemar Carthens
ef13f0f389 vmware_guest: Fix VM creation when adding a network device without a MAC address (#24138)
* vmware_guest: Fix VM creation when adding a network device without a MAC address

* Provide python2.4 compatibility
2017-05-16 08:47:49 -07:00
James Cammarata
e5cd675b38 Use delegated vars for the delegated host name
In _process_pending_results (strategy/__init__.py), we were using the delegate_to
field directly from the original task, which was not being templated correctly.
As an alternate to #23599, this patch instead pulls the host name out of the delegated
vars passed back in the task result dictionary to avoid having to re-template things.

Fixes #23599
Fixes #20508
2017-05-16 10:24:42 -05: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
kwerey
668092e95a [cloud] Add support for AWS China to elasticache_subnet_group role (#24286) 2017-05-16 11:10:15 -04:00
kwerey
6f66e88bd8 [cloud] Use boto connect_to_region so Elasticache works in AWS China (#24250) 2017-05-16 11:09:54 -04:00
Will Thames
6e13e3918f [cloud] Update VPC configuration for existing lambda (#24368)
If a lambda exists but does not have a VPC configuration,
add the VPC configuration when it's present in the ansible
parameters.

Prior to this change, setting VPC configuration on a lambda
that did not have any VPC configuration would ignore that config.
2017-05-16 11:08:21 -04:00
Ondra Machacek
4d890c1e9f cloud: ovirt change URL in documentation (#24438) 2017-05-16 10:48:26 -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
Nathaniel Case
ea2569db92 Workaround for unicast RPF check (#24519) 2017-05-16 10:11:52 -04:00
Dag Wieers
d07f18fbb9 module_utils/rax: Small parameter cleanup (#24664)
Nothing really fancy.

- Removing boolean choices
- Use path-type for credentials
2017-05-16 10:02:04 -04:00
Lujeni
a3a0742ce5 Add new aws module - iam_cert_facts (#24451) 2017-05-16 09:31:39 -04:00
Jimmy Conner
2380e50408 vmware_guest: Add support for Linked Clones (#23284)
* vmware_guest: Add support for Linked Clones

* Resolve PEP8 Issues

* Change snapshot_name to snapshot_src

* Add additional option 'snapshot_linked' to specify whether to use a linked clone or not

* Changed snapshot_linked parameter to "linked_clone"

* Remove unnecessary conditional
2017-05-16 09:26:51 -04:00
Dag Wieers
61d68275e8 module_utils/asa: PEP8 compliancy (#24655)
- Make PEP8 compliant
2017-05-16 12:16:05 +01:00
Justin Menga
8dae2ea869 Cast CloudFormation parameter values to string - fixes #23593 (#24182) 2017-05-15 13:10:29 -04:00
Abhijeet Kasurde
e9672748cc Add archive option in git plugin (#23332)
* Add archive option in git plugin

This fix will add archive option in git plugin

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Update code as per code review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-15 10:46:25 -04:00
Monty Taylor
91969b8c67 Actually protect against use_default_subnetpool
We have a protection against a user setting use_default_subnetpool in
their playbook - but then we sure do pass the kwarg anyway. Maybe let's
not do that.
2017-05-15 09:41:38 -04: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
Ryan S. Brown
6141818110 [cloud] Document stage option on serverless module 2017-05-15 07:15:01 -04:00
René Moser
3ca3163af1 cloudstack: add new module cs_network_acl (#24609) 2017-05-15 10:57:38 +02:00
Jonathan Davila
6410e13903 Fix bug in iam_role (#22618) 2017-05-14 17:29:44 -04:00
Mohammed Naser
f9b4499082 Set facts type to dict
With newer versions of ansible, module arguments are assumed to
be strings unless otherwise specified.  Our 'facts' argument is
expected to be a dictionary, so tell ansible that.

Without this, the argument will arrive as a string and be written
to the facter file inside string quotes.  Facter will produce the
following error:

  undefined method `each' for #<String:0x000000016ee640>

This was originally fixed and found in the Ansible Puppet role which
is maintained by the OpenStack infrastructure team.

8d0f0bfd0a
2017-05-14 14:10:38 -04:00
René Moser
19e7abb971 cloudstack: return known used resources in fail_json (#24575) 2017-05-13 14:31:51 +02:00
Toshio Kuratomi
84a59e472b Be explicit about pickle protocol and encoding (#24454)
On Python3 and Python2 use pickle slightly differently so we need to be
explicit about some things.

If pickles could be shared between python2 and python3, as in
ansible-connection and the pickle cache, we need to specify the protocol
to use when dumping and the encoding to use for byte strings when
loading.

The dumping protocol needs to be no higher than 2 as python-2 only
supports up to protocol 2.  The encoding should usually be 'bytes' so
that python2 str type becomes python3 bytes type.  However, doing this
means that we must make sure that the objects being serialized properly
make their strings into text strings except when they're supposed to be
bytes.  If strings are improperly byte strings, they may cause
tracebacks on the receiving end
2017-05-12 18:04:48 -07:00
Sloane Hertel
822fcc566e [cloud] Stop ec2_group module from authorizing duplicate rules (#24528) 2017-05-12 14:54:25 -04:00
Kevin Howell
65f0668475 Add pool_ids option to redhat_subscription (#23266) 2017-05-12 14:10:41 -04:00
Chris Alfonso
8c0faa2ebf Revert "[WIP]Fortios address group" (#24549)
* Revert "Add check for processor_core value"

This reverts commit 8ad182059d.

* Revert "Fix for persistent connection plugin on Python3 (#24431)"

This reverts commit d834412ead.

* Revert "removing folded style formatting for synopsis (#22746)"

This reverts commit e539726543.

* Revert "[WIP]Fortios address group (#21831)"

This reverts commit f2dbf512cb.
2017-05-12 10:56:39 -06:00
Abhijeet Kasurde
8ad182059d Add check for processor_core value
Fixes #21893

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-12 12:30:05 -04:00
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
2017-05-12 09:13:51 -07:00
Eric Beahan
e539726543 removing folded style formatting for synopsis (#22746) 2017-05-12 10:00:19 -06:00
Benjamin Jolivot
f2dbf512cb [WIP]Fortios address group (#21831)
* New module fortios_address_group

* Fix issue when fortigate don't contain any address group

* Add alias & change member from str to list type

* Fix pep8

* Fix aliases format in doc

* Fix pep8

* Remove duplicate arg spec with module_utils/fortios.py

* Change string format for better compat + better exception catching + cosmetic changes

* Use set, specify exception, RE pattern one time...

* fix pep8
2017-05-12 09:54:58 -06:00
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.
2017-05-12 11:45:44 -04:00
Gabriele
78ed0cadea Fixing nxos_ntp (#20651)
* Fixing nxos_ntp

* Fixing style issues
2017-05-12 11:36:44 -04:00
Jan-Piet Mens
0e0e5097a9 Optionally return raw data from URL lookup using split_lines=False 2017-05-12 11:02:49 -04:00
Sloane Hertel
91b87d4cbb dict.values() was a list python2 but in python3 it's a view (#24504) 2017-05-12 08:48:16 -04:00
Kai Xia(夏恺)
97b0448f0b fix typo. (#24531)
Signed-off-by: Kai Xia(夏恺) <xiaket@gmail.com>
2017-05-12 08:42:52 -04:00
Toshio Kuratomi
548cacdf6a Fix template not showing a diff with a directory
Template can take a directory as the destination.  When that's the case,
we need to diff between the source and the file inside of the directory.
That happened when the directory was specified with a trailing slash but
not when it was specified on its own.  This change fixes that.

Fixes #24413
2017-05-11 20:37:31 -07:00
Toshio Kuratomi
16325f6f15 Fix pam_limits writing text to a file opened in binary mode
Fixes #24392
2017-05-11 17:17:12 -07:00
rodolfojcj
a47fbba8ae Little documentation fix (#24522)
Added the 'reset_connection' option to the available choices
2017-05-11 15:10:20 -07:00
James Cammarata
78478e80ea Avoid default serialization of classes in dump_attrs
For playbook base objects, when dumping attributes via dump_attrs() an
attribute like loop_control is a class. Using the default serialization
for these is slow and consumes a lot of memory. Since LoopControl is also
based on the Base class, we can use serialize() instead and save a lot of
resources.

This also adds a from_attrs() complimentary method to nicely turn the
dumped attrs back into proper field attributes.

Fixes #23579
2017-05-11 16:28:07 -05:00
taksekine
b04df23da2 fix #24429 (#24491) 2017-05-11 13:59:39 -07:00
Brian Coca
c50cf22d52 deal with null/none connections
fixes #23621
pushed 'connection resolution' to play_context
override fieldattribute getter
2017-05-11 15:46:14 -04:00
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
2017-05-11 13:02:32 -04:00
Abhijeet Kasurde
728d3e6c84 Pep8 fixes for web_infra/ansible_tower (#24479)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-11 11:26:36 -05:00
Dylan Silva
fc3cc73b73 Downgrading module from core to community (#24463) 2017-05-11 08:05:49 -07:00
wiso
bb90f5d220 netconf_config: support new src attribute (new Action Plugin) (#24337)
* Create netconf_config.py

To support new attribute 'src' for the netconf_config module.
Cross-check with #24323

* Update netconf_config.py

* Update netconf_config.py
2017-05-11 18:43:44 +05:30
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
2017-05-11 09:08:19 -04:00
Abhijeet Kasurde
3d51081a59 Refactor nxos_reboot module (#24484)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-11 13:14:31 +05:30
Rob
fd1debb869 Feature/aws helper function for tags (#23387)
* Add new helper function for comparing AWS tag key pair dicts. Also modify boto3_tag_list_to_ansible_dict function to be more generic when looking for key names because AWS sometimes uses 'Key', sometimes 'TagKey' and who knows what the future holds! Fixed modules to work with changes.

* Review changes

* Add some more doc to GUIDELINES for tags and fix var name for snaked values in ec2_group_facts
2017-05-11 07:39:51 +01:00
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
2017-05-11 10:54:47 +05:30
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
2017-05-11 10:54:05 +05:30
Dag Wieers
748f27e597 expect: Add a pointer to the shell/script modules
This PR also includes:
- DOCUMENTATION and EXAMPLES cleanup

This fixes #21335
2017-05-10 20:37:36 -07:00
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
2017-05-10 16:10:33 -07:00
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
2017-05-10 16:12:00 -04:00
Abhijeet Kasurde
2f26c5285a Refactor nxos_file_copy module (#24314)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-10 22:15:42 +05:30
Ondra Machacek
a5020a40e5 Minor fixes for oVirt modules (#23452)
* cloud: ovirt: only image disk can be sparsified

* cloud: ovirt: add post-copy scheduling policy
2017-05-10 09:15:47 -04:00
René Moser
2ef6713abb cloudstack: new module cs_vpn_gateway (#23954)
* cloudstack: new module cs_vpn_gateway
* add integration tests for cs_vpn_gateway
2017-05-10 14:55:14 +02:00
Matt Martz
3324d0a4b0 Support auto_remove in docker_container (#22929)
* Support auto_remove in docker_container

* Fail if not docker>=2 and auto_remove=True, don't set auto_remove in host_config if not docker>=2

* Make quoting more readable in ansible errors
2017-05-09 16:19:27 -04:00
wiso
0a22dbd9d8 Update netconf_config.py (#24323)
* Update netconf_config.py

Implementation proposal for feature request #24220

* Update netconf_config.py

fixed pep8
added code proposal for #24221

* Update netconf_config.py

correct more pep8 related things
add some cosmetic changes
2017-05-09 16:04:59 -04:00
Sloane Hertel
2618e6d516 ec2_elb_lb: allow elb scheme to be updated by restarting the resource - fixes #19116 (#22916)
* allow elb scheme to be updated by restarting the resource

use ensure_gone and require wait option

* fix pep8

* fix yaml

* requested changes

* fix fail_json
2017-05-09 14:01:37 -04:00
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).
2017-05-09 09:18:37 -07:00
Ganesh Nalawade
5b3ea6562b Add junos integration test (#24404) 2017-05-09 18:41:48 +05:30
Feike Steenbergen
c5adf08c40 Reference correct variable and key for role expiry (#23397)
Previously, this module could throw the following error message:
    NameError: global name 'current_roles_attrs' is not defined

The referencing key should also match the name of the column, which is
rolvaliduntil, not rol_valid_until
2017-05-09 14:03:22 +01:00
Abhijeet Kasurde
a255cfd22a Check login_token for user before any operations (#23600)
Fix adds extra check if user is authorized or not while
using login_token.

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-09 13:52:13 +01:00
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
2017-05-09 13:51:19 +01:00
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>
2017-05-09 13:08:25 +01:00
Matt Clay
d999d613cb Python 3 fixes for CloudStack modules and tests. (#24400) 2017-05-09 13:37:08 +02:00
Gaurav Rastogi
6aa32d3e9d Added no_log flag for all the sensitive fields. (#24386) 2017-05-09 11:20:57 +01:00
Dag Wieers
b58cf0d23a windows: Various small documentation fixes (#23138) 2017-05-08 18:03:56 -07:00
Dag Wieers
5ab97b30cd powershell: Add support for list parameters (#23131)
This is a first implementation of list parameters.

It will convert a single string, or comma-separated value into an Array.
2017-05-08 17:53:13 -07:00
Matt Davis
98ff93b2db fix spurious warnings with ansible_winrm_kinit_X args (#24380)
* added to pywinrm arg whitelist
* clarified error text on kinit_mode error
* fixes #23822
2017-05-08 11:27:25 -07:00
James Cammarata
ed56f51f18 Fixing security issue with lookup returns not tainting the jinja2 environment
CVE-2017-7481

Lookup returns wrap the result in unsafe, however when used through the
standard templar engine, this does not result in the jinja2 environment being
marked as unsafe as a whole. This means the lookup result looses the unsafe
protection and may become simple unicode strings, which can result in bad
things being re-templated.

This also adds a global lookup param and cfg options for lookups to allow
unsafe returns, so users can force the previous (insecure) behavior.
2017-05-08 12:43:46 -05:00
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
2017-05-08 11:38:50 -04:00
Ganesh Nalawade
4186b07d21 Fixes #24375 Add check to identify if diff is empty (#24377)
* Fix #24375 Add check to identify if diff is empty
2017-05-08 20:36:56 +05:30
Abhijeet Kasurde
d072d91aed Use wait_timeout as integer in redshift module (#24279)
Fix stricts datatype of wait_timeout to int as module
is using it as integer.

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-08 10:07:04 -04:00
Gaurav Rastogi
b1efad52a4 New module to setup cloud connector properties (#22225)
* New module to set up cloud connector properties

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-08 07:40:29 +01:00
Gaurav Rastogi
1978795089 New module to setup string group. (#22223)
* New module to setup string group.

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-08 07:39:22 +01:00
Abhijeet Kasurde
2425143cf2 Pep8 fixes for digital_ocean_*
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-08 10:53:47 +08:00
Abhijeet Kasurde
9c5b55232c Pep8 fixes for Windows module (#24349)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-07 20:59:35 +01:00
Martin Kopta
c4ad0f86c7 fixed yum.parse_check_update regex (#24331)
Output of `yum check-update` can contain lines with long package names and long
repository label names, which will be broken into multiple lines, which need to
be sanitized. The solution to this has been fixed and refactored in 2.3 in form
of parse_check_update(), but it still contains subtle bug, which makes such
multi-lines invisible to later logic (such packages aren't included in
parse_check_update()) output. The problem is caused by using '\1' in re.sub(),
instead of proper r'\1', which literally puts unicode symbol \1 into resulting
output.
2017-05-05 17:01:30 -04:00
Sloane Hertel
0438236263 [cloud] Add version_added to route53 option 'state' - fixes #24306 (#24335)
* fix route53 documentation

* improve state option description and remove version_added
2017-05-05 14:58:34 -04:00
Toshio Kuratomi
4bf8071889 Give user whatever information we have from ssh-keyscan
ssh-keyscan isn't very verbose about errors.  Give the user whatever
information we have available even if it isn't much.  At least they will
know how we were running ssh-keyscan and why there's an error now.

Fixes #19440
2017-05-05 08:35:04 -07:00
Adrian Likins
3840119bc7 Fix vaulted vars templating (#24312)
Use the default repr of AnsibleVaultEncryptedUnicode.data instead
of a custom one, since jinja templating ends up using the repr()
results.

Fixes #23846, #24175
2017-05-05 11:07:50 -04:00
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>
2017-05-05 15:38:30 +05:30
Dag Wieers
58c1a9dd94 vmware_guest: Don't force onto specific host (#22777)
Unless we provided a specific esxi_hostname, don't force new VMs onto the first host in the cluster.
2017-05-05 05:27:04 -04:00
Trishna Guha
986765312f Fixes #23948 body not defined nxos_hsrp (#24093) 2017-05-05 08:36:00 +05:30
Trishna Guha
67bd8f9204 fixes nxos_interface (#24199)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-05-05 08:35:16 +05:30
Alberto Murillo Silva
d31a09ceb7 Fix os_quota to not break when volumev2 service is not available.
os_quota checks the current quotas for compute, network and volume
services and fails when no volume service is found in the catalog.

Since openstack test deployments without volume services are common
os_quota shouldn't fail if such service is missing.

Fixes #23085

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2017-05-04 18:34:12 -04:00
Alberto Murillo Silva
136a6eec9e dnf: Add autoremove option
This allow users to write better playbooks by replacing

- shell: dnf autoremove -y
with
- dnf: autoremove=yes

Fixes #18815

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2017-05-04 13:52:16 -07:00
Abhijeet Kasurde
d8a9b9f347 Fix win_user warning message (#24263)
Fix adds correct warning after deleting Windows User.
Also, adds modular function to get group

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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-04 12:53:19 -07:00
Matt Martz
63f8e6b68a Fix version_added for new option in template introduced in #21846 (#24307) 2017-05-04 14:53:00 -05:00
Dane Summers
4bd04c299b Fixes #23285 (#24291)
Makes subversion module --check fail when modified files are in
repository.
2017-05-04 10:08:39 -07:00
Toshio Kuratomi
e36d2f0bd0 ansible-doc snippet format changes
* ansible-doc -s is supposed to output a sample snippet of how you could
  add the module into a playbook.  These changes update the style:
  * Use yaml mappings instead of key=value
  * Use the module name directly instead of action: modulename
* Fixes a bug when displaying option descritpions which are yaml strings
  instead of lists.

This fixes in code the bad formatting reported in #24201
2017-05-04 09:08:19 -07:00
Joris (J.J.M.) Weijters
2a7ce1059d adjusted descriptions in DOCUMENTATION, and fixed type in RETURN 2017-05-04 07:38:34 -07:00
Gaurav Rastogi
4f7d342c0e New module to setup Cloud properties (#22226)
* New module to set up Cloud properties

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 13:24:43 +01:00
Gaurav Rastogi
ffeb105423 New module to setup serviceengine group. (#22227)
* New module to setup serviceengine group.

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 13:23:43 +01:00
Gaurav Rastogi
5ccba73c55 New module to setup network object. (#22228)
* New module to setup network object.

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 13:21:38 +01:00
Gaurav Rastogi
099a1c5aef New module to set up GLSB object (#22229)
* New module to set up GLSB object

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 13:18:28 +01:00
Gaurav Rastogi
368ccf1ac7 New module to setup GSLB service (#22230)
* New module to setup GSLB service

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 13:16:34 +01:00
Gaurav Rastogi
243eacb650 New module to set up gslb health monitors (#22231)
* New module to set up gslb health monitors

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 13:14:40 +01:00
Gaurav Rastogi
91f255a07b New module to setup IP address group. (#22224)
* New module to setup IP address group.

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 12:48:10 +01:00
Gaurav Rastogi
b0465a2fbd New module to set up cloud object (#22198)
* New module to set up cloud object

* Fixed documentation error

* Updated descriptions for Avi 17.1.1 release and Fixed metadata
2017-05-04 12:39:29 +01:00
Abhijeet Kasurde
86966c75fa New module : github_issue (#23654)
Using github_issue module, user can retrive status of issue
listed on Github repository and depending upon status takes
various actions e.g., workarounds and downloading patches.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-05-04 12:16:32 +01:00
jctanner
08a3ea2221 sysctl: switch basestring to string_types (#24277) 2017-05-03 21:31:57 -04:00
Matt Davis
2052ed48d5 Deprecated restart option in win_feature, added return docs 2017-05-03 17:06:02 -07:00
Matt Davis
db91dd8685 fixed issue with multiple calls to Add-DeprecationWarning 2017-05-03 17:06:02 -07:00
Matt Martz
7dbec976af Switch last remaining decode to to_text (#24269) 2017-05-03 16:51:17 -05:00
Brian Coca
b731c2d809 include_vars to delegated only if delegate_facts (#24259)
* include_vars to delegated only if delegate_facts

fixes #24172

* since code is now same, simplified
2017-05-03 16:30:20 -04:00
Toshio Kuratomi
a0dfa8616a Make fetch default to fail on errors
Fixes #23501
2017-05-03 09:37:31 -07:00
Toshio Kuratomi
90a229c793 Fix error in unittesting
When unittesting, the framework creates a pipes module that is picked up
by the basic module_utils test.  Switch to using shlex_quote as that is
the right thing to use for portability anyway.
2017-05-03 09:37:31 -07:00
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.
2017-05-03 09:37:31 -07:00
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
2017-05-03 12:24:02 -04:00
Ritesh Khadgaray
fb6e9e8fbe rhn+register: do not pass username/passwd for registration if none is specified. (#24244) 2017-05-03 12:12:16 -04:00
Sloane Hertel
4278618746 verify arns differently than function names (#23966) 2017-05-03 12:01:42 -04:00
Gaurav Rastogi
e8a0215cd3 Avi 17 1 (#24047)
* Added new common argument api_version for all Avi modules

* Updated dependency for the new modules to use avi sdk 17.1 and above

* Updated Avi 17.1.1 modules with descriptions and moddule dependencies

* Updated version_added for new options
2017-05-03 16:51:28 +01:00
mattwwarren
45ac28ba04 remove self from function outside of class (#24017)
* remove self from function outside of class

* fix indentation
2017-05-03 11:49:43 -04:00