Commit Graph

662 Commits (add3a2a2dac464195e396c12a0fdf121cf95e00c)

Author SHA1 Message Date
Rene Moser 3410a855b0 cloudstack: use jop polling in tag handling, fixes outdated tags returned.
In some cases the async job did not finish fast enough, causing returning an unexpeded result.
10 years ago
Alexander Gubin 215fc12234 Add SLES_SAP as a Suse family 10 years ago
Toshio Kuratomi 9ce3adbeb1 remove assigned but unused variables in module_utils.
These were mostly saving exceptions but not using them.  Getting rid of
those will help with eventually running modules via either python2.4 or
python3.x.
10 years ago
Toshio Kuratomi c08648999d Remove some more unused stdlib deps. 10 years ago
Eric Johnson dfad7c64fb Allow PATCH to list of valid HTTP methods 10 years ago
Brian Coca 8d3da20302 fixed bsd service_mgr_facts using removed check_init fucntion 10 years ago
Brian Coca eb04650ffb Merge pull request #12162 from bcoca/service_mgr_facts
fact gathering service_mgr info
10 years ago
Brian Coca a1a5dadef6 remove uneeded module 10 years ago
Toshio Kuratomi 3219744d32 One more stdlib import in module_utils 10 years ago
Brian Coca d194e2c788 check_systemd is not inline but a private fact function now 10 years ago
Brian Coca e9efd008ed moved distutils import to mac, darn solaris would complain in certain cases 10 years ago
Brian Coca 99d775a0c1 fact gathering service_mgr info
also added dragonfly facts support
10 years ago
Toshio Kuratomi 1bc75374dc Add imports for stdlib modules that are used.
This is cleanup that will aid us when we get ziploader implemented for 2.1
10 years ago
Rene Moser c09a34bb10 cloudstack: clean up unneeded ";" 10 years ago
Brian Coca f528ad1848 added xbps pkg mgr to facts 10 years ago
James Cammarata 0e447e3f41 Merge branch 'devel' of https://github.com/mathieumd/ansible into mathieumd-devel 10 years ago
Toshio Kuratomi 6e5055e786 Update the use of no_log values to cover everything that heuristic_log_sanitize does.
Fixes #12792
10 years ago
gduke 744679601f Remove mutable default arguments. 10 years ago
Toshio Kuratomi c2d188baff Hide values in json returns which were given in parameters marked no_log. 10 years ago
Mathieu 260a3e5ce7 Fixes #11055 - Set locale via LC_ALL 10 years ago
Toshio Kuratomi 28c933ce5e properly fail_json when we don't have ssl on a non-redhat distro 10 years ago
Brian Coca c57200925f made syslog import optional as intel's edison custom compiles python w/o it 10 years ago
Toshio Kuratomi 15d7f53846 AnsibleModules.log() fix for python3
Also add unittests for AnsibleModules.log()

