Commit Graph

731 Commits (c0ebb74ad0ee2eb210266e3610e0b44474628872)

Author SHA1 Message Date
Trond Hindenes 94cfbe7ee9 Get-AnsibleParam 2015-09-30 21:02:12 +02:00
Marius Gedminas cc1e1648f5 Tweak comment style 2015-09-30 18:46:50 +03:00
Marius Gedminas 213029a21e Python 3: don't convert unicode to unicode 2015-09-30 18:46:49 +03:00
Marius Gedminas c7be004c19 Python 3 has no dict.iteritems()
(Reminder: cannot use six here, module_utils get shipped to remote
machines that may not have six installed -- besides six doens't support
Python 2.4.)
2015-09-30 18:46:49 +03:00
Marius Gedminas 9f3e5ceb14 Make sure 'basestring', 'bytes' and 'unicode' are defined
Python 3 doesn't have 'basestring' and 'unicode'.

Python 2.4 doesn't have 'bytes'
2015-09-30 18:40:47 +03:00
Brian Coca ddafed4403 Merge pull request #12528 from bcoca/task_logging
task logging revamp
2015-09-30 11:38:34 -04:00
Brian Coca 7b64126c9d pushed up openvz detection for cases of 'stacked' virtualization 2015-09-30 11:27:50 -04:00
Linus Unnebäck 45f9800754 facts: correctly detect docker inside a xen host 2015-09-30 17:08:21 +02:00
Konstantin Manna 4226e49bc6 bugfix: statement had no effect => statement now has assumed effect 2015-09-28 23:33:48 -04:00
Brian Coca 8d024c3747 Merge pull request #12472 from resmo/for_ansible
cloudstack: improvements and tests
2015-09-28 14:27:22 -04:00
Toshio Kuratomi 056a020357 Do not fail if /proc/uptime is not present
This can happen in chroot environments that don't have all of /proc
available
2015-09-26 10:00:28 -07:00
Brian Coca 37a918438b task logging revamp
* allow global no_log setting, no need to set at play or task level, but can be overriden by them
 * allow turning off syslog only on task execution from target host (manage_syslog), overlaps with no_log functionality
 * created log function for task modules to use, now we can remove all syslog references, will use systemd journal if present
 * added debug flag to modules, so they can make it call new log function conditionally
 * added debug logging in module's run_command
2015-09-25 23:57:28 -04:00
Brian Coca 191ae0831d fixed syntax error 2015-09-25 17:15:26 -04:00
Brian Coca 48412c13b2 fixed copy n paste typo on future code 2015-09-25 17:08:03 -04:00
Brian Coca 1c49e3b842 draft shared service code for modules, part of spliting service module 2015-09-25 11:26:21 -04:00
Toshio Kuratomi dcdcd9e9c5 Move is_executable to the toplevel of basic.py so we can utilize it from other code 2015-09-25 07:48:57 -07:00
Gerben Geijteman 4c20964475 Add Weekday (0-6) as a number and add weeknumber (00-52) 2015-09-24 15:05:44 +02:00
Marius Gedminas 2c4982b58d Python 3: there's no itertools.imap
Because the builtin map() acts like an iterator already.
2015-09-23 10:04:26 +03:00
Marius Gedminas 6708d56a21 Python 3: avoid long integer literals
Even Python 2.4 automatically promotes int to long.
2015-09-23 10:04:25 +03:00
Marius Gedminas f5d4935197 Python 3: treat python as a function in module_utils/basic.py
NB: we can't use 'from __future__ import print_function', but luckily
print(one_thing) works fine on both Python 2 and Python 3 without that.
2015-09-23 10:04:25 +03:00
Marius Gedminas e71a986e16 Python 3: avoid octal constants in module_utils/basic.py 2015-09-23 10:04:25 +03:00
Marius Gedminas d2bec7f81f Python 3: avoid "except ..., e:" in module_utils/basic.py
Make the code compatible with Pythons 2.4 through 3.5 by using
sys.exc_info()[1] instead.

