Commit graph

8973 commits

Author SHA1 Message Date
Tobias Wolf
34201d6bc4 Fix database table quoting in privileges_unpack() (#3858)
In Ansible 2.x this module gives `changed = True` for all privileges
that are specified including a table with

    priv: "database.table:GRANT"

Mysql returns escaped names in the format

    `database`.`tables`:GRANT

However in PR #1358, which was intended to support dotted database names
(a crazy idea to begin with), the quotes for the table name were left
out, leading to `curr_priv != new_priv`.

This means that the idempotency comparison between new_priv and
curr_priv is always 'changed'.

This PR re-introduces quoting to the table part of the priv.
2016-08-31 14:23:54 -07:00
Jean Prat
86366eca68 if user is empty, it is not converted to tuple when using host_all (#3038) 2016-08-31 21:56:08 +02:00
James Cammarata
e7cf786851 Adding 'end_play' docs to meta module 2016-08-31 14:12:29 -05:00
Peter Sprygada
6f9ab60f81 Merge pull request #4615 from ansible/gundalow-patch-2
Consistent naming of Arista EOS device
2016-08-31 14:16:28 -04:00
Toshio Kuratomi
958d894c61 We've decided that pythn 3.5 is the minimum python3 version (#4572) 2016-08-31 08:31:23 -07:00
Michael Scherer
6dd2bc2bff Make async work on python 3 (#4583)
Since dict no longer have a iteritems method, we have to
use six to support python 2 and 3.
2016-08-31 08:18:54 -07:00
Michael Scherer
cee7473df6 Port mount.py to python3, need to use six.iteritems (#4581) 2016-08-31 08:16:35 -07:00
Michael Scherer
1acb23f8d6 Fix uri to run on python3 (#4580)
Since dict no longer have a method iteritems, we have to use
the six wrapper.
2016-08-31 08:16:01 -07:00
Michael Scherer
2e7cd6e02a Port postgresql module to python3 (#4579)
Iteritems is no longer a dict method in Python3, replace it with
the six wrapper.
2016-08-31 08:08:12 -07:00
Michael Scherer
c091a3e9ac Fix mysql_user for python3 (#4576)
dict no longer have a iteritems method, it was replaced
by items. So we need to use six.

    Traceback (most recent call last):
      File \"/tmp/ansible_hjd7d65c/ansible_module_mysql_user.py\", line 587, in <module>
        main()
      File \"/tmp/ansible_hjd7d65c/ansible_module_mysql_user.py\", line 571, in main
        changed = user_add(cursor, user, host, host_all, password, encrypted, priv, module.check_mode)
      File \"/tmp/ansible_hjd7d65c/ansible_module_mysql_user.py\", line 239, in user_add
        for db_table, priv in new_priv.iteritems():
    AttributeError: 'dict' object has no attribute 'iteritems'
2016-08-31 08:07:32 -07:00
Michael Scherer
38992bbd57 Fix user module under python3 (#4560)
Using something like:

    - name: Create ssh keys
      user:
        name: root
        generate_ssh_key: yes
      register: key

result into this traceback on F24

    Traceback (most recent call last):
      File \"/tmp/ansible_jm5d4vlh/ansible_module_user.py\", line 2170, in <module>
        main()
      File \"/tmp/ansible_jm5d4vlh/ansible_module_user.py\", line 2108, in main
        (rc, out, err) = user.modify_user()
      File \"/tmp/ansible_jm5d4vlh/ansible_module_user.py\", line 660, in modify_user
        return self.modify_user_usermod()
      File \"/tmp/ansible_jm5d4vlh/ansible_module_user.py\", line 417, in modify_user_usermod
        has_append = self._check_usermod_append()
      File \"/tmp/ansible_jm5d4vlh/ansible_module_user.py\", line 405, in _check_usermod_append
        lines = helpout.split('\\n')
    TypeError: a bytes-like object is required, not 'str'
2016-08-31 07:52:46 -07:00
Michael Scherer
6063071a46 Fix traceback on python3 (#4556)
Traceback (most recent call last):
  File "/tmp/ansible_csqv781s/ansible_module_systemd.py", line 374, in <module>
    main()
  File "/tmp/ansible_csqv781s/ansible_module_systemd.py", line 263, in main
    for line in out.split('\\n'): # systemd can have multiline values delimited with {}
2016-08-31 07:49:45 -07:00
Peter Sprygada
a73d32c33a Merge pull request #4588 from privateip/eos_eapi
update eos_eapi module with new enhancements
2016-08-31 09:47:06 -04:00
Peter Sprygada
c215398e2f update eos_eapi module with new enhancements
* add support for vrf configurations
* add support for configing the qos value for eapi
* add config argument to specify the device running-config

Tested on EOS 4.15.4F
2016-08-31 09:37:23 -04:00
John R Barker
ec1c490888 Consistent naming of Arista EOS device 2016-08-31 14:31:16 +01:00
Peter Sprygada
38fd67bead Merge pull request #4608 from privateip/ios_command
removes output keyword from command in ios_command
2016-08-30 17:19:57 -04:00
Peter Sprygada
a6ffe2e7be removes output keyword from command in ios_command
IOS devices only support a single command output which is structured
text.  This removes the ability to specify the command output format
when providing complex arguments to the commands
2016-08-30 17:14:33 -04:00
Peter Sprygada
6543bb4bdd update nxos_nxapi module with minor enhancements (#4573)
* added new config argument
* added states present and absent
* update to use network shared modules

Tested on NXOS 7.3(0)D1(1)
2016-08-30 20:05:18 +01:00
Timothy Appnel
2538c70d46 Fixes get_url examples in docs and applies native YAML syntax. (#4474) 2016-08-30 20:04:03 +01:00
John R Barker
0c25e968ee digital_ocean_tag name is a required field
Spotted during final review of https://github.com/ansible/ansible-modules-core/pull/4218/files
Simple to change, so fixing post merge
2016-08-30 19:56:49 +01:00
Victor Volle
c170107eef Digitalocean tags (replaces #4209) (#4218)
* Fixes #4117: Add DigitalOcean Tag support

* Add GPLv3 license header and RETURN documentation

* ansible.module_utils.urls instead of "requests"
2016-08-30 19:54:46 +01:00
Arun prasath
0d98760b49 Fixes bug #4546 - Made password optional (#4574) 2016-08-30 11:16:43 -04:00
David J Peacock
8f963a7028 Fix #4412: os_security_group_rule support numbered protocols (#4444) 2016-08-30 10:55:16 -04:00
Ryan Brown
0c37949941 Remove spurious changed state on iam_policy module (#4381)
Due to a mixup of the group/role/user and policy names, policies with
the same name as the group/role/user they are attached to would never be
updated after creation. To fix that, we needed two changes to the logic
of policy comparison:

- Compare the new policy name to *all* matching policies, not just the
  first in lexicographical order
- Compare the new policy name to the matching ones, not to the IAM
  object the policy is attached to
2016-08-30 10:24:00 -04:00
James S. Martin
978716cf4c Shows messages for uncaught exceptions from called modules in async_wrapper output. (#4591) 2016-08-30 10:10:01 -04:00
Rick Mendes
02c47f5b0c Fixes #3144 (#4305) 2016-08-30 15:16:42 +02:00
Vytis Banaitis
c6c281b125 Fix change status on django_manage collectstatic. (#4239)
Ignore blank lines in collectstatic output.
2016-08-30 12:25:46 +02:00
Guillaume Delpierre
2a25e27979 gem: add support for --env-shebang (#4377)
* gem: add support for --env-shebang

* fix version added
2016-08-30 12:23:24 +02:00
Levi Morales
688fa6fc54 Fixes #2322 fix for missing append check on Darwin systems (#4256) 2016-08-30 11:59:04 +02:00
Evan Kaufman
5728ef89f0 Implemented file content diff for replace module (#4479) 2016-08-30 11:56:35 +02:00
Matías Pizarro
521c9a2e20 Use named parameters in new_droplet method call (#4483)
This mirrors the original method signature and guards against any
change in order parameter
2016-08-30 11:56:09 +02:00
Anton Onufriev
2ca16dfaad Remove colors from git-branch output for correct local search (#4545)
We got an error while switching on existent local branch
because git module can not find branch in function get_branches
if we have color.branch=always in git config.
2016-08-30 11:53:42 +02:00
Michael Scherer
5310bab12f Port the module to run on python 3 (#4496)
One of the usual issue is that run_command return bytes,
so we have to adapt the string to either be bytes too,
or convert to string.

This result into that kind of traceback:

    Traceback (most recent call last):
      File \"/tmp/ansible_ej32yu2w/ansible_module_git.py\", line 1009, in <module>
        main()
      File \"/tmp/ansible_ej32yu2w/ansible_module_git.py\", line 873, in main
        git_version_used = git_version(git_path, module)
      File \"/tmp/ansible_ej32yu2w/ansible_module_git.py\", line 788, in git_version
        rematch = re.search('git version (.*)$', out)
      File \"/usr/lib64/python3.5/re.py\", line 173, in search
        return _compile(pattern, flags).search(string)
    TypeError: cannot use a string pattern on a bytes-like object

Another issue is filter being a object instead of a list.
2016-08-29 09:00:53 -07:00
Peter Sprygada
12122952db Merge pull request #3950 from grybak-arista/eos_exit_fix
Move call to filter_exit out of command execution block
2016-08-29 10:43:21 -04:00
James Pharaoh
5bce0049a1 fix error in documentation for stat checksum (#4582) 2016-08-27 21:25:26 -04:00
Peter Sprygada
9e97431308 Merge pull request #4578 from privateip/nxos_facts
convert nxos_facts map from dict to frozenset
2016-08-27 14:39:50 -04:00
Ilja Bauer
acb7d873f8 Replaced use of bare variables with full variable syntax (#4149) 2016-08-27 17:11:42 +02:00
Gennady Trafimenkov
6ac58a5832 Clarify what checksum algorithm is used by copy modules (#4198) 2016-08-27 17:11:17 +02:00
Ali Ok
ab55355b00 Fix minor syntax error in authorized_key module doc (#4491) 2016-08-27 16:52:03 +02:00
Robin Roth
9da4c42679 Clarify that refspec is needed to checkout a git hash (#4564)
fixes #1531
2016-08-27 16:51:18 +02:00
Michael Scherer
21688383c3 Convert command output to native string (#4559)
Without it, the module always return changed on python3,
which is harmless but add noise and can have some side effects.
2016-08-27 15:53:13 +02:00
Chris Houseknecht
6ca02cadd0 Merge pull request #4577 from chouseknecht/devel
Fix container labels expected vs actual comparison.
2016-08-27 09:06:02 -04:00
Peter Sprygada
277f8cfa5c convert nxos_facts map from dict to frozenset
* key maps are now frozenset instead of dict objects
* FactsBase now includes utility functions for transforming json data structures

Tested on NXOS 7.3(0)D1(1)
2016-08-27 08:47:42 -04:00
chouseknecht
48941291c1
Fix container labels expected vs actual comparison. 2016-08-27 08:00:13 -04:00
Brian Coca
5d90b86d82 added docs for vars_from/defaults_from 2016-08-26 21:56:19 -04:00
Peter Sprygada
565fb59d0a Merge pull request #4565 from privateip/iosxr_facts
add new iosxr_facts module for fact collection from XR devices
2016-08-26 21:43:18 -04:00
Peter Sprygada
dfce797dad add new iosxr_facts module for fact collection from XR devices
* adds support for std network facts
* adds support for default facts subset
* adds support for config facts subset
* adds support for interface facts subset
* adds support for hardware facts subset

Tested on IOS-XR 6.0.0
2016-08-26 21:41:05 -04:00
Peter Sprygada
5917a73623 Merge pull request #4563 from privateip/iosxr_config
update iosxr_config with new arguments
2016-08-26 21:39:36 -04:00
Peter Sprygada
a093fb1c83 Merge pull request #4566 from privateip/iosxr_template
update iosxr_template to use network shared modules
2016-08-26 21:39:23 -04:00
Peter Sprygada
13cfc911b4 Merge pull request #4567 from privateip/ios_template
update ios_template module using refactored network shared modules
2016-08-26 21:39:00 -04:00