Commit Graph

926 Commits (1aa39ae78bc0c3cbb36e2ee6dfa658b98e17024c)

Author SHA1 Message Date
muffl0n 8d6d711a5c move get_available_hash_algorithms() from get_url 10 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
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
11 years ago
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
}
11 years ago
Brian Coca 8746e692c1 changed check to allow for powerpc
fixes #11528
11 years ago
Toshio Kuratomi d2346fd2e2 Python2.4 compat fix 11 years ago
Toshio Kuratomi 6a68be4e28 Handle quoting of values in dict parameters 11 years ago
Reed Loden eb1fb41576 Add several DNS-related facts by parsing /etc/resolv.conf
Facts include nameservers, domain, search path, sortlist, and options.
11 years ago
Toshio Kuratomi 8ee3b7384d Guard the PROTOCOL setting so that we work on older pythons 11 years ago
Brian Coca 3bf1edfd96 Merge pull request #11591 from defionscode/boto3
Connection function for boto3
11 years ago
Toshio Kuratomi ddec06ccfe Detect the old python-json library
Fixes #11654
11 years ago
Toshio Kuratomi a0a6d12b05 Merge pull request #11603 from ansible/get_url-tls-compat
Have openssl autonegotiate tls protocol on python < 2.7.9
11 years ago
Brian Coca 03d7c8d7ca fixed new HPUX networking facts 11 years ago
Brian Coca 91f2acb029 Merge pull request #10203 from pdelared/devel
Add HP-UX network facts
11 years ago
Brian Coca 4f98fac494 Merge pull request #10914 from bcoca/non_posix_file_copy_fix
hack to prevent tempalte/copy errors on vagrant synced folders
11 years ago
Indrajit Raychaudhuri 4553a41ab5 Add homebrew to package managers' list 11 years ago
Jonathan Davila 6ea772931f Connection function for boto3
Boto3 conn
11 years ago
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.
11 years ago
Toshio Kuratomi 327b1676a8 Add support for SNI and TLS-1.1 and TLS-1.2 to the fetch_url() helper
Fixes #1716
Fixes #1695
11 years ago
Brian Coca 8793308c39 made md5 into generic checksum function that uses sha now 11 years ago
Iiro Uusitalo 4e7542af37 Merge upstream changes 11 years ago
Iiro Uusitalo 403f4881ee Enables 'basic auth force' -feature globally 11 years ago
Toshio Kuratomi dd058a1dc2 Fix required_if (needed to pass list to _count_terms) 11 years ago
Brian Coca 2c9d1257ba put type checking before looking against choices array to always get type comparrison correctly 11 years ago
Jon Hadfield 82e00b1022 add facts for datetime 8601 basic and basic short. 11 years ago
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.
11 years ago
verm666 d91947ee96 facts: add aliases to ansible_all_ipv4_addresses on OpenBSD 11 years ago
James Cammarata cf51d0a790 Fixing up some check-mode stuff 11 years ago
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
11 years ago
Toshio Kuratomi be6db1a730 Refactor the argspec type checking and add path as a type 11 years ago
Rene Moser 7952723530 cloudstack: fix domain name is not unique, use full path 11 years ago
Rene Moser b9b1e294d7 cloudstack: add get_or_failback() 11 years ago
Toshio Kuratomi 9911a947ed Vendorize match_hostname code so that ansible can push it out to clients along with the code that uses it. 11 years ago
Toshio Kuratomi 160e71e2cf Some flake8 cleanup 11 years ago
Toshio Kuratomi a1a7d6c462 Fix forwarding the user-given params from fetch_url() to open_url() 11 years ago
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.
11 years ago
Brian Coca d7fcd9456a Merge pull request #11288 from kstrauser/aixfixes
Don't panic if AIX's uname doesn't support -W
11 years ago
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.
11 years ago
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.
11 years ago
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.
11 years ago
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
11 years ago
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)
11 years ago
Rene Moser 0b074c449b cloudstack: methods renaming 11 years ago
Rene Moser 7b3dd55c3d cloudstack: remove unused methods used for backward compatibility 11 years ago
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.
11 years ago
Etienne CARRIERE 94fa5e8794 Simplify Fully Qualified function 11 years ago
Etienne CARRIERE 5204d7ca88 Add common fonctions for F5 modules (FQ Name functions) 11 years ago
Rene Moser caf3cf6930 cloudstack: add timeout to utils 11 years ago
James Cammarata e547e1f9ba Merge branch 'devel' into devel_switch_v2 11 years ago
James Cammarata fe41f109a9 Merge branch 'v2_final' into devel_switch_v2 11 years ago
James Cammarata 4bc7703db3 Fixing some small bugs related to integration tests (v2) 11 years ago
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.
11 years ago
sysadmin75 d2db7bad1b Fixes OSX fact gathering for the bridge interface. Issue #11104 11 years ago
Brian Coca 9a90ca5a36 Merge pull request #11062 from Etienne-Carriere/factor_f5
Factor primitives for F5 modules
11 years ago
sysadmin75 816b20af0b Fixes #11046 11 years ago
sysadmin75 908d6c0ef2 Fixes #11046 11 years ago
Brian Coca 7e020d21de correctly identify ubuntu now in all cases
made NA the last resort
11 years ago
Brian Coca a8c290cc3b fixed ubuntu facts for all versions
made sure NA is option of last resort
11 years ago
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.
11 years ago
Toshio Kuratomi 2924c90a5d Merge pull request #10977 from emonty/fix-envvars
Fix envvars support in openstack modules
11 years ago
Jon Hawkesworth 12691ce109 Add -Compress to ConvertTo-Json calls in common powershell code 11 years ago
Jon Hawkesworth 9371c38af9 Add -Compress to ConvertTo-Json calls in common powershell code 11 years ago
Stefan Midjich e5190327f2 this fixes ansible on openbsd and freebsd systems. only tested on openbsd. 11 years ago
James Cammarata 60bea844b3 Merge branch 'v2_final' into devel_switch_v2 11 years ago
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
11 years ago
Toshio Kuratomi afc19894e1 Make fetch_url check the server's certificate on https connections 11 years ago
Toshio Kuratomi 1ccf2a4685 Make fetch_url check the server's certificate on https connections 11 years ago
James Cammarata e59d4f3b51 More module_utils/basic.py unit tests for v2 11 years ago
James Cammarata 339a02c384 Started reworking module_utils/basic unit tests (v2) 11 years ago
Toshio Kuratomi d793ed360b Fix syntaxerror in the required_if arg spec check 11 years ago
Toshio Kuratomi 0f23d8a503 Fix syntaxerror in the required_if arg spec check 11 years ago
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.
11 years ago
Toshio Kuratomi c6b286424f Merge pull request #9423 from emonty/features/required-if
Add required_if to AnsibleModule
11 years ago
Stefan Midjich 540c23dfce this fixes ansible on openbsd and freebsd systems. only tested on openbsd. 11 years ago
Brian Coca 16c70dd7d4 added equivalent of #9636 to v2 11 years ago
Brian Coca 6000db7e5d Merge pull request #9636 from Batmat/fix-message-i18n-parsing-error
Setting LC_MESSAGES: prevent unparseable messages (fixes issue #9635)
11 years ago
Etienne CARRIERE 3775dd5ec8 Factor F5 primitives 11 years ago
Toshio Kuratomi bb81f025b0 Merge pull request #8679 from j0057/support-arch-8653
Add support for Arch to module_utils.basic.py
11 years ago
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
11 years ago
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
11 years ago
Till Maas 02d784598f facts: Simplify ssh key fetching 11 years ago
Till Maas e7846343e5 facts: Add ed25519 ssh pubkey 11 years ago
Brian Coca 0913b8263c made special treatment of certain filesystem for selinux configurable 11 years ago
Brian Coca e2de336a23 made special treatment of certain filesystem for selinux configurable 11 years ago
Vitaliy Okulov 0c305b72cd Fix align again, strange vim error. ansible/ansible#10917 11 years ago
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.
11 years ago
Vitaliy Okulov 31b0ffafa8 Align fix for ansible/ansible#10917 11 years ago
Vitaliy Okulov ad9981f565 Fix for ansible/ansible#10917
Add missing broadcast addr for network facts for Linux
11 years ago
Rene Moser 62ccc1b9b6 cloudstack: fix typo in variable, fixes get_domain() 11 years ago
Brian Coca 483c61414e added missing : 11 years ago
Brian Coca 013c4631e3 hack to prevent tempalte/copy errors on vagrant synced folders that report incorrectly errno 26
fixes #9526
11 years ago
James Cammarata 8f504dacdd Merge branch 'devel' into v2_final
Conflicts:
	lib/ansible/modules/core
	v2/ansible/modules/core
	v2/ansible/modules/extras
11 years ago
Brian Coca 795a45fa4a Merge pull request #10833 from resmo/feature/extend_cloudstack_utils
cloudstack: extend and fix cloudstack utils
11 years ago
James Cammarata ce3ef7f4c1 Making the switch to v2 11 years ago
Rene Moser 333c623b35 cloudstack: implement account und domain support in utils 11 years ago
Rene Moser af74d7f1a9 cloudstack: add get_domain() and get_account() to utils 11 years ago
Rene Moser 034ac8ae78 cloudstack: _has_changed() should not compare None values 11 years ago
Simon Dick 6e65ccabc3 Allow the use of HTTP on custom ports in the fetch_url function 11 years ago
Brian Coca 4e85419257 Merge pull request #10853 from cgar/spelling
just a few spelling error changes

I swear only 95% of those are mine!
11 years ago
Rene Moser b11cd73df1 cloudstack: add tag support in utils 11 years ago
Brian Coca 6a8062baad accidentally 'fixes' ubuntu distribution parsing, this order should not matter, need followup to figure out why this is the case 11 years ago
Carlos E. Garcia cfbfd38723 just a few spelling error changes 11 years ago
Rene Moser 2f255f5b96 cloudstack: get_vm(): fix missing zone
Fixes returning wrong VM having identical name in different zone.
11 years ago
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.
11 years ago
Rene Moser 3c0e406f5d cloudstack: fix missing self. in cloudstack utils 11 years ago
Rene Moser 6354ca0718 cloudstack: add _has_changed() to utils
Generic method to compare values in dict.
11 years ago
Rene Moser 765c8fe368 cloudstack: use _get_by_key in get_...() methods in utils
But also add backward compatibility for existing modules in extras.
11 years ago
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.
11 years ago
Rene Moser 31520cdd17 cloudstack: fix other projects not found 11 years ago
Joseph Callen 87bc705806 Fixes VMware module utils
Resolves syntax errors in the `wait_for_tasks`
Removes throw from `find_datacenter_by_name`
11 years ago
Brian Coca a1ddeaebe9 Merge pull request #10760 from jcpowermac/add_vmware_module_utils
Adding a new VMware utilities module
11 years ago
Joseph Callen 9b317858c1 Modified per @bcoca
Removed try/except raises
Modified wait_for_task
Added api exception error message
11 years ago
Brian Coca 2a59f27db4 Merge pull request #10789 from mavit/oracle_linux_os_family
Consistently use "OracleLinux" in OS detection.
11 years ago
Rene Moser 822c2c0cd3 cloudstack: fix vm not found by displayname 11 years ago
Rene Moser 0a26b149fc cloudstack: add error result handling in async job 11 years ago
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.
11 years ago
Joseph Callen 986910be5d Adding a new VMware utilities module 11 years ago
Brian Coca 65be14e8b4 Merge pull request #10757 from jeffrizzo/netbsd_facts
Set distribution, release, and version for NetBSD.
11 years ago
Brian Coca 2e9c028c6c Merge pull request #10747 from bcoca/fix_lsblk_missing
adjusted for the posibolity of lsblk not existing for fact gathering
11 years ago
Jeff Rizzo 5c64956a7e Set distribution, release, and version for NetBSD. 11 years ago
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).
11 years ago
Toshio Kuratomi 3075a4db25 Merge pull request #10734 from ralphbean/devel
Remove check of hardcoded AWS region list.
11 years ago
Michael Scherer b4f02625cd Add CoreOS facts detection, fix https://github.com/ansible/ansible-modules-core/issues/1000 11 years ago
Brian Coca ec01e071d8 adjusted for the posibolity of lsblk not existing for fact gathering 11 years ago
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.
11 years ago
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.
11 years ago
Brian Coca 62c08d96e5 fixed another typo 11 years ago
Brian Coca 89cc54cc16 typo fix 11 years ago
Brian Coca b509de6c84 Merge pull request #10643 from bcoca/aix_facts_fix
fix for when calling bootinfo throws permmission errors (AIX)
11 years ago
Brian Coca 1c796543c9 fix for when calling bootinfo throws permmission errors (AIX)
fixes https://github.com/ansible/ansible-modules-core/issues/1108
11 years ago
Brian Coca faadb68308 backup_local now only tries to back up exising files, returns '' otherwise 11 years ago
Jason DeTiberus 43775daa4b Fix indentation 11 years ago
Joost Molenaar e79c920260 Add support for Arch to module_utils.basic.py
Fixes ansible/ansible#8653
11 years ago
Brian Coca 02b03cfdf5 Merge pull request #10593 from bcoca/backup_ioerror
capture IOErrors on backup_local (happens on non posix filesystems)
11 years ago
Brian Coca 4dd233b0dd Merge pull request #10237 from emonty/remove-auth-token
Remove auth token and port openstack module_utils changes to v2 tree
11 years ago
Brian Coca 1fa3dbb7d2 capture IOErrors on backup_local (happens on non posix filesystems)
fixes #10591
11 years ago
Monty Taylor 87c99b4675 Align verify parameter with validate_certs
The rest of ansible uses validate_certs, so make that the main
documented parameter. However, leave verify as an alias since that's the
passthrough value to the underlying libraries.
11 years ago
Monty Taylor 90ca386555 Add api timeout now that shade spports it everywhere 11 years ago
Brian Coca 299314c6b6 Merge pull request #10545 from resmo/feature/cloudstack-utils
cloudstack: common code used in cloudstack modules
11 years ago
Brian Coca 76e3a9c93a Merge pull request #9894 from 47lining/cloud_modules_sts_support_redux_ansible
Cloud Modules STS Support Redux
11 years ago
Rene Moser 3e7d959c9d cloudstack: module utils are BSD licensed 11 years ago
Rene Moser c066a60b7c cloudstack: fail_json() if library cs is not found 11 years ago
Rene Moser bb6d983290 cloudstack: add utils for common functionality 11 years ago
Toshio Kuratomi aaa25eb75c Make run_command() work when we get byte str with non-ascii characters (instead of unicode type like we were expecting)
Fix and test.