This is necessary but not sufficient for Python 3 compatibility.
2015-09-23 10:04:25 +03:00
Rene Moser b43939dfd6 cloudstack: make tags handling idempotence
Credits to @jeffersongirao, who provided the patch.
2015-09-22 16:12:35 +02:00
Rene Moser efd122c2f0 cloudstack: add returns_to_int return handling into utils
It is not uncommon that the API returns string for int values e.g. ports in listFirewallRules or listPortForwardings,
2015-09-22 14:44:08 +02:00
Rene Moser c9a3801a25 cloudstack: common argument_spec and requried_together to utils 2015-09-22 14:36:43 +02:00
Brian Coca d27b73e7b5 fixed case in which boto3 is present but module is not using it yet 2015-09-21 15:16:07 -04:00
Peter Sprygada e45b71d6cd added new module object to vca 2015-09-18 13:45:37 -04:00
Brian Coca aca83b15e5 Merge pull request #12425 from privateip/devel
initial add of vca common module
2015-09-18 11:24:54 -04:00
Brian Coca 11707576a3 fix for AIX network facts
fixes #12434
2015-09-18 10:43:53 -04:00
Brian Coca d7b61db6dc made boto3 non mandatory 2015-09-18 08:05:33 -04:00
Peter Sprygada 8f43d222c0 initial add of vca common module 2015-09-17 14:41:53 -04:00
Chris Church 5c65ee7f0c Add PowerShell exception handling and turn on strict mode.
* Add exception handling when running PowerShell modules to provide exception message and stack trace.
* Enable strict mode for all PowerShell modules and internal commands.
* Update common PowerShell code to fix strict mode errors.
* Fix an issue with Set-Attr where it would not replace an existing property if already set.
* Add tests for exception handling using modified win_ping modules.
2015-09-15 16:32:35 -04:00
Monty Taylor 3bdd6793ca Add no-log parameter to common openstack args
These bad boys can contain secret data, so should be marked no-log.
2015-09-13 19:48:37 +02:00
Benno Joy 6de13c3062 Merge pull request #11818 from Java1Guy/module_utils_ec2_for_ecs
change ec2 util to create only requested objects
2015-09-10 11:06:19 +05:30
Toshaan Bharvani 4702d2be09 added Manjaro as an Archlinux family 2015-09-05 12:49:20 +02:00
Tim Rupp 6f41a72158 Adds utf-8 encoding to f5 module_utils
The contributor's name on line 10 (originally line 7) includes a character
that the default Python encoding (ASCII) raises an error on when interpreting
the file.

Specifying the utf-8 encoding, as is done in other modules, resolves
the error.

The error being raised is

SyntaxError: Non-ASCII character '\xc3' in file /.../lib/ansible/module_utils/f5.py
on line 7, but no encoding declared; see http://www.python.org/peps/pep-0263.html
for details
2015-09-01 08:10:23 -07:00
Desmond O. Chang 58c3539196 Add host key for ssh url only.
Rewrite function `get_fqdn`.  It returns fqdn for all kinds of urls now.