Fixes #12586
10 years ago
Charles Paul 3d533cb423 fixing calls to fail_json 10 years ago
Brian Coca 50372eecc9 Merge pull request #12455 from privateip/devel
added methods for retrieving vapp and vm
10 years ago
Brian Coca ec02b255c3 Merge pull request #12689 from soarpenguin/bugfix
Remove some warning of undefined name and fix classmethod syntax error.
10 years ago
Shayne Clausson 55b3f9e4e5 Use AWS_DEFAULT_REGION env var if none specified 10 years ago
soarpenguin 5efa4d29e3 fix some warning of undefined name. 10 years ago
= 345ce424c6 Explictly set the version of strict mode to use for powershell modules. 10 years ago
Peter Sprygada ab3239ecd7 added methods for retrieving vapp and vm 10 years ago
Brian Coca 1a56a5c442 created debug method, renamed debug attribute to _debug 10 years ago
Toshio Kuratomi 4cfcf5d61b Merge pull request #12568 from mgedmin/py3k
Python 3: fix most tests for ansible.module_utils.basic
10 years ago
Trond Hindenes 94cfbe7ee9 Get-AnsibleParam 10 years ago
Marius Gedminas cc1e1648f5 Tweak comment style 10 years ago
Marius Gedminas 213029a21e Python 3: don't convert unicode to unicode 10 years ago
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.)
10 years ago
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'
10 years ago
Brian Coca ddafed4403 Merge pull request #12528 from bcoca/task_logging
task logging revamp
10 years ago
Brian Coca 7b64126c9d pushed up openvz detection for cases of 'stacked' virtualization 10 years ago
Linus Unnebäck 45f9800754 facts: correctly detect docker inside a xen host 10 years ago
Konstantin Manna 4226e49bc6 bugfix: statement had no effect => statement now has assumed effect 10 years ago
Brian Coca 8d024c3747 Merge pull request #12472 from resmo/for_ansible
cloudstack: improvements and tests
10 years ago
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
10 years ago
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
10 years ago
Brian Coca 191ae0831d fixed syntax error 10 years ago
Brian Coca 48412c13b2 fixed copy n paste typo on future code 10 years ago
Brian Coca 1c49e3b842 draft shared service code for modules, part of spliting service module 10 years ago
Toshio Kuratomi dcdcd9e9c5 Move is_executable to the toplevel of basic.py so we can utilize it from other code 10 years ago
Gerben Geijteman 4c20964475 Add Weekday (0-6) as a number and add weeknumber (00-52) 10 years ago
Marius Gedminas 2c4982b58d Python 3: there's no itertools.imap
Because the builtin map() acts like an iterator already.
10 years ago
Marius Gedminas 6708d56a21 Python 3: avoid long integer literals
Even Python 2.4 automatically promotes int to long.
10 years ago
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.
10 years ago
Marius Gedminas e71a986e16 Python 3: avoid octal constants in module_utils/basic.py 10 years ago
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.
10 years ago
Rene Moser b43939dfd6 cloudstack: make tags handling idempotence
Credits to @jeffersongirao, who provided the patch.
10 years ago
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,
10 years ago
Rene Moser c9a3801a25 cloudstack: common argument_spec and requried_together to utils 10 years ago
Brian Coca d27b73e7b5 fixed case in which boto3 is present but module is not using it yet 10 years ago
Peter Sprygada e45b71d6cd added new module object to vca 10 years ago
Brian Coca aca83b15e5 Merge pull request #12425 from privateip/devel
initial add of vca common module
10 years ago
Brian Coca 11707576a3 fix for AIX network facts
fixes #12434
10 years ago
Brian Coca d7b61db6dc made boto3 non mandatory 10 years ago
Peter Sprygada 8f43d222c0 initial add of vca common module 10 years ago
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.
10 years ago
Monty Taylor 3bdd6793ca Add no-log parameter to common openstack args
These bad boys can contain secret data, so should be marked no-log.
10 years ago
Benno Joy 6de13c3062 Merge pull request #11818 from Java1Guy/module_utils_ec2_for_ecs
change ec2 util to create only requested objects
10 years ago
Toshaan Bharvani 4702d2be09 added Manjaro as an Archlinux family 10 years ago
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
10 years ago
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.
10 years ago
James Cammarata 2043fcd5db Merge pull request #12083 from resmo/for-ansible
cloudstack: implement general api_region support, update docs
10 years ago
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.
10 years ago
Rene Moser 3db4039ad1 cloudstack: implement general api_region support, update docs 10 years ago
James Cammarata db65503778 Revert "Add PowerShell exception handling and turn on strict mode." 10 years ago
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.
10 years ago
Rene Moser d16429b59c cloudstack: rename returns for consistency 10 years ago
Rene Moser 2913d2b44d cloudstack: add more common returns 10 years ago
Brian Coca c6733cc1a7 Merge pull request #9225 from qvicksilver/aix_unprivileged
AIX unprivileged facts collection
10 years ago
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
10 years ago
Brian Coca 6bceee9a93 now lvs/vg facts are only attempted if binary found 10 years ago
Alexander Gubin 1ea1b9fb13 bugfix: missing path for lvm facts 10 years ago
Brian Coca ae9d264b86 Merge pull request #11762 from amenonsen/9795-rebase
Add LVM facts to setup module
10 years ago
Rene Moser e62fbf5fba cloudstack: add get_result() in utils to return common results 10 years ago
Toshio Kuratomi 00b1a2c865 Restore ValueError in md5 method and change finding the available hash algorithms so we only have to do it once 11 years ago
Toshio Kuratomi 80cb69214b Merge pull request #11840 from muffl0n/module_utils_hash_algorithms
Add get_available_hash_algorithms()
11 years ago
Brian Coca 08e6c1d82b avoid possible errors with new broadcast handling in linux 11 years ago
Brian Coca 262c75c253 Merge pull request #10971 from mightydok/debbraoadcastfix
Add missed broadcast address to linux network facts.
11 years ago
Brian Coca 2b9b3a08a1 make sure you only update pci data if there is a match 11 years ago
muffl0n 8d6d711a5c move get_available_hash_algorithms() from get_url 11 years ago
James Cammarata 13b8a57d3d Undo previous travis/tox fixes and fix underlying issue 11 years ago
Chris Church 74df17de29 Add an option for PowerShell modules to indicate support for check mode, skip running module if check mode is not supported. 11 years ago
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.
11 years ago
Mark Chance 437d4deffc change ec2 util to create only requested objects 11 years ago
Jonathan Süssemilch Poulain 02294c52ce Typo 11 years ago
Jonathan Süssemilch Poulain 4614a574ea Allows network network interface facts collection as an unprivileged user and adds more facts 11 years ago
Jonathan Süssemilch Poulain e181bcf62b Allows to fetch machine architecture as an unprivileged user 11 years ago
Brian Coca b37be236d9 Merge pull request #11475 from nibalizer/cfacter_support
Use cfacter instead of facter if possible
11 years ago
Brian Coca 527ae360b0 Merge pull request #10652 from vodik/nspawn
Support querying systemd container information
11 years ago
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
11 years ago
Brian Coca 80ecab5317 Merge pull request #11761 from amenonsen/9843-rebase
Add pciid to LinuxNetwork interface fact
11 years ago
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
}
11 years ago