Fixes #10536
11 years ago
Eri Bastos d4eddabb2a Patch for bug #10485 - ansible_distribution fact populates as 'RedHat' on Oracle Linux systems 11 years ago
Brian Coca 5eae435357 removed Darwin get_uptime_facts as it seems to crash on OS X, will waiy for a
patch tested by someone that has access to the platform
11 years ago
Chris Blumentritt 7813ffd719 Adding uptime_seconds fact for linux and darwin platforms
Adds ansible_uptime_seconds facts for linux and darwin platforms.  BSD
platforms may also work.
11 years ago
Toshio Kuratomi 8c3b5690e5 Merge pull request #10357 from htgoebel/devel
Fix detect of docker as virtualization_type.
11 years ago
Brian Coca 17c710e713 Merge pull request #10420 from bmanojlovic/devel
add missing AIX network facts discovery
11 years ago
Boris Manojlovic a59784a581 don't use full path to command instead use module.get_bin_path 11 years ago
Matt Martz 4990814901 Prevent an empty error message 11 years ago
Boris Manojlovic 0f4cf8cb43 add missing AIX network facts discovery 11 years ago
pyroscope d0197195ed Handle /etc/os-release files with 'Raspbian' in them 11 years ago
riedel 29cca0191b Adding oVirt recognition for oVirt guests. oVirt uses KVM. 11 years ago
Monty Taylor 8758ba08bd Update common OpenStack requests-related parameters
Also, update docs related to earlier changes in this stack.
11 years ago
Monty Taylor 8027a8a0b5 Change to auth_type to match python-openstackclient 11 years ago
Brian Coca 761540e9fd Merge pull request #10392 from sgordon46/devel
facts.py throws exception when run on RHEV hypervisor #10383
11 years ago
Brian Coca aed493158c Merge pull request #9428 from landryb/openbsd_add_mount_facts
parse /etc/fstab on OpenBSD to get mount facts
11 years ago
Stephen Gordon b44bf0379b facts.py throws exception when run on RHEV hypervisor #10383 11 years ago
Hartmut Goebel 8758ae201d Fix detect of docker as virtualization_type.
Not only match`/docker/`, but also `docker-` followed by a hex-id.