`add_git_host_key` determines whether a url is ssh and whether its host
key should be added.
2015-08-31 13:42:32 -07:00
James Cammarata 2043fcd5db Merge pull request #12083 from resmo/for-ansible
cloudstack: implement general api_region support, update docs
2015-08-28 13:14:50 -04:00
maty0609 6f24e6f994 Adding support for Archlinux and Slackware in fallback
In some cases Archlinux and Slackware is not detected by
platform.dist(). This should solve the issue.
2015-08-27 10:22:02 +01:00
Rene Moser 3db4039ad1 cloudstack: implement general api_region support, update docs 2015-08-25 13:54:21 +02:00
James Cammarata db65503778 Revert "Add PowerShell exception handling and turn on strict mode." 2015-08-23 21:09:16 -04:00
Chris Church 4b2cdadc98 Add PowerShell exception handling and turn on strict mode.
* Add exception handling when running PowerShell modules to provide exception message and stack trace.
* Enable strict mode for all PowerShell modules and internal commands.
* Update common PowerShell code to fix strict mode errors.
* Fix an issue with Set-Attr where it would not replace an existing property if already set.
* Add tests for exception handling using modified win_ping modules.
2015-08-22 18:28:07 -04:00
Rene Moser d16429b59c cloudstack: rename returns for consistency 2015-08-19 21:25:19 +02:00
Rene Moser 2913d2b44d cloudstack: add more common returns 2015-08-17 08:21:37 +02:00
Brian Coca c6733cc1a7 Merge pull request #9225 from qvicksilver/aix_unprivileged
AIX unprivileged facts collection
2015-08-12 23:48:44 -04:00
Rene Moser 4f3c863b42 cloudstack: refactor get_result()
* A commen dict of keys has been defined, which we look in results returned from the API.
* self.returns dict can be use in subclass to extend this dict.
* Optionally the key name can be replaced with a new key name, often used to make the return keys identical to the arguments passed.
* Use new style class
2015-08-12 23:14:17 +02:00
Brian Coca 6bceee9a93 now lvs/vg facts are only attempted if binary found 2015-08-12 10:53:13 -04:00
Alexander Gubin 1ea1b9fb13 bugfix: missing path for lvm facts 2015-08-12 16:35:31 +02:00
Brian Coca ae9d264b86 Merge pull request #11762 from amenonsen/9795-rebase
Add LVM facts to setup module
2015-08-12 08:55:08 -04:00
Rene Moser e62fbf5fba cloudstack: add get_result() in utils to return common results 2015-08-11 18:03:50 +02:00
Toshio Kuratomi 00b1a2c865 Restore ValueError in md5 method and change finding the available hash algorithms so we only have to do it once 2015-08-06 14:40:28 -07:00
Toshio Kuratomi 80cb69214b Merge pull request #11840 from muffl0n/module_utils_hash_algorithms
Add get_available_hash_algorithms()
2015-08-06 14:29:31 -07:00
Brian Coca 08e6c1d82b avoid possible errors with new broadcast handling in linux 2015-08-06 09:00:52 -04:00
Brian Coca 262c75c253 Merge pull request #10971 from mightydok/debbraoadcastfix
Add missed broadcast address to linux network facts.
2015-08-06 08:52:55 -04:00
Brian Coca 2b9b3a08a1 make sure you only update pci data if there is a match 2015-08-05 09:44:37 -04:00
muffl0n 8d6d711a5c move get_available_hash_algorithms() from get_url 2015-08-04 08:57:36 +02:00
James Cammarata 13b8a57d3d Undo previous travis/tox fixes and fix underlying issue 2015-07-31 23:01:43 -04:00
Chris Church 74df17de29 Add an option for PowerShell modules to indicate support for check mode, skip running module if check mode is not supported. 2015-07-31 14:48:51 -04:00
Chris Church e87cf4a3cc Fixes for WinRM/PowerShell support in v2.
- Add support for inserting module args into PowerShell modules.  Fixes #11661.
- Support Windows paths containing spaces.  Applies changes from #10727 to v2.  Fixes #9999.  Should also fix ansible/ansible-modules-core#944 and ansible/ansible-modules-core#1007.
- Change how execution policy is set for running remote scripts.  Applies changes from #11092 to v2.  Also fixes ansible/ansible-modules-core#1776.
- Use codepage 65001 (UTF-8) for WinRM connection instead of default (CP437), convert command to UTF-8 and results from UTF-8.  Replaces changes from #10024.  Fixes #11198.
- Close WinRM connection when task completes.
- Use win_stat, win_file and win_copy modules instead of stat, file and copy when called from within other action plugins (only when using WinRM+PowerShell).
- Unquote Windows path arguments before passing to win_stat, win_file, win_copy and slurp modules (only when using WinRM/PowerShell).
- Check for win_ping module to determine if core modules are missing (only when using WinRM/PowerShell).
- Add stdout_lines to result from running low level commands (so stdout_lines is available when using raw/script).
- Update copy action plugin to use shell functions for joining paths and checking for trailing slash.
- Update fetch action plugin to unquote source path when using Windows paths.
- Add win_copy and win_template action plugins that inherit from copy and template.
- Support running .bat and .cmd scripts using default system encoding instead of UTF-8.
- Always send PowerShell commands as base64-encoded blobs to allow for running simple PowerShell commands via raw.
- Support running modules on Windows with interpreters other than PowerShell.
- Update integration tests to support above changes and test unicode fixes.
- Add test for win_user error from ansible/ansible-modules-core#1241 (fixed by ansible/ansible-modules-core#1774).
- Add test for additional win_stat output values (implemented by ansible/ansible-modules-core#1473).
- Add test for OS architecture and name from setup.ps1 (implemented by ansible/ansible-modules-core#1100).

All WinRM integration tests pass for me with these changes.
2015-07-31 14:38:31 -04:00
Mark Chance 437d4deffc change ec2 util to create only requested objects 2015-07-31 09:47:24 -06:00
Jonathan Süssemilch Poulain 02294c52ce Typo 2015-07-31 13:25:42 +02:00
Jonathan Süssemilch Poulain 4614a574ea Allows network network interface facts collection as an unprivileged user and adds more facts 2015-07-31 10:39:02 +02:00
Jonathan Süssemilch Poulain e181bcf62b Allows to fetch machine architecture as an unprivileged user 2015-07-31 10:35:10 +02:00
Brian Coca b37be236d9 Merge pull request #11475 from nibalizer/cfacter_support
Use cfacter instead of facter if possible
2015-07-29 22:46:21 -04:00
Brian Coca 527ae360b0 Merge pull request #10652 from vodik/nspawn
Support querying systemd container information
2015-07-29 21:51:58 -04:00
Joseph Callen 2f5ced8856 Moving VMware Utilites module
Moved `vmware.py` from v1 to `lib/ansible/module_utils/vmware.py`.

No other changes has been made since these two PRs:
https://github.com/ansible/ansible/pull/10812
https://github.com/ansible/ansible/pull/10760
2015-07-29 17:16:15 -04:00
Brian Coca 80ecab5317 Merge pull request #11761 from amenonsen/9843-rebase
Add pciid to LinuxNetwork interface fact
2015-07-27 22:20:04 -04:00
Hugh Saunders f344ec463f Add LVM facts to setup module
This commit adds LinuxHardware.get_device_facts() and calls that from
.populate().

LVM facts are only gathered if the setup module is running as root and
the lvm utilities are available (tested by searching for 'vgs').

If the conditions are met, facts are set for each volume group and
logical volume.

Example:

Test LVM Data:
$ sudo vgs
  VG   #PV #LV #SN Attr   VSize VFree
  test   1   2   0 wz--n- 5.00g 2.00g
$ sudo lvs
  LV      VG   Attr      LSize Pool Origin Data%  Move Log Copy%  Convert
  testlv  test -wi-a---- 1.00g
  testlv2 test -wi-a---- 2.00g

Facts Returned:
$ ansible localhost -i /tmp/inv -m setup -a 'filter=ansible_lvm'
localhost | success >> {
    "ansible_facts": {
        "ansible_lvm": {
            "lvs": {
                "testlv": {
                    "size_g": "1.00",
                    "vg": "test"
                },
                "testlv2": {
                    "size_g": "2.00",
                    "vg": "test"
                }
            },
            "vgs": {
                "test": {
                    "free_g": "2.00",
                    "num_lvs": "2",
                    "num_pvs": "1",
                    "size_g": "5.00"
                }
            }
        }
    },
    "changed": false
}

Test as non-root:
$ ansible localhost -i /tmp/inv-user -m setup -a 'filter=ansible_lvm'
localhost | success >> {
    "ansible_facts": {},
    "changed": false
}

Test without lvm utilities available
$ sudo mv /sbin/vgs{,.bk}
$ ansible localhost -i /tmp/inv -m setup -a 'filter=ansible_lvm'
localhost | success >> {
    "ansible_facts": {},
    "changed": false
}
2015-07-28 07:46:01 +05:30
Brian Coca 5f8db9cd4b changed verbose_override to the new _ansible_verbose_override to keep in line with previous changes
output now defaults back to having indent=4
2015-07-27 22:15:44 -04:00
Trapier Marshall 250620f2ab Add pciid to LinuxNetwork interface fact
This commit adds pciid to the LinuxNetwork fact object.

pciid is gathered if the symlink /sys/class/net/*/device exists.

Example [>>>> emphasis <<<<]:

$ readlink /sys/class/net/eth0/device
../../../0000:01:00.0

$ ansible localhost --ask-pass -i /tmp/hosts -m setup -a "filter=ansible_eth0"
SSH password:
localhost | success >> {
    "ansible_facts": {
        "ansible_eth0": {
            "active": false,
            "device": "eth0",
            "macaddress": "0c:d2:92:5d:6e:8e",
            "module": "alx",
            "mtu": 1500,
       >>>> "pciid": "0000:01:00.0", <<<<
            "promisc": true,
            "type": "ether"
        }
    },
    "changed": false
}
2015-07-28 07:30:03 +05:30
Brian Coca 8746e692c1 changed check to allow for powerpc
fixes #11528
2015-07-27 21:44:17 -04:00
Toshio Kuratomi d2346fd2e2 Python2.4 compat fix 2015-07-27 15:34:51 -07:00
Toshio Kuratomi 6a68be4e28 Handle quoting of values in dict parameters 2015-07-27 12:31:05 -07:00
Reed Loden eb1fb41576 Add several DNS-related facts by parsing /etc/resolv.conf
Facts include nameservers, domain, search path, sortlist, and options.
2015-07-26 10:46:59 -07:00
Toshio Kuratomi 8ee3b7384d Guard the PROTOCOL setting so that we work on older pythons 2015-07-24 15:07:02 -07:00
Brian Coca 3bf1edfd96 Merge pull request #11591 from defionscode/boto3
Connection function for boto3
2015-07-23 15:54:28 -04:00
Toshio Kuratomi ddec06ccfe Detect the old python-json library
Fixes #11654
2015-07-20 12:35:26 -07:00
Toshio Kuratomi a0a6d12b05 Merge pull request #11603 from ansible/get_url-tls-compat
Have openssl autonegotiate tls protocol on python < 2.7.9
2015-07-20 09:43:59 -07:00
Brian Coca 03d7c8d7ca fixed new HPUX networking facts 2015-07-20 10:27:04 -04:00
Brian Coca 91f2acb029 Merge pull request #10203 from pdelared/devel
Add HP-UX network facts
2015-07-20 10:16:31 -04:00
Brian Coca 4f98fac494 Merge pull request #10914 from bcoca/non_posix_file_copy_fix
hack to prevent tempalte/copy errors on vagrant synced folders
2015-07-18 23:08:08 -04:00
Indrajit Raychaudhuri 4553a41ab5 Add homebrew to package managers' list 2015-07-18 19:46:26 -05:00
Jonathan Davila 6ea772931f Connection function for boto3
Boto3 conn
2015-07-15 16:52:01 -04:00
Toshio Kuratomi 3d3e1c82a2 Have openssl autonegotiate tls protocol on python < 2.7.9
This allows usage of tls-1.1 and tls-1.2 if the underlying openssl
library supports it.  Unfortunately it also allows sslv2 and sslv3 if
the server is only configured to support those.  In this day and age,
that's probably something that the server administrator should fix
anyhow.
2015-07-15 13:17:00 -07:00
Toshio Kuratomi 327b1676a8 Add support for SNI and TLS-1.1 and TLS-1.2 to the fetch_url() helper
Fixes #1716
Fixes #1695
2015-07-14 12:48:35 -07:00
Brian Coca 8793308c39 made md5 into generic checksum function that uses sha now 2015-07-14 07:28:32 -04:00
Iiro Uusitalo 4e7542af37 Merge upstream changes 2015-07-10 08:44:20 +03:00
Iiro Uusitalo 403f4881ee Enables 'basic auth force' -feature globally 2015-07-09 23:11:52 +03:00
Toshio Kuratomi dd058a1dc2 Fix required_if (needed to pass list to _count_terms) 2015-07-08 09:45:02 -07:00
Brian Coca 2c9d1257ba put type checking before looking against choices array to always get type comparrison correctly 2015-07-05 19:55:11 -04:00
Jon Hadfield 82e00b1022 add facts for datetime 8601 basic and basic short. 2015-07-05 17:23:22 +01:00
Spencer Krum 3887173c2c Use cfacter instead of facter if possible
CFacter is the facter replacement written in C++. It is available from
the puppetlabs repo.
2015-07-04 09:13:20 -07:00
verm666 d91947ee96 facts: add aliases to ansible_all_ipv4_addresses on OpenBSD 2015-07-02 15:36:56 +03:00
James Cammarata cf51d0a790 Fixing up some check-mode stuff 2015-07-01 15:10:25 -04:00
James Cammarata 7fa37870c8 Merge pull request #9683 from justinwyer/logical-block-size-and-sectors-9549
Disk size for advanced drives over 2 TB is incorrect
2015-07-01 14:14:04 -04:00
Toshio Kuratomi be6db1a730 Refactor the argspec type checking and add path as a type 2015-06-29 08:05:58 -07:00
Rene Moser 7952723530 cloudstack: fix domain name is not unique, use full path 2015-06-26 09:25:26 +02:00
Rene Moser b9b1e294d7 cloudstack: add get_or_failback() 2015-06-26 09:25:26 +02:00
Toshio Kuratomi 9911a947ed Vendorize match_hostname code so that ansible can push it out to clients along with the code that uses it. 2015-06-25 08:17:58 -07:00
Toshio Kuratomi 160e71e2cf Some flake8 cleanup 2015-06-25 07:13:37 -07:00
Toshio Kuratomi a1a7d6c462 Fix forwarding the user-given params from fetch_url() to open_url() 2015-06-23 15:17:26 -07:00
Dag Wieers 4ca4d36ae6 Change syslog (priority) level from LOG_NOTICE to LOG_INFO
If you look at the meaning of the different syslog levels, NOTICE means that the event may need someone to look at it. Whereas INFO is pure informational.

Since module invocations are in fact requested (deliberate) actions, they shouldn't need any additional post-processing, and therefore should not be logged as NOTICE.

This may seem like hairsplitting, but correctly categorizing system events helps weeding through the noise downhill.

According to Wikipedia: https://en.wikipedia.org/wiki/Syslog

5 	Notice 		notice 	Events that are unusual but not error conditions .
6 	Informational 	info 		Normal operational messages -no action required. Example an application has started, paused or ended successfully.
2015-06-18 11:00:10 +02:00
Brian Coca d7fcd9456a Merge pull request #11288 from kstrauser/aixfixes
Don't panic if AIX's uname doesn't support -W
2015-06-16 19:02:50 -04:00
Kirk Strauser eb820837ac Don't panic if AIX's uname doesn't support -W
The current code expects "uname -W" on AIX to always succeed. The AIX 5
instance I have doesn't support the -W flag and facts gathering always
crashes on it.

This skips some WPAR handling code if "uname -W" doesn't work.
2015-06-16 15:26:02 -07:00
Kirk Strauser 935da01068 Fixes for FreeBSD get_memory_facts
- swapinfo on FreeBSD 6 (maybe 7 too?) doesn't support the "-m" flag for
  fetching amounts in megabytes. This patch fetches amounts in kilobytes
  and divides by 1024 (and also returns the result as an int instead of
  a string).

- When no swap is configured, swapinfo prints a header line and nothing
  else:

    $ swapinfo
    Device         1K-blocks     Used    Avail Capacity

  The old version unexpectedly parsed that header line and emitted
  nonsense values like:

    "ansible_swapfree_mb": "Avail"
    "ansible_swaptotal_mb": "1K-blocks"

  This version emits those items altogether.
2015-06-16 14:35:36 -07:00
Toshio Kuratomi 4161d78a94 Split the fetch_url() function into fetch_url and open_url().
open_url() is suitable for use outside of a module environment.  Will
let us use open_url to do SSL cert verification in other, non-module
code.
2015-06-12 12:54:56 -07:00
Brian Coca f174682e19 facts should now not be overriten with NA option unless they are NA
this way we don't need a break per distro that matched already with
the python default functions
2015-06-11 00:48:40 -04:00
Brian Coca aa6e204b6e Merge pull request #11115 from jhawkesworth/second_go_at_fixing_1404
Part fix for https://github.com/ansible/ansible-modules-core/issues/1404 (replaces #11086)
2015-06-10 20:43:32 -04:00
Rene Moser 0b074c449b cloudstack: methods renaming 2015-06-10 17:31:46 +02:00
Rene Moser 7b3dd55c3d cloudstack: remove unused methods used for backward compatibility 2015-06-10 17:28:45 +02:00
Rene Moser fc3020c57a cloudstack: prevent getting the wrong project.
Since we use domain and account data to filter the project, listall is not needed and can return the wrong identical named project of another account if root admin permissions are used.

Fixed projects names are not case insensitive.
2015-06-09 16:16:58 +02:00
Etienne CARRIERE 94fa5e8794 Simplify Fully Qualified function 2015-06-03 21:19:11 +02:00
Etienne CARRIERE 5204d7ca88 Add common fonctions for F5 modules (FQ Name functions) 2015-06-03 08:20:26 +02:00
Rene Moser caf3cf6930 cloudstack: add timeout to utils 2015-06-02 14:51:25 +02:00
James Cammarata e547e1f9ba Merge branch 'devel' into devel_switch_v2 2015-06-01 16:53:15 -05:00
James Cammarata fe41f109a9 Merge branch 'v2_final' into devel_switch_v2 2015-06-01 16:42:59 -05:00
James Cammarata 4bc7703db3 Fixing some small bugs related to integration tests (v2) 2015-06-01 16:42:10 -05:00
Jon Hawkesworth 30b92a6f4c Get-FileChecksum allways returns a string now,
and the test_win_copy integration tests that depend on the checksum
have been updated in this change too.
2015-06-01 21:53:49 +01:00
sysadmin75 d2db7bad1b Fixes OSX fact gathering for the bridge interface. Issue #11104 2015-06-01 13:23:28 -04:00
Brian Coca 9a90ca5a36 Merge pull request #11062 from Etienne-Carriere/factor_f5
Factor primitives for F5 modules
2015-06-01 10:34:11 -04:00
sysadmin75 816b20af0b Fixes #11046 2015-06-01 10:24:20 -04:00
sysadmin75 908d6c0ef2 Fixes #11046 2015-05-31 20:05:02 -04:00
Brian Coca 7e020d21de correctly identify ubuntu now in all cases
made NA the last resort
2015-05-29 16:19:09 -04:00
Brian Coca a8c290cc3b fixed ubuntu facts for all versions
made sure NA is option of last resort
2015-05-29 16:14:30 -04:00
Monty Taylor b659621575 Remove unneeded required_one_of for openstack
We're being too strict - there is a third possibility, which is that a
user will have defined the OS_* environment variables and expect them to
pass through.
2015-05-29 13:09:45 -07:00
Toshio Kuratomi 2924c90a5d Merge pull request #10977 from emonty/fix-envvars
Fix envvars support in openstack modules
2015-05-29 13:05:03 -07:00
Jon Hawkesworth 12691ce109 Add -Compress to ConvertTo-Json calls in common powershell code 2015-05-29 10:40:24 -04:00
Jon Hawkesworth 9371c38af9 Add -Compress to ConvertTo-Json calls in common powershell code 2015-05-29 14:50:08 +01:00
Stefan Midjich e5190327f2 this fixes ansible on openbsd and freebsd systems. only tested on openbsd. 2015-05-28 19:17:31 -04:00
James Cammarata 60bea844b3 Merge branch 'v2_final' into devel_switch_v2 2015-05-28 15:27:09 -05:00
James Cammarata 2bad888f28 Merge branch 'v2_final' into devel_switch_v2
Conflicts:
	lib/ansible/inventory/__init__.py
	lib/ansible/modules/core
	lib/ansible/utils/__init__.py
	lib/ansible/utils/module_docs.py
2015-05-28 15:26:03 -05:00
Toshio Kuratomi afc19894e1 Make fetch_url check the server's certificate on https connections 2015-05-28 13:20:40 -07:00
Toshio Kuratomi 1ccf2a4685 Make fetch_url check the server's certificate on https connections 2015-05-28 12:35:37 -07:00
James Cammarata e59d4f3b51 More module_utils/basic.py unit tests for v2 2015-05-28 01:26:04 -05:00
James Cammarata 339a02c384 Started reworking module_utils/basic unit tests (v2) 2015-05-27 03:21:15 -05:00
Toshio Kuratomi d793ed360b Fix syntaxerror in the required_if arg spec check 2015-05-26 11:30:06 -07:00
Toshio Kuratomi 0f23d8a503 Fix syntaxerror in the required_if arg spec check 2015-05-26 11:29:35 -07:00
Monty Taylor 31609e1b16 Add required_if to AnsibleModule
There is a common pattern in modules where some parameters are required
only if another parameter is present AND set to a particular value. For
instance, if a cloud server state is "present" it's important to
indicate the image to be used, but if it's "absent", the image that was
used to launch it is not necessary. Provide a check that takes as an
input a list of 3-element tuples containing parameter to depend on, the
value it should be set to, and a list of parameters which are required
if the required parameter is set to the required value.
2015-05-26 11:21:38 -07:00
Toshio Kuratomi c6b286424f Merge pull request #9423 from emonty/features/required-if
Add required_if to AnsibleModule
2015-05-26 11:20:40 -07:00
Stefan Midjich 540c23dfce this fixes ansible on openbsd and freebsd systems. only tested on openbsd. 2015-05-26 12:04:35 -04:00
Brian Coca 16c70dd7d4 added equivalent of #9636 to v2 2015-05-26 11:55:52 -04:00
Brian Coca 6000db7e5d Merge pull request #9636 from Batmat/fix-message-i18n-parsing-error
Setting LC_MESSAGES: prevent unparseable messages (fixes issue #9635)
2015-05-26 11:49:56 -04:00
Etienne CARRIERE 3775dd5ec8 Factor F5 primitives 2015-05-25 09:53:23 +02:00
Toshio Kuratomi bb81f025b0 Merge pull request #8679 from j0057/support-arch-8653
Add support for Arch to module_utils.basic.py
2015-05-20 22:57:54 -07:00
Rene Moser 8da580a29c basic: fix ValueError if value of a type='int' is not an int
With this fix, we get a friendly error message:

    failed: [localhost] => {"failed": true}
    msg: value of argument start_port is not of type int and we were unable to automatically convert
2015-05-19 11:51:56 -04:00
Rene Moser 8f29ca23ae basic: fix ValueError if value of a type='int' is not an int
With this fix, we get a friendly error message:

    failed: [localhost] => {"failed": true}
    msg: value of argument start_port is not of type int and we were unable to automatically convert
2015-05-19 17:40:46 +02:00
Till Maas 02d784598f facts: Simplify ssh key fetching 2015-05-15 22:36:13 +02:00
Till Maas e7846343e5 facts: Add ed25519 ssh pubkey 2015-05-15 22:25:20 +02:00
Brian Coca 0913b8263c made special treatment of certain filesystem for selinux configurable 2015-05-15 13:52:27 -04:00
Brian Coca e2de336a23 made special treatment of certain filesystem for selinux configurable 2015-05-15 13:19:15 -04:00
Vitaliy Okulov 0c305b72cd Fix align again, strange vim error. ansible/ansible#10917 2015-05-11 14:33:50 +00:00
Monty Taylor d2782f0d84 Remove unneeded required_one_of for openstack
We're being too strict - there is a third possibility, which is that a
user will have defined the OS_* environment variables and expect them to
pass through.
2015-05-11 08:06:21 -04:00
Vitaliy Okulov 31b0ffafa8 Align fix for ansible/ansible#10917 2015-05-10 14:43:36 +00:00
Vitaliy Okulov ad9981f565 Fix for ansible/ansible#10917
Add missing broadcast addr for network facts for Linux
2015-05-10 14:37:46 +00:00
Rene Moser 62ccc1b9b6 cloudstack: fix typo in variable, fixes get_domain() 2015-05-08 16:42:07 +02:00
Brian Coca 483c61414e added missing : 2015-05-04 18:42:44 -04:00
Brian Coca 013c4631e3 hack to prevent tempalte/copy errors on vagrant synced folders that report incorrectly errno 26
fixes #9526
2015-05-04 18:37:38 -04:00
James Cammarata 8f504dacdd Merge branch 'devel' into v2_final
Conflicts:
	lib/ansible/modules/core
	v2/ansible/modules/core
	v2/ansible/modules/extras
2015-05-04 16:35:11 -05:00
Brian Coca 795a45fa4a Merge pull request #10833 from resmo/feature/extend_cloudstack_utils
cloudstack: extend and fix cloudstack utils
2015-05-04 10:49:57 -04:00
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00
Rene Moser 333c623b35 cloudstack: implement account und domain support in utils 2015-05-03 14:59:44 +02:00
Rene Moser af74d7f1a9 cloudstack: add get_domain() and get_account() to utils 2015-05-03 14:34:25 +02:00
Rene Moser 034ac8ae78 cloudstack: _has_changed() should not compare None values 2015-05-01 17:25:06 +02:00
Simon Dick 6e65ccabc3 Allow the use of HTTP on custom ports in the fetch_url function 2015-05-01 13:52:29 +01:00
Brian Coca 4e85419257 Merge pull request #10853 from cgar/spelling
just a few spelling error changes

I swear only 95% of those are mine!
2015-04-30 09:02:09 -04:00
Rene Moser b11cd73df1 cloudstack: add tag support in utils 2015-04-29 21:06:58 +02:00
Brian Coca 6a8062baad accidentally 'fixes' ubuntu distribution parsing, this order should not matter, need followup to figure out why this is the case 2015-04-28 10:16:14 -04:00
Carlos E. Garcia cfbfd38723 just a few spelling error changes 2015-04-28 09:36:42 -04:00
Rene Moser 2f255f5b96 cloudstack: get_vm(): fix missing zone
Fixes returning wrong VM having identical name in different zone.
2015-04-26 23:09:33 +02:00
Rene Moser ca88189bf7 cloudstack: add method to to get infos of API
get_capabilities() allows you to get infos e.g. `cloudstackversion`
to compare functionality of the API in your modules.
2015-04-25 18:32:02 +02:00
Rene Moser 3c0e406f5d cloudstack: fix missing self. in cloudstack utils 2015-04-24 20:25:19 +02:00
Rene Moser 6354ca0718 cloudstack: add _has_changed() to utils
Generic method to compare values in dict.
2015-04-24 19:16:42 +02:00
Rene Moser 765c8fe368 cloudstack: use _get_by_key in get_...() methods in utils
But also add backward compatibility for existing modules in extras.
2015-04-24 19:09:49 +02:00
Rene Moser 88540d3cdc cloudstack: add _get_by_key() to utils
Generic method to get the whole dict or just a singe value by key if found.
2015-04-24 19:06:33 +02:00
Rene Moser 31520cdd17 cloudstack: fix other projects not found 2015-04-24 18:58:57 +02:00
Joseph Callen 87bc705806 Fixes VMware module utils
Resolves syntax errors in the `wait_for_tasks`
Removes throw from `find_datacenter_by_name`
2015-04-22 14:54:05 -04:00
Brian Coca a1ddeaebe9 Merge pull request #10760 from jcpowermac/add_vmware_module_utils
Adding a new VMware utilities module
2015-04-21 20:41:51 -04:00
Joseph Callen 9b317858c1 Modified per @bcoca
Removed try/except raises
Modified wait_for_task
Added api exception error message
2015-04-21 08:33:32 -04:00
Brian Coca 2a59f27db4 Merge pull request #10789 from mavit/oracle_linux_os_family
Consistently use "OracleLinux" in OS detection.
2015-04-20 18:50:57 -04:00
Rene Moser 822c2c0cd3 cloudstack: fix vm not found by displayname 2015-04-20 09:40:49 -05:00
Rene Moser 0a26b149fc cloudstack: add error result handling in async job 2015-04-20 09:40:49 -05:00
Peter Oliver d8be6fec65 Consistently use "OracleLinux" in OS detection.
Previously, a mixture of "OracleLinux" and "Oracle Linux" was used,
causing the `ansible_os_family` fact not to be set to `RedHat`.

Fixes #10742.
2015-04-19 17:00:35 +01:00
Joseph Callen 986910be5d Adding a new VMware utilities module 2015-04-17 14:48:57 -04:00
Brian Coca 65be14e8b4 Merge pull request #10757 from jeffrizzo/netbsd_facts
Set distribution, release, and version for NetBSD.
2015-04-17 13:51:45 -04:00
Brian Coca 2e9c028c6c Merge pull request #10747 from bcoca/fix_lsblk_missing
adjusted for the posibolity of lsblk not existing for fact gathering
2015-04-17 11:12:29 -04:00
Jeff Rizzo 5c64956a7e Set distribution, release, and version for NetBSD. 2015-04-16 16:43:38 -07:00
Simon Gomizelj a0c34da779 Support querying systemd container information
systemd writes a /run/systemd/container file in any container it starts
to make it really easy to detect the container type. This adds support
for detecting systemd-nspawn containers (and any other container format
that will write data there for compatibility).
2015-04-16 14:27:50 -04:00
Toshio Kuratomi 3075a4db25 Merge pull request #10734 from ralphbean/devel
Remove check of hardcoded AWS region list.
2015-04-16 11:06:16 -07:00
Michael Scherer b4f02625cd Add CoreOS facts detection, fix https://github.com/ansible/ansible-modules-core/issues/1000 2015-04-16 13:04:23 -04:00
Brian Coca ec01e071d8 adjusted for the posibolity of lsblk not existing for fact gathering 2015-04-16 11:57:51 -04:00
Ralph Bean 4903bca0c1 Remove check of hardcoded AWS region list.
You can extend boto to point at other regions that are defined in a
private cloud by defining ``BOTO_ENDPOINTS`` or ``endpoints_path`` in
the ``~/.boto`` file.

Ansible was doing a premature check against a hard-coded list of regions
that interrupted this possibility.  This commit removes that and
clarifies what the user can do if they specify a non-AWS region.
2015-04-15 17:55:27 -04:00
Michael Scherer f624ec4cb8 Prefer dnf to yum.
On Fedora 22 and later, yum is deprecated and dnf is installed by
default. However, the detection do not seems to take this in account,
and always use yum, even when yum cli is just a wrapper to tell "use
dnf", as this is the case on F22 and later ( see package dnf-yum ).

As dnf is not installed by default, except on F22, this shouldn't
break anything.
2015-04-15 16:11:08 -04:00
Brian Coca 62c08d96e5 fixed another typo 2015-04-13 10:58:17 -04:00
Brian Coca 89cc54cc16 typo fix 2015-04-13 10:50:24 -04:00
Brian Coca b509de6c84 Merge pull request #10643 from bcoca/aix_facts_fix
fix for when calling bootinfo throws permmission errors (AIX)
2015-04-13 10:22:38 -04:00
Brian Coca 1c796543c9 fix for when calling bootinfo throws permmission errors (AIX)
fixes https://github.com/ansible/ansible-modules-core/issues/1108
2015-04-08 03:30:21 -04:00
Brian Coca faadb68308 backup_local now only tries to back up exising files, returns '' otherwise 2015-04-06 23:37:32 -04:00
Jason DeTiberus 43775daa4b Fix indentation 2015-04-06 16:47:52 -04:00
Joost Molenaar e79c920260 Add support for Arch to module_utils.basic.py
Fixes ansible/ansible#8653
2015-04-06 11:02:40 +02:00
Brian Coca 02b03cfdf5 Merge pull request #10593 from bcoca/backup_ioerror
capture IOErrors on backup_local (happens on non posix filesystems)
2015-04-02 15:55:20 -04:00