Example (shortened):
```
$ cat /proc/1/cgroup
8:blkio:/system.slice/docker-de73f4d207861cf8757b69213ee67bb234b897a18bea7385964b6ed2d515da94.scope
7:net_cls:/
```
11 years ago
Brian Coca 942ff8d0b9 Merge pull request #10035 from phenomenes/fix_9911
Adds seconds to backup timestamp
11 years ago
Brian Coca 5d729edd2f Merge pull request #9458 from sthen/openbsd_arch
set CPU architecture correctly for OpenBSD (powerpc not macppc, etc.)
11 years ago
Monty Taylor 0b8773fc99 Remove state from central argument list
There is an old PR that shows a great use case for having a different
set of states for the server module. Before the other modules start
being in real use, pull this out so that we don't get ourselves into a
pickle.
11 years ago
Brian Coca 1d90ff8b34 Merge pull request #10304 from dago/ldom
Add LDom support
11 years ago
Dagobert Michelsen c1dba60961 Use try block for field splitting 11 years ago
Dagobert Michelsen 90e760ba84 Add LDom support 11 years ago
Brian Coca 414737557e Merge pull request #10284 from mihirvj/devel-10221
Pulls machine id in ansible facts
11 years ago
Brian Coca e6ac2fa593 Merge pull request #10292 from dago/solaris-mounts
Add support for mounts in Solaris facts
11 years ago
Dagobert Michelsen b82a8576f1 Add support for mounts in Solaris facts 11 years ago
Mihir Joshi 58a5f8dfaf Pulls machine id in ansible facts
- Fix #10221
11 years ago
Brian Coca 6f6c6fb32a Merge pull request #10259 from sivel/rax-boot-vol-v2
Add new rax_find_bootable_volume to assist with boot from volume
11 years ago
Toshio Kuratomi 8f9b761f3a Merge pull request #10128 from alxgu/fix_facts_for_sles
Fix wrong distribution facts on SLES/openSUSE
11 years ago
Stratos Moros 6caeded74e Fix umask calculation on file creation. Fixes #10257 11 years ago
Toshio Kuratomi c9fb97cc86 Be careful not to set the permissions of the destination of a symlink.
It's up to the module using the set_fs_attributes*/set_mode* methods to
specify the filename of the destination of the symlink if that's really
the file that should be modified.

Half of the fix for:
https://github.com/ansible/ansible-modules-core/issues/778
11 years ago
Alexander Gubin d291dae582 Exit loop after detecting os-release 11 years ago
Matt Martz cfd05ceafc Add new rax_find_bootable_volume to assist with boot from volume 11 years ago
Monty Taylor 4e4bdaad8d Remove auth_token parameter
It turns out that this can actually already be handled by the existing
auth plugin framework and does not need its own parameter. Remove before
it sees usage and causes confusion.
11 years ago
Brian Coca 0912781357 Merge pull request #9421 from emonty/features/new-openstack
Add support for new OpenStack modules
11 years ago
Brian Coca 1b4f1e1756 Merge pull request #9555 from bcoca/low_cost_facts
allow fact objects to be instantiated w/o triggering all fact collection
11 years ago
Toshio Kuratomi 6fe8865885 Return empty string if unable to read from some files during fact gathering so as not to change the values we return 11 years ago
Monty Taylor 8c7267f9b9 Add support for new OpenStack modules
Incoming cloud config for OpenStack is complex due to plugins and
deployer choices. Rather than having the logic spread all over the
OpenStack modules, centralize it in the module_utils code.
11 years ago
pdelared 4c661e2b93 Update facts.py
Added support for HPUX network fact
11 years ago
Toshio Kuratomi 402a6d0533 Explicitly close files opened by facts
Fixes #10157
11 years ago
Toshio Kuratomi 425dee1afa Close some file handles explicitly in facts.py
Helps control open file descriptor count with pypy (which is used with
one coreos + ansible example).  Part of a fix for
https://github.com/ansible/ansible/issues/10157
11 years ago
Toshio Kuratomi 4902c06304 Obfuscate passwords in more places where it is displayed 11 years ago
Alexander Gubin 1968f99691 Wrong OS_FAMILY declaration for openSUSE 11 years ago
Toshio Kuratomi f355c11a3f Merge pull request #10129 from RadishTheHut/memfacts-fix
Fix for memory fact gathering
11 years ago
Patrick McConnell 04b2c698ba Updated memory facts fix using dict.get() to avoid KeyError 11 years ago
Toshio Kuratomi f20967078e Fixes to @RadishTheHut's memory facts as discussed in
https://github.com/ansible/ansible/pull/10129#issuecomment-72077500

* Switch default value from 0 to None.
* Prefill keys with default value so that determining calculated values
  is easier
11 years ago
Brian Coca e4a7b973fd Merge pull request #9128 from msabramo/expose_more_user_facts
Expose more facts about user on host system
11 years ago
Patrick McConnell 0c3a273805 Fix for memory fact gathering
I have a host which started to fail while gathering facts after the addition
of expanded memory facts in PR #9839:

Traceback (most recent call last):
  File "/home/ansible/.ansible/tmp/ansible-tmp-1422536976.05-133253824703289/setup", line 4278, in <module>
    main()
  File "/home/ansible/.ansible/tmp/ansible-tmp-1422536976.05-133253824703289/setup", line 137, in main
    data = run_setup(module)
  File "/home/ansible/.ansible/tmp/ansible-tmp-1422536976.05-133253824703289/setup", line 81, in run_setup
    facts = ansible_facts(module)
  File "/home/ansible/.ansible/tmp/ansible-tmp-1422536976.05-133253824703289/setup", line 4217, in ansible_facts
    facts.update(Hardware().populate())
  File "/home/ansible/.ansible/tmp/ansible-tmp-1422536976.05-133253824703289/setup", line 2339, in populate
    self.get_memory_facts()
  File "/home/ansible/.ansible/tmp/ansible-tmp-1422536976.05-133253824703289/setup", line 2375, in get_memory_facts
    'cached': memstats['swapcached']
KeyError: 'swapcached'

My problem host doesn't have SwapCached in /proc/meminfo. It may be better to
set defaults for these keys, since the values provided by /proc/meminfo can
change from version to version.
11 years ago
Alexander Gubin 5dec45e24a Fix wrong distribution facts on SLES/openSUSE 11 years ago
Brian Coca 11005e7b28 Merge pull request #9839 from nousdefions/memfacts
Memfacts
11 years ago
Toshio Kuratomi 915d232d5f jinja2 cannot handle byte strs with non-ascii. So we need to transform potential byte str into unicode type. This fix is for dynamic inventory.
Fixes #10007
11 years ago
Brian Coca 82abe63eb2 Merge pull request #10055 from digi691/devel
Add the uuid of the device in ansible_mounts variable
11 years ago
Toshio Kuratomi e6b5cc9ccb Merge pull request #9887 from lmacken/devel
Use send instead of sendv on the systemd.journal (fixes #9886)
11 years ago
cdigiovanni 99bcbe746f Add the uuid of the device in ansible_mounts variable 11 years ago
Brian Coca 78e1a7ed93 Revert "Fix: Add support for SSL protocol version configuration option" 11 years ago
Jimena Cabrera-Notari 1e865368ac Adds seconds to backup timestamp 11 years ago
Brian Coca 9ccabbb95e Merge pull request #9808 from swimlappy/sslconfig
Fix: Add support for SSL protocol version configuration option
11 years ago
Brian Coca bd62530700 Merge pull request #9947 from maxamillion/issue-9759-fix-processor-facts
don't double the count of i for LinuxHardware cpuinfo keys on 'vendor_id' and 'model name' keys
11 years ago
Adam Miller 06b70e4f9c When checking for Xen for LinuxHardware processor facts, don't check sysfs if already found in /proc/ 11 years ago
Nate Coraor 60e815c844 Set ansible_distribution_version differently for Solaris variants. 11 years ago
Toshio Kuratomi 5354df8643 s/nexentaStor/Nexenta/ 11 years ago
Toshio Kuratomi 04635333d0 Update fact gathering for solaris-family distributions 11 years ago
Adam Miller f274234824 Only add the overhead for each iteration of cpuinfo parsing if Xen is detected 11 years ago
Adam Miller 3729259b68 don't double the count of i for LinuxHardware cpuinfo keys on
'vendor_id' and 'model name' keys

Check for Xen paravirt and handle processor facts accordingly
11 years ago
Mick Bass 17498b58bb Add support for AWS Security Token Service (temporary credentials) to all AWS cloud modules. 11 years ago
Luke Macken dea0ee663f Use send instead of sendv on the systemd.journal (fixes #9886) 11 years ago
Brian Coca 19038a71bf Merge pull request #9419 from willthames/aws_frankfurt
There are still a couple of modules that use their own lists, but that should not prevent this merge, those should be adapted to use this list in subsequent patch
11 years ago
Jonathan Davila a93db1948e expanded facts 11 years ago
Toshio Kuratomi 828adbf788 Merge pull request #9807 from swimlappy/noproxy
Request: Honor the "no_proxy" environment variable in Ansible
11 years ago
Jon Hawkesworth e37b63386c Revised following comments from Chris Church.
Now uses sha1 checksums following merge of 9688.
Also I undid the changes I made to fetch.py
win_template.py now uses conn.shell.has_trailing_slash and
conn.shell.join_path
updated integration tests.
11 years ago
root bf916fb58a Adding first pass at win_copy, win_file and win_template modules. 11 years ago
Jonathan Mainguy 8278626dd0 Added distribution facts for OpenSuse 11 years ago
Jason Holland eedc51f213 Add support for SSL protocol version configuration option. Also fix 2 places where the SSL version was not being set properly. 11 years ago
Jason Holland 38dbce1527 Allow Ansible to honor the "no_proxy" environment varaible. 11 years ago
Brian Coca 215359084b Merge pull request #9375 from mantiz/fix-osfamily-and-distribution-on-archlinux
Fix os_family and distribution on archlinux
11 years ago
Michael DeHaan d4da58e102 Merge pull request #9720 from vlajos/typofixes-vlajos-20141204
typofixes - https://github.com/vlajos/misspell_fixer
11 years ago
Veres Lajos bf5d8ee678 typofixes - https://github.com/vlajos/misspell_fixer 11 years ago
Toshio Kuratomi 3b80f63e22 Have known_hosts function use the url parameter instead of getting a specific attribute out of the module dict.
This makes the function useful in more places
11 years ago
Justin Wyer 8146d1fff3 /sys/block/sdX/queue/physical_block_size does not correlate with /sys/block/sdX/size for advanced drives larger than 2TB, /sys/block/sdX/queue/logical_block_size correlates with both see #9549 11 years ago
Baptiste Mathus a1adff4ff0 Setting LC_MESSAGES: prevent unparseable messages
This locale variable defines how tools should display their messages.
This is for example gonna change the yum message from "Nothing to do" to
"Rien a faire" in my case (french).

As the yum module parses that string in err, if the message is not
enforced in english this is gonna fail.

So this commits just enriches a bit more the code that's already written
for that enforcement.

This commit fixes issue #9635.
11 years ago
Toshio Kuratomi 9a77aefc33 Special case the lone asterisk fragment in mysql 11 years ago
Toshio Kuratomi 199d6c0b8b Fix some problems with the generic quote char 11 years ago
Toshio Kuratomi fcf0975c90 Fix a few mysql related typos 11 years ago
Toshio Kuratomi 0287e9a23d Normalize the identifier quoting so we can reuse the functions for mysql 11 years ago
Toshio Kuratomi 64a8ad9a21 Remove debugging code 11 years ago
Toshio Kuratomi 067112b5ee Code for modules to perform more robust quoting of database identifiers 11 years ago
Michael DeHaan 2c520655ae Merge pull request #9452 from erjohnso/google_endpoint_provider
Google: allow for different libcloud provider to support upcoming DNS mo...
11 years ago
Brian Coca 504995bda2 allow fact objects to be instantiated w/o triggering all fact collection
this opens the ability to do specific facts at much lower cost.
11 years ago
Brian Coca 0990a71ab5 Merge pull request #9516 from 0x44/new-regions
Support new AWS regions: cn-north-1, eu-central-1.
11 years ago
Toshio Kuratomi b828b25784 Add a fips fact and use it for integration tests 11 years ago
James Cammarata 5bc81f9ae7 Add ability to detect prompts in stdout from run_command 11 years ago
Toshio Kuratomi 9a7eb57718 Some changes to FIPS compat since SLES implements it differently 11 years ago
Toshio Kuratomi 6a85f3ebc7 Add comments/docstrings not to use md5 unless forced to by forces outside our control. 11 years ago
Ding Deng b63ca685df Support new AWS regions: cn-north-1, eu-central-1. 11 years ago
Toshio Kuratomi f1267c0b05 Move from md5 to sha1 to work on fips-140 enabled systems 11 years ago
Matt Martz 047dffdd01 Fix rax_find_loadbalancer issues
* Loadbalancer IDs are not UUIDs
* Ensure found list exists before using it
11 years ago
Will Thames 2397926b94 Handle case where boto needs an upgrade to recognise a new region
Raise an exception if boto does not yet know about a region.
11 years ago
Stuart Henderson 419872373e set CPU architecture correctly for OpenBSD (powerpc not macppc, etc.) 11 years ago
Eric Johnson a2498bdadd Google: allow for different libcloud provider to support upcoming DNS module 11 years ago
Jure Triglav 2f869a6309 Add the default Homebrew path for OpenSSL certs on OS X 11 years ago
Landry Breuil 792d8d1808 Ignore swap or altroot entries 11 years ago
Landry Breuil d68eb7272e parse /etc/fstab on OpenBSD to get mount facts 11 years ago
Monty Taylor 61ae3c732f 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.
11 years ago
Will Thames 5ceb07c65a Add Frankfurt AWS region 11 years ago
James Cammarata 28fd4df787 Merge pull request #9382 from gquintard/WIP/newdockerdetection
Detect docker as virtualization_type
11 years ago
James Cammarata efb40969b3 Merge pull request #9381 from debfx/facts_virt_kvm
Detect kvm guests through sys_vendor.
11 years ago
Guillaume Quintard 895da79d87 Detect docker as virtualization_type
New docker versions use "docker" in /proc/1/cgroup, which disturbs the
virtualization_type detection. So, grep for docker, in addition of
"lxc".
11 years ago
Felix Geyer ee5f5ee00d Detect kvm guests through sys_vendor.
The two detection methods currently implemented do not cover all cases.

For example qemu guests invoked like this:
qemu -machine pc-i440fx-1.4,accel=kvm -cpu SandyBridge

return this information:
product_name: Standard PC (i440FX + PIIX, 1996)
cpuinfo: model name      : Intel Xeon E312xx (Sandy Bridge)
11 years ago
Christian Hammerl 5efc4efca7 Fix os_family and distribution on archlinux
Fixes #8732, ansible/ansible-modules-core#34
11 years ago
Toshio Kuratomi 139e4767e4 Merge pull request #9329 from mcodd/devel
python2.4 compatibility issue with urlparse
11 years ago
Marcin Praczko 1917906dd6 Fix detecting distribution release on OpenSuSE
Ansible raised exception during parsering /etc/SuSE-release file.
Regular expresion should use string instead of list.
Fix tested on OpenSuse 13.1
11 years ago
Matt Coddington 10113e6a67 python2.4 compatibility issue with urlparse 11 years ago
Toshio Kuratomi 2b9e235ffd Rework distribution fact checking to be a little less heinous and add
support for Mandriva.

Fixes #9282
11 years ago
James Cammarata 2a0d18b092 Insert newlines correctly when splitting literal blocks
Fixes #9274
11 years ago
Toshio Kuratomi a10d10f647 Workaround more python-2.6 shlex not being able to handle unicode strings 11 years ago
Marc Abramowitz e0015395de Expose more facts about user on host system
Adds:
  - `user_uid`
  - `user_gid`
  - `user_gecos`
  - `user_dir`
  - `user_shell`
11 years ago
Jakub Roztocil 0073d2dd92 Remove unreachable code. 11 years ago
James Cammarata b376e208c7 Adding "follow" param for file/copy options
Also modifies the template action plugin to use this new param
when executing the file/copy modules for templating so that links
are preserved correctly.

Fixes #8998
11 years ago
James Cammarata e54178f904 Catch additional errors in fetch_url
Fixes #8971
11 years ago
James Cammarata 317ab06bc6 Fixing multiline parsing to preserve newlines
Fixes #8813
11 years ago
James Cammarata 8bafc646cb Disable custom https handler for fetch_url on older pythons
Fixes #8898
11 years ago
Toshio Kuratomi 8233522a7a Reduce commenting as basic.py is copied to the remote host with every module transfer.
Move some comments to the unittest as we might look at that if we decide
to refactor the code.
11 years ago
Toshio Kuratomi 1afc8161a1 New password obfuscation in syslog messages that:
* makes speed acceptable for some datasets
* obfuscates multiple detected passwords
* obfuscates more characters to account for some corner cases when
  trying to detect passwords.

Fixes #8364
11 years ago
Toshio Kuratomi 4f55bcc298 Standardize on bytes internally to _log_invocation 11 years ago
James Cammarata cd99821f8a Fix py26 difference in ssl socket connect call from 99ba9d6 11 years ago
James Cammarata b827f791e1 Merge pull request #8832 from sivel/rax-validate-regions
rax modules: Perform region validation early
11 years ago
James Cammarata 35dfbff2e1 Merge pull request #8817 from meatballhat/support-sunos-certs-location
Supporting SSL cert location on SunOS (SmartOS, really)
11 years ago
Matt Martz 55ed4489e3 Perform region validation early to be more explicit about invalid region failures 11 years ago
Dan Buch 290f2759e1 Supporting SSL cert location on SunOS (SmartOS, really) 11 years ago
Trond Hindenes 72760f5999 All changes referenced in PRs #8767 , #8768 , #8769 :
This changes the get-attr function slightly, and lets the module specify whether a param is needed and auto-fails if it is not present. A module can now verify params like so::
 $params = Parse-Args $args;
 $result = New-Object psobject;
 Set-Attr $result "changed" $false;
 $path = Get-Attr -obj $params -name path -failifempty $true -resultobj $result

or

$params = Parse-Args $args;
 $result = New-Object psobject;
 Set-Attr $result "changed" $false;
 $path = Get-Attr -obj $params -name path -failifempty $true -emptyattributefailmessage "Oh man. You forgot the main part!" -resultobj $result

slight tweak in how the powershell module converts to json in order to support nested objects (allows for more complex facts, among others)

This script gathers some extended facts on windows hosts in a json array attribute called "ansible_interfaces". This info is needed for some network-related modules I'm working on. Required the update to powershell.ps1 to return deeply nested json objects.
11 years ago
James Cammarata dbc980eaf4 Merge branch 'mischapeters-devel' into devel 11 years ago
James Cammarata 70ff6d35aa A10 module improvements
* moved common code to an module_util snippet
* rewrote logic to make each module idempotent
* added new capabilities like the write_config option
11 years ago
Michael DeHaan b7082677de Merge pull request #8790 from sivel/issue/8784
Don't use ternary if statements. Fixes #8784
11 years ago
James Cammarata 7fbdbcdec7 Default fetch_url to use TLSv1 instead of SSLv2/3 11 years ago
James Cammarata 99ba9d6e24 Default fetch_url to use TLSv1 instead of SSLv2/3 11 years ago
Matt Martz 2b307985bc Don't use ternary if statements. Fixes #8784 11 years ago
James Cammarata c21c66c740 Merge branch 'file_symbolic_mode' of https://github.com/pbitty/ansible into pbitty-file_symbolic_mode 11 years ago
James Cammarata 3b19b83806 Add GovCloud region to list of regions for AWS
Fixes #8604
11 years ago
James Cammarata 24c4277479 Remove tabs added from 677de07 11 years ago
James Cammarata 5e240fec71 Merge branch 'devel' of https://github.com/l1k/ansible into l1k-devel
Conflicts:
	test/integration/roles/test_copy/tasks/main.yml
11 years ago
James Cammarata 3a7aca6066 Fix no_log value for content in common file args settings
Also adds a test to ensure the content value is not logged.

Related to #8647
11 years ago
Lukas Wunner 677de07f44 Try optimistic chown, do not error out if not permitted to chown
Add unit test
11 years ago
James Cammarata 8dafacd4e9 Make env param a dict type instead of list
Also modifies param type checking code to remove whitespace from
around params before splitting them into k=v pairs.

Fixes #8199
11 years ago
James Cammarata 600a4657b4 Catch error in atomic_move when creating temporary file
Fixes #8480
11 years ago
Lukas Wunner f4053fcf3a Only chown on atomic move if invoked as root
Linux and BSD derivatives do not allow unprivileged users to
"give away" files to others for security reasons. (System V
derivatives allow that but they're rare nowadays.)
11 years ago
James Cammarata 83fa9a8cde Make sure we only use unquote on quoted lines in lineinfile when needed 11 years ago
James Cammarata 9f34ea54f5 Correct parser to ignore escaped quotes when not in quotes already
Related to #8481
11 years ago
Michael DeHaan e01d5f9d84 Revert "Added cross-platform uptime fact" since causing failures on Ubuntu.
This reverts commit 14a9966984.

Conflicts:

	lib/ansible/module_utils/facts.py
11 years ago
Michael DeHaan ea53576759 Merge pull request #6777 from GuiGui2/devel
Setup module: Additional facts when using ansible with Linux on System z
11 years ago
Michael DeHaan 5d05049ee1 Merge pull request #7670 from dagwieers/patch-3
Added cross-platform uptime fact
11 years ago
Michael DeHaan a48328fa12 Merge pull request #7725 from slapers/network-secondaries-issue
fix incorrect secondary ip handling, fixes #7724
11 years ago
James Cammarata 63bf2f6d9a Preserve all line breaks in literal blocks
Fixes #8512
11 years ago
Michael DeHaan d0205b2878 Merge pull request #8500 from sivel/rax-de-dupe
rax: Move additional shared code into module utils
11 years ago
Michael DeHaan 8c4161d4a1 Merge branch 'retf_py' of git://github.com/berendt/ansible into devel
Conflicts:
	lib/ansible/inventory/vars_plugins/group_vars.py
	plugins/callbacks/mail.py
11 years ago
Michael DeHaan 66eddfd491 Merge branch 'nova-compute-enhancements' of git://github.com/emonty/ansible into devel
Conflicts:
	lib/ansible/module_utils/openstack.py
	library/cloud/nova_compute
11 years ago
Michael DeHaan b413a7d7f3 Merge pull request #8449 from emonty/feature/openstack-auth-handling
Handle auth arguments across openstack modules consistently
11 years ago
Bekim Berisha 5272e1099d Keep docstring up to date with the code in basic module 12 years ago
Matt Martz 7d0eba19ab Dedupe PTR record related code in rax_dns_record 12 years ago
Matt Martz 88acb48753 Add ANSIBLE_VERSION to module_utils/basic.py and manipulate the pyrax user-agent 12 years ago
Matt Martz 585fd5a138 Move additional rackspace common code into module_utils/rax.py 12 years ago
Monty Taylor 4012272fa2 Add common auth handling across openstack modules
Taking a page out of the ec2 config, make sure that all of the
OpenStack modules handle the inbound auth config in the same way.
The one outlier is keystone wrt auth_url.
12 years ago
James Cammarata 5d0bb33ede Make run_command process communication smarter
The run_command module function will now poll stdout/stderr for
data rather than using the builtin command communicate(), which can
hang under certain circumstances.

Fixes #7452
Fixes #7748
Fixes #8163
12 years ago
James Cammarata 74cbeb1292 Default interface type to ipv4 when checking flags for Solaris
Fixes #8330
12 years ago
James Cammarata af0d8cda7b Fix literal block multiline parsing
Fixes #8394
12 years ago
Monty Taylor a05804bf8d Update the nova inventory plugin with new ip code
The provisioning module knows more about how nova deals with IP
addresses now. Ensure that the inventory module is similarly as smart
by separating out the logic into the openstack/module_utils.
12 years ago
Monty Taylor d17a1b5c19 Add common auth handling across openstack modules
Taking a page out of the ec2 config, make sure that all of the
OpenStack modules handle the inbound auth config in the same way.
The one outlier is keystone wrt auth_url.
12 years ago
Luke Sneeringer a4fce4818e Add support for environment variables in GCE module. 12 years ago
James Cammarata 7a5076c8b8 Catching shlex splitting error in fact gathering get_cmdline call
Fixes #8352
12 years ago
James Cammarata 189824dd76 Remove whitespace around args
Fixes #8343
12 years ago
James Cammarata e6fa50a306 Move splitter to module_utils so modules can use it and fix command arg splitting
Fixes #8338
12 years ago
Michael DeHaan 645ab7baff Merge pull request #7950 from mesk41in/devel
Fix unsupported regexp parameter in assemble
12 years ago
Michael DeHaan fb60e767a7 Taking alternate approach.
Revert "Fix hostname when get_distribution_version() returns a string."

This reverts commit 08f97c0b9d.
12 years ago
Michael DeHaan 628d828876 Merge pull request #8087 from neersighted/string_version
Fix hostname when get_distribution_version() returns a string.
12 years ago
Michael DeHaan 30e6a659ae Merge pull request #8171 from jbenden/osx-10.10
Support for OS X 10.10 DP3.
12 years ago
Michael DeHaan 20f65f2c79 Merge pull request #8262 from icoloma/patch-1
Bugfix: bulletproof unexpected_error_msg at gce.py
12 years ago
Nacho Coloma 979824eedc Moved import to the top 12 years ago
James Cammarata 10a850c70f Merge branch 'new_arg_splitting' into devel 12 years ago
Michael DeHaan 630f080cf0 Start of unit tests for split_args function, moved split_args to utils since not needed by modules (so far). 12 years ago
Michael DeHaan b5d64fdb36 Some notes/comment upgrades on split_args. 12 years ago
James Cammarata 43154e5101 Using custom splitting function for module param counting 12 years ago
Michael DeHaan e143d7dab7 Merge pull request #7543 from yangliping/fix_local_facts_file_checking_portability
Fix portability issue when checking local facts file permission.
12 years ago
Michael DeHaan 635bea645c Merge pull request #7992 from dehylton/devel
fix swap translation on 4.x openbsd with 2.5.4 python
12 years ago
Nacho Coloma 57428c48a2 Bugfix: bulletproof unexpected_error_msg at gce.py
This method was still failing for me with a "missing http_code" message. After applying this change, the error message is:

```
msg: Unexpected response: {'value': 'PyCrypto library required for Service Account Authentication.'}
```

I wanted to contribute a rock-solid `unexpected_error_msg` implementation.
12 years ago
James Cammarata 84759faa09 Security fixes:
* Strip lookup calls out of inventory variables and clean unsafe data
  returned from lookup plugins (CVE-2014-4966)
* Make sure vars don't insert extra parameters into module args and prevent
  duplicate params from superseding previous params (CVE-2014-4967)
12 years ago
Joseph Benden da5e32b316 Needs additional divisor. 12 years ago
Joseph Benden b55791ef43 Support for OS X 10.10 DP3. 12 years ago
Ruggero Marchei 909955f2e2 fix get_distribution_version() on amazon linux 12 years ago
Bjorn Neergaard 08f97c0b9d Fix hostname when get_distribution_version() returns a string.
The distro version is a string ('jessie/sid') on Debian unstable and testing.
Because load_platform_subclass() evaluations every subclass as it loops,
comparing numbers when get_distribution_version() does not return a number will
break.

This patch fixes that by returning a number (`0`) when we have an invalid
version, instead of returning `None` or a string.
12 years ago
Casey Fitzpatrick 7115cb1f37 removed port from domain name qualification, fixes 7941 12 years ago
James Cammarata 81f35323e9 Revert "Fix get_distribution() for platforms that may have spaces"
This reverts commit 2493020d9f.
12 years ago
dewey hylton 379e1a49cb fix swap translation on 4.x openbsd with 2.5.4 python 12 years ago
mesk41in 488aec3936 Fix unsupported regexp parameter in assemble 12 years ago
James Cammarata 9564818e1e Merge branch 'fix_lineinfile_newlines' into devel 12 years ago
Ivo Senner f4fd9d366b Check for empty os-release file, fixes #7885 12 years ago
James Cammarata 3c3c710a58 Merge branch 'module_safe_eval' into fix_lineinfile_newlines 12 years ago
James Cammarata d8bb116c1a Merge branch 'devel' of https://github.com/tgolly/ansible into tgolly-devel 12 years ago
Michael DeHaan 5156794738 Merge pull request #7861 from cchurch/devel
Windows Remote Support
12 years ago
Matt Martz 09dd535296 Make helper functions more robust against undefined powershell objects 12 years ago
Matt Martz df8866b8bd Add examples for how to use powershell common functions 12 years ago
Matt Martz e4e610565c Add convenience function (Get-Attr) for getting an attribute/member from a powershell psobject 12 years ago
Matt Martz 90c98ada7c Add ConvertTo-Bool filter function in powershell common code 12 years ago
Chris Church 243cd877ae Add integration tests for fetch/slurp, make powershell fetch/slurp work as close as possible to existing fetch/slurp modules. 12 years ago
Matt Martz 97f4f56286 Add Exit-Json and Fail-Json powershell helper functions 12 years ago
Matt Martz a25c441300 Add shared functions to module_utils/powershell.ps1 and refactor powershell modules to utilize the common powershell code 12 years ago
James Cammarata 360d8b0fc2 Don't try to scan SSH signatures for non-ssh urls
Fixes #7812
12 years ago
James Cammarata 2493020d9f Fix get_distribution() for platforms that may have spaces
The new CentOS 7 beta lists the distribution as "CentOS Linux", which
breaks the distribution detection and class loading. This patch fixes
that by taking just the first entry in the string when a space is
detected.
12 years ago
James Cammarata 3529b1cb33 Merge branch '7763' of https://github.com/rmarchei/ansible into rmarchei-7763 12 years ago
Michael DeHaan 627ff30a6f Add module replacer capability for powershell files. 12 years ago
Ruggero Marchei e3f5af377f move get_distribution_version() to basic.py 12 years ago
James Cammarata 9b17e8a555 Merge pull request #7771 from jkramarz/issue-5761
Added missing fallback to hw_sector_size
12 years ago
Matt Bray 578e881142 fix for urls like ssh://git@github.com/ansible/ansible.git 12 years ago
Jakub Kramarz df3188cef0 Added missing fallback from physical_block_size to hw_sector_size in sectorsize fact discovery for kernels older than May 2009.
References #5761
12 years ago
James Cammarata 3fb3e7e6dc Properly parse urls for ssh-keyscan use
Previously, the get_fqdn() function in known_hosts.py only worked
with urls that started with git@, and ignored any urls that started
with a normal schema type (ie. http:// or ssh://). This patch corrects
that by using urlparse to parse the hostname portion out of urls that
have a proper schema.

Fixes #7474
12 years ago
James Cammarata 395192ffbc Merge pull request #7740 from jkramarz/issue-5761
changed sector size fact source
12 years ago
James Cammarata b4d130d086 Add a new password pattern to the run_command filter 12 years ago
Jakub Kramarz 4e4c9235e8 changed sector size fact source from hw_sector_size to physical_block_size, fixes issue 5761 12 years ago
Stefan Lapers 78f4842982 fix incorrect secondary ip handling, fixes #7724 12 years ago
Dag Wieers fd6f0cb4b4 Update facts.py 12 years ago
Dag Wieers 14a9966984 Added cross-platform uptime fact
Having an uptime fact allows you to check after a reboot whether the system was effectively rebooted.

```yaml
  - name: Safeguard - Was system properly rebooted ?
    action: fail msg="System was not properly rebooted"
    when: ansible_uptime > 900
```

This patch has been tested on Linux, Solaris and HP-UX.
12 years ago
James Cammarata 849b0f87ce Fix error when using os.getlogin() without a tty 12 years ago
James Cammarata b94bde9711 Merge pull request #7609 from jimi-c/issue_7553_su_copy
Support checking for su user to atomic_move
12 years ago
James Cammarata 061911c9c2 Merge pull request #7558 from dermute/pkg_mgr
added solaris fact detection for ansible_pkg_mgr
12 years ago
James Cammarata e99df21647 Support checking for su user to atomic_move
Fixes #7553
12 years ago
Alexander Winkler 4980e76a3a added solaris fact detection for ansible_pkg_mgr 12 years ago
rik2803 cfcbc954f5 Differentiate machinfo output key/val separator
get_hw_facts for HP-UX: machinfo in HP-UX B.11.23 uses '=' as separator between key and value, while B.11.31 uses ':'.
12 years ago
Yang Liping aedf134fc4 Fix portability issue when checking local facts file permission. 12 years ago
James Cammarata 0ac74aaf59 Also set the environment variables when resetting the locale to C 12 years ago
James Cammarata d44ed533b3 Default use_proxy to True for fetch_url()
Also added some error handling to the fetch_url() call in the
apt_repository module, so that failures to look up the PPA info
are properly handled.

Fixes #7322
12 years ago
James Cammarata 08406c0ee2 Adding the capability to proxy the ssl cert check
The ssl cert check will now respect the http and https proxy
environment settings. The url may also have the username/password
embedded, in which case basic auth will be used to connect to the
proxy server.

Fixes #7413
12 years ago
James Cammarata 285d9878ae Reset locale to 'C' if the specified one is invalid
Fixes #7448
12 years ago
James Cammarata df877f2e79 Check module_path permissions when creating ssh_wrapper for git
If the module directory is not writable/executable to the current user
(most likely because of a sudo to a non-root user), the ssh_wrapper
will be created in the default location for mkstemp() calls. To facilitate
the deletion of these new files, a new mechanism for cleaning up files
created by the module was also added.

Fixes #7375
12 years ago
Michal Mach 60451c20ab Fix known_hosts.py to work on older versions of python 12 years ago
James Cammarata 56515a38d5 Only chown on atomic move if the uid/gid don't match the src/tmp file
This is a corner case for remote file systems that don't support
chown() and where the source and destination for the atomic_move
are on that remote file system.

Fixes #7372
12 years ago
Christian Berendt 6676720ce5 fixed typos found by RETF rules in PY files
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
12 years ago
James Cammarata 54b1f820fb Modify the way we set the localization environment
Previously, we set the LANG (and LC_CTYPE) environment variables
directly in the module code and applied them with os.environ().
Instead, we are now pre-pending those variables to the environment
string used to execute the command which allows the user to
override the localization values by setting the environment values
directly (even on a per-task basis):

  - subversion: repo=file:///path/to/repos/svn_über dest=/tmp/svntest
    environment:
      LANG: "C"
      LC_CTYPE: "en_US.UTF-8"

So if a user wishes to default their LANG back to C, they can still
avoid unicode issues by doing the above.

Fixes #7060
12 years ago
Joost Cassee 978e6d2cd6 Make concatenating certs robust in urls.py
Add a newline after each certificate file explicitly to avoid problems
with files that do not end with a newline themselves.
12 years ago
Jiri Barton 9da06274a8 Set proper file permisions when a file is created with atomic_move
Fixes #7196
12 years ago
Michael DeHaan 9a6998aa17 While this code is unused, this remote module copy of this function should not be carried around in the source code. 12 years ago
Logos01 424ee36e05 Enable facts module on older SuSE systems
Modified logic of distribution_release for SuSE to retain the last discovered key/value pair's value in /etc/SuSE-release that contains a '=' character.
12 years ago
Michael DeHaan ad04b455d3 add missing license header 12 years ago
James Cammarata 117952cf6c Fixing a bug in the new fetch_url username/password logic 12 years ago
James Cammarata 89fa9b7305 Add parameters to get_url for the url username/password
Fixes #6928
12 years ago
James Cammarata c115c34a1f Set the default LANG to en_US.UTF-8 and also set LC_CTYPE
Fixes #6737
12 years ago
Brian Coca c3e559b914 should now work with versions older than 8.4 12 years ago
faust64 78b9a11ccf Update facts.py
Fixes #7093 --devel
12 years ago
James Cammarata 68c30548e0 Properly catch and decode unicode strings in module _log_invocation()
Fixes #7084
12 years ago
James Cammarata 39c6141b4a Merge pull request #7082 from bcoca/freebsd_mtu_fix
fixed issue with FreeBSD network facts
12 years ago
Brian Coca e5f297697a ifconfig changed on FreeBSD, tested this on 8,9 and 10 latest stable
versions and it now works
12 years ago
Brian Coca bc23926f42 fixed ETIME issue on FreeBSD 8 through 10, which broke all fact
gathering
12 years ago
James Cammarata ae29e43f93 Merge branch 'issue_7009_nfs_selinux' into devel 12 years ago
James Cammarata 3715482d7c Determine selinux context for NFS mount points correctly
Fixes #7009
12 years ago
Wim 6ed4ca97a8 hint to install python-ssl on redhat systems 12 years ago
James Cammarata d240d073eb Changing SSL cert detection method to allow for auto-negotiation of SSL protocols
Fixes #6904
12 years ago
James Cammarata 23c5f4524d Make sure args in run_command are encoded for shlex.split calls on py2.6 12 years ago
James Cammarata eebc72ab9b Add a timeout decorator for timing out functions that may hang
Fixes #6891
12 years ago
James Cammarata 9ca8c3262c Switch module safe_eval to ast.literal_eval 12 years ago
Eric Lake 7f9736198a add distribution_major_version to fact gathering 12 years ago
James Cammarata 82b24c162e Adding delimiter fixes to action_plugin + fixing local assembling with a delimiter
Also added a new integration test for assemble using local assembly
with a delimiter.
12 years ago
Harlan Lieberman-Berg 876b8085aa Add directory_mode to common file parameters to prevent errors. 12 years ago
Tim G c307a73e28 Check for errors from adb, may not work on all systems. 12 years ago
Tim G 285d4f3fa6 If memory not available in syslog.log, catch error, attempt to find it with adb 12 years ago
GuiGui2 b9613665dd Setup module: Additional facts when using ansible with Linux on System z
- Improved parsing of /proc/cpuinfo to take the specifics of Linux on
System z. ansible_processor and ansible_processor_cores are now
completed.
- Also improved virtualization facts in the same environment, parsing
the output of /usr/bin/lscpu to populate virtualization_type and
virtualization_role more precisely. If lscpu is not available, then
stick to the previous behavior.
12 years ago
James Cammarata b698f7a44b Add option to create host_key directory if it doesn't exist
Fixes #6731
12 years ago
Michael DeHaan a6b25e8657 Allow type=list module arguments to accept integers and floats. 12 years ago
Michael DeHaan 9921f804f9 Merge pull request #6643 from herbygillot/fact-full-hostname
Add a fact providing the full hostname, without the domain portion
12 years ago
Cristian Ciupitu 1eaf85b89f Micro-optimization: replace s.find(x)!=-1 with x in s
timeit shows a speedup of ~3x on Python 2.7.5 x86_64.
It also makes the code a bit shorter.
12 years ago
James Tanner 3194fbd365 Fixes #6655 catch unicode encoding errors before sending to syslog 12 years ago
James Cammarata 4ea12c1b86 Make sure stat of dest is available in atomic_move
Fixes #6682
12 years ago
Michael DeHaan 3eecc039b9 Merge pull request #6656 from Jmainguy/setup
Added ansible_date_time.weekday as a fact. This returns Monday,Tuesday,W...
12 years ago
Herby Gillot 94297950a0 Name platform.node() fact as "nodename" 12 years ago
Sébastien Gross ef6b437d0d Fix TypeError when using old simplejson lib.
On some very old simplejson does not support the 'encoding' and give
following exception:

   TypeError: __init__() got an unexpected keyword argument 'encoding'

This fix runs json.dump with no encoding key (such as before #a023cb) on
TypeError exception only.
12 years ago
James Cammarata bc93732b1d Catch permissions errors related to opening a known_hosts file in modules
Fixes #6644
12 years ago
James Cammarata db345391e3 Fixing ownership when atomic_move is creating a file while sudo'ing
Fixes #6647
12 years ago
Jonathan Mainguy b17b5ad85b Added ansible_date_time.weekday as a fact. This returns Monday,Tuesday,Wednesday,Thursday,Friday,Saturday, or Sunday depending on the remote servers time. Useful for backups the way I use it 12 years ago
James Cammarata bb723bedee Merge branch 'atomic_move_restore_owner_group_rebase' of https://github.com/tyll/ansible into tyll-atomic_move_restore_owner_group_rebase 12 years ago
Herby Gillot c0886a5f3a Add a fact providing the full hostname, without the domain portion
truncated.
12 years ago
Francisco José Marques Vieira e9d7476c28 Add missing sha1 import on known_hosts.py 12 years ago
Till Maas 898a38b074 module_utils/atomic_move(): Use tempfile module
Fix a potential race condition by using the tempfile module.
12 years ago
Till Maas 8f778a83df module_utils/atomic_move(): Restore owner/group
Manually restore owner and group if both src and dest are on a separate
file system.
12 years ago
James Cammarata 4880cfb5ea Merge pull request #6568 from sivel/ssl-cert-validation-osx
Make SSL verification on Mac OS X work out of the box
12 years ago
James Tanner 67517e96d3 Fixes #6567 put the git wrapper script in the module temp dir 12 years ago
Matt Martz 1d3d73a0b6 Only write the DUMMY_CA_CERT on OS X 12 years ago
Matt Martz 3b5aa8bd30 Provide a dummy ca to allow OS X to do it's OpenSSL keychain magic 12 years ago
James Cammarata 3f5440f7df Make modules set a valid working directory
Fixes #6546
12 years ago
Michael DeHaan 13f69dad05 Merge pull request #6527 from patrickheeney/hosts-bug
Fix for hostkey directory
12 years ago
James Cammarata 5d8c9d3f0f Merge branch 'file_fixes_clean' of https://github.com/bcoca/ansible into bcoca-file_fixes_clean 12 years ago
patrickheeney a9aab23f11 Fix for hostkey directory 12 years ago
Greg Dallavalle 77229553a3 fetch_url: Avoid credential stripping for FTP-scheme URLs 12 years ago
Michael DeHaan b0dbc61d63 Move facts to 'module_utils' so they can be referenced by other modules. Note unlike other module_utils/ dirs this keeps the original
license -- so usage of facts code in modules will be limited to GPLv3 modules.
12 years ago
Brian Coca 2d25577e11 Fixes and cleanup to file functions and module
- unified set attribute functions ... not sure why 2 identical functions
exist with diff names, now there are 3 while i repoint all modules to 1
- fixed issue with symlinks being created w/o existing src when force=no
- refactored conditionals, simplified where possible
- added tests for symlink to nonexistant source, with both force options
- made symlink on existing attomic (force)
12 years ago
James Cammarata a0cb974575 Be sure to return to the old directory if cwd is set in run_command 12 years ago
James Tanner a348f67238 Reset the current directory after running subprocess.Popen 12 years ago
James Cammarata 677008bef7 Rejoin args list into a string for run_command when using an unsafe shell
This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
12 years ago
James Cammarata 5233d4bc31 Fix typo in run_command when sending data that is not binary 12 years ago
James Cammarata b1a37dcc08 Revert "Rejoin args list into a string for run_command when using an unsafe shell"
This reverts commit 4273cb2d8e.
12 years ago
James Cammarata 4273cb2d8e Rejoin args list into a string for run_command when using an unsafe shell
This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
12 years ago