Commit Graph

597 Commits (9f9655d3db66be647e0f45d5236e5e6ec584b067)

Author SHA1 Message Date
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
Brian Coca 4dd233b0dd Merge pull request #10237 from emonty/remove-auth-token
Remove auth token and port openstack module_utils changes to v2 tree
2015-04-01 12:20:59 -04:00
Brian Coca 1fa3dbb7d2 capture IOErrors on backup_local (happens on non posix filesystems)
fixes #10591
2015-04-01 12:12:34 -04:00
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.
2015-04-01 07:54:02 -04:00
Monty Taylor 90ca386555 Add api timeout now that shade spports it everywhere 2015-03-31 20:29:06 -04:00
Brian Coca 299314c6b6 Merge pull request #10545 from resmo/feature/cloudstack-utils
cloudstack: common code used in cloudstack modules
2015-03-30 22:03:45 -04:00
Brian Coca 76e3a9c93a Merge pull request #9894 from 47lining/cloud_modules_sts_support_redux_ansible
Cloud Modules STS Support Redux
2015-03-27 08:20:43 -04:00
Rene Moser 3e7d959c9d cloudstack: module utils are BSD licensed 2015-03-26 15:39:02 +01:00
Rene Moser c066a60b7c cloudstack: fail_json() if library cs is not found 2015-03-26 15:32:58 +01:00
Rene Moser bb6d983290 cloudstack: add utils for common functionality 2015-03-26 14:18:13 +01:00
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
2015-03-25 12:24:49 -07:00
Eri Bastos d4eddabb2a Patch for bug #10485 - ansible_distribution fact populates as 'RedHat' on Oracle Linux systems 2015-03-20 14:40:44 -03:00
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
2015-03-16 13:41:36 -04:00
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.
2015-03-13 15:52:16 -05:00
Toshio Kuratomi 8c3b5690e5 Merge pull request #10357 from htgoebel/devel
Fix detect of docker as virtualization_type.
2015-03-13 11:40:15 -07:00
Brian Coca 17c710e713 Merge pull request #10420 from bmanojlovic/devel
add missing AIX network facts discovery
2015-03-10 15:59:34 -04:00
Boris Manojlovic a59784a581 don't use full path to command instead use module.get_bin_path 2015-03-10 19:44:39 +01:00
Matt Martz 4990814901 Prevent an empty error message 2015-03-10 11:30:28 -05:00
Boris Manojlovic 0f4cf8cb43 add missing AIX network facts discovery 2015-03-10 15:19:29 +01:00
pyroscope d0197195ed Handle /etc/os-release files with 'Raspbian' in them 2015-03-10 08:41:21 +01:00
riedel 29cca0191b Adding oVirt recognition for oVirt guests. oVirt uses KVM. 2015-03-07 10:17:41 -05:00
Monty Taylor 8758ba08bd Update common OpenStack requests-related parameters
Also, update docs related to earlier changes in this stack.
2015-03-06 18:20:45 -05:00
Monty Taylor 8027a8a0b5 Change to auth_type to match python-openstackclient 2015-03-06 18:11:12 -05:00
Brian Coca 761540e9fd Merge pull request #10392 from sgordon46/devel
facts.py throws exception when run on RHEV hypervisor #10383
2015-03-05 12:09:49 -05:00
Brian Coca aed493158c Merge pull request #9428 from landryb/openbsd_add_mount_facts
parse /etc/fstab on OpenBSD to get mount facts
2015-03-05 12:07:27 -05:00
Stephen Gordon b44bf0379b facts.py throws exception when run on RHEV hypervisor #10383 2015-03-05 10:28:26 -06:00
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:/
```
2015-02-28 14:13:58 +01:00
Brian Coca 942ff8d0b9 Merge pull request #10035 from phenomenes/fix_9911
Adds seconds to backup timestamp
2015-02-26 22:44:23 -05:00
Brian Coca 5d729edd2f Merge pull request #9458 from sthen/openbsd_arch
set CPU architecture correctly for OpenBSD (powerpc not macppc, etc.)
2015-02-26 22:41:21 -05:00
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.
2015-02-26 11:35:29 -05:00
Brian Coca 1d90ff8b34 Merge pull request #10304 from dago/ldom
Add LDom support
2015-02-20 08:09:58 -05:00
Dagobert Michelsen c1dba60961 Use try block for field splitting 2015-02-20 13:57:02 +01:00
Dagobert Michelsen 90e760ba84 Add LDom support 2015-02-20 10:11:06 +01:00
Brian Coca 414737557e Merge pull request #10284 from mihirvj/devel-10221
Pulls machine id in ansible facts
2015-02-19 12:56:45 -05:00
Brian Coca e6ac2fa593 Merge pull request #10292 from dago/solaris-mounts
Add support for mounts in Solaris facts
2015-02-19 12:46:37 -05:00
Dagobert Michelsen b82a8576f1 Add support for mounts in Solaris facts 2015-02-19 15:38:20 +01:00
Mihir Joshi 58a5f8dfaf Pulls machine id in ansible facts
- Fix #10221
2015-02-18 17:10:36 -05:00
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
2015-02-16 18:04:16 -05:00
Toshio Kuratomi 8f9b761f3a Merge pull request #10128 from alxgu/fix_facts_for_sles
Fix wrong distribution facts on SLES/openSUSE
2015-02-16 13:24:12 -08:00
Stratos Moros 6caeded74e Fix umask calculation on file creation. Fixes #10257 2015-02-16 21:16:26 +02:00
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
2015-02-16 07:07:58 -08:00
Alexander Gubin d291dae582 Exit loop after detecting os-release 2015-02-16 13:18:11 +01:00
Matt Martz cfd05ceafc Add new rax_find_bootable_volume to assist with boot from volume 2015-02-13 15:25:42 -06:00
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.
2015-02-13 10:42:20 -05:00
Brian Coca 0912781357 Merge pull request #9421 from emonty/features/new-openstack
Add support for new OpenStack modules
2015-02-12 10:26:12 -05:00
Brian Coca 1b4f1e1756 Merge pull request #9555 from bcoca/low_cost_facts
allow fact objects to be instantiated w/o triggering all fact collection
2015-02-11 20:57:40 -05:00
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 2015-02-11 14:53:53 -08:00
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.
2015-02-11 14:04:27 -05:00
pdelared 4c661e2b93 Update facts.py
Added support for HPUX network fact
2015-02-10 17:33:29 +01:00
Toshio Kuratomi 402a6d0533 Explicitly close files opened by facts
Fixes #10157
2015-02-09 14:30:06 -08:00
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
2015-02-09 13:06:33 -08:00
Toshio Kuratomi 4902c06304 Obfuscate passwords in more places where it is displayed 2015-02-09 10:13:13 -08:00
Alexander Gubin 1968f99691 Wrong OS_FAMILY declaration for openSUSE 2015-02-04 09:16:32 +01:00
Toshio Kuratomi f355c11a3f Merge pull request #10129 from RadishTheHut/memfacts-fix
Fix for memory fact gathering
2015-01-30 07:44:58 -08:00
Patrick McConnell 04b2c698ba Updated memory facts fix using dict.get() to avoid KeyError 2015-01-30 05:59:34 +01:00
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
2015-01-29 12:09:19 -08:00
Brian Coca e4a7b973fd Merge pull request #9128 from msabramo/expose_more_user_facts
Expose more facts about user on host system
2015-01-29 09:55:30 -05:00
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.
2015-01-29 15:00:01 +01:00
Alexander Gubin 5dec45e24a Fix wrong distribution facts on SLES/openSUSE 2015-01-29 14:54:53 +01:00
Brian Coca 11005e7b28 Merge pull request #9839 from nousdefions/memfacts
Memfacts
2015-01-28 09:39:24 -05:00
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
2015-01-26 20:39:09 -08:00
Brian Coca 82abe63eb2 Merge pull request #10055 from digi691/devel
Add the uuid of the device in ansible_mounts variable
2015-01-20 15:39:06 -05:00
Toshio Kuratomi e6b5cc9ccb Merge pull request #9887 from lmacken/devel
Use send instead of sendv on the systemd.journal (fixes #9886)
2015-01-20 12:19:42 -08:00
cdigiovanni 99bcbe746f Add the uuid of the device in ansible_mounts variable 2015-01-20 10:58:14 -06:00
Brian Coca 78e1a7ed93 Revert "Fix: Add support for SSL protocol version configuration option" 2015-01-19 08:36:17 -05:00
Jimena Cabrera-Notari 1e865368ac Adds seconds to backup timestamp 2015-01-18 10:56:40 +00:00
Brian Coca 9ccabbb95e Merge pull request #9808 from swimlappy/sslconfig
Fix: Add support for SSL protocol version configuration option
2015-01-16 10:25:48 -05:00
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
2015-01-11 16:42:04 -05:00
Adam Miller 06b70e4f9c When checking for Xen for LinuxHardware processor facts, don't check sysfs if already found in /proc/ 2015-01-08 11:29:11 -06:00
Nate Coraor 60e815c844 Set ansible_distribution_version differently for Solaris variants. 2015-01-07 19:07:12 -05:00
Toshio Kuratomi 5354df8643 s/nexentaStor/Nexenta/ 2015-01-07 15:18:52 -08:00
Toshio Kuratomi 04635333d0 Update fact gathering for solaris-family distributions 2015-01-07 14:38:16 -08:00
Adam Miller f274234824 Only add the overhead for each iteration of cpuinfo parsing if Xen is detected 2015-01-07 08:45:14 -06:00
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
2015-01-06 17:14:38 -06:00
Mick Bass 17498b58bb Add support for AWS Security Token Service (temporary credentials) to all AWS cloud modules. 2014-12-25 13:31:34 -07:00
Luke Macken dea0ee663f Use send instead of sendv on the systemd.journal (fixes #9886) 2014-12-24 14:37:10 -07:00
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
2014-12-22 08:46:20 -05:00
Jonathan Davila a93db1948e expanded facts 2014-12-22 08:24:22 -05:00
Toshio Kuratomi 828adbf788 Merge pull request #9807 from swimlappy/noproxy
Request: Honor the "no_proxy" environment variable in Ansible
2014-12-16 12:53:40 -08:00
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.
2014-12-16 04:47:01 +00:00
root bf916fb58a Adding first pass at win_copy, win_file and win_template modules. 2014-12-16 04:47:01 +00:00
Jonathan Mainguy 8278626dd0 Added distribution facts for OpenSuse 2014-12-15 11:47:42 -05:00
Jason Holland eedc51f213 Add support for SSL protocol version configuration option. Also fix 2 places where the SSL version was not being set properly. 2014-12-13 21:20:33 -06:00
Jason Holland 38dbce1527 Allow Ansible to honor the "no_proxy" environment varaible. 2014-12-13 21:12:23 -06:00
Brian Coca 215359084b Merge pull request #9375 from mantiz/fix-osfamily-and-distribution-on-archlinux
Fix os_family and distribution on archlinux
2014-12-12 14:28:38 -05:00
Michael DeHaan d4da58e102 Merge pull request #9720 from vlajos/typofixes-vlajos-20141204
typofixes - https://github.com/vlajos/misspell_fixer
2014-12-08 14:00:52 -08:00
Veres Lajos bf5d8ee678 typofixes - https://github.com/vlajos/misspell_fixer 2014-12-04 22:23:35 +00:00
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
2014-12-04 11:39:35 -08:00
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 2014-12-01 17:17:54 +02:00
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.
2014-11-26 11:02:25 +01:00
Toshio Kuratomi 9a77aefc33 Special case the lone asterisk fragment in mysql 2014-11-25 08:06:15 -08:00
Toshio Kuratomi 199d6c0b8b Fix some problems with the generic quote char 2014-11-25 02:30:32 -08:00
Toshio Kuratomi fcf0975c90 Fix a few mysql related typos 2014-11-25 01:47:07 -08:00
Toshio Kuratomi 0287e9a23d Normalize the identifier quoting so we can reuse the functions for mysql 2014-11-25 00:45:59 -08:00
Toshio Kuratomi 64a8ad9a21 Remove debugging code 2014-11-24 21:02:24 -08:00
Toshio Kuratomi 067112b5ee Code for modules to perform more robust quoting of database identifiers 2014-11-24 20:55:44 -08:00
Michael DeHaan 2c520655ae Merge pull request #9452 from erjohnso/google_endpoint_provider
Google: allow for different libcloud provider to support upcoming DNS mo...
2014-11-17 06:57:56 -08:00
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.
2014-11-13 18:32:27 -05:00
Brian Coca 0990a71ab5 Merge pull request #9516 from 0x44/new-regions
Support new AWS regions: cn-north-1, eu-central-1.
2014-11-12 16:42:28 -05:00
Toshio Kuratomi b828b25784 Add a fips fact and use it for integration tests 2014-11-12 09:29:21 -08:00
James Cammarata 5bc81f9ae7 Add ability to detect prompts in stdout from run_command 2014-11-12 11:06:15 -06:00
Toshio Kuratomi 9a7eb57718 Some changes to FIPS compat since SLES implements it differently 2014-11-11 20:23:03 -08:00
Toshio Kuratomi 6a85f3ebc7 Add comments/docstrings not to use md5 unless forced to by forces outside our control. 2014-11-10 12:01:44 -08:00
Ding Deng b63ca685df Support new AWS regions: cn-north-1, eu-central-1. 2014-11-08 23:30:26 +08:00
Toshio Kuratomi f1267c0b05 Move from md5 to sha1 to work on fips-140 enabled systems 2014-11-06 21:28:04 -08:00
Matt Martz 047dffdd01 Fix rax_find_loadbalancer issues
* Loadbalancer IDs are not UUIDs
* Ensure found list exists before using it
2014-11-06 16:41:34 -06:00
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.
2014-11-01 12:36:31 +10:00
Stuart Henderson 419872373e set CPU architecture correctly for OpenBSD (powerpc not macppc, etc.) 2014-10-30 13:25:50 +00:00
Eric Johnson a2498bdadd Google: allow for different libcloud provider to support upcoming DNS module 2014-10-29 19:57:46 +00:00
Jure Triglav 2f869a6309 Add the default Homebrew path for OpenSSL certs on OS X 2014-10-29 14:16:01 +01:00
Landry Breuil 792d8d1808 Ignore swap or altroot entries 2014-10-28 10:04:59 +01:00
Landry Breuil d68eb7272e parse /etc/fstab on OpenBSD to get mount facts 2014-10-27 20:27:57 +01:00
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.
2014-10-26 10:52:40 -07:00
Will Thames 5ceb07c65a Add Frankfurt AWS region 2014-10-25 18:17:57 +10:00
James Cammarata 28fd4df787 Merge pull request #9382 from gquintard/WIP/newdockerdetection
Detect docker as virtualization_type
2014-10-20 11:20:34 -05:00
James Cammarata efb40969b3 Merge pull request #9381 from debfx/facts_virt_kvm
Detect kvm guests through sys_vendor.
2014-10-20 10:53:39 -05:00
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".
2014-10-20 10:09:46 +02:00
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)
2014-10-19 23:02:22 +02:00
Christian Hammerl 5efc4efca7 Fix os_family and distribution on archlinux
Fixes #8732, ansible/ansible-modules-core#34
2014-10-18 15:02:04 +02:00
Toshio Kuratomi 139e4767e4 Merge pull request #9329 from mcodd/devel
python2.4 compatibility issue with urlparse
2014-10-14 11:56:34 -04:00
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
2014-10-13 22:57:03 +02:00
Matt Coddington 10113e6a67 python2.4 compatibility issue with urlparse 2014-10-13 16:07:06 -04:00
Toshio Kuratomi 2b9e235ffd Rework distribution fact checking to be a little less heinous and add
support for Mandriva.

Fixes #9282
2014-10-10 10:28:07 -04:00
James Cammarata 2a0d18b092 Insert newlines correctly when splitting literal blocks
Fixes #9274
2014-10-09 16:45:08 -05:00
Toshio Kuratomi a10d10f647 Workaround more python-2.6 shlex not being able to handle unicode strings 2014-10-08 14:30:36 -04:00
Marc Abramowitz e0015395de Expose more facts about user on host system
Adds:
  - `user_uid`
  - `user_gid`
  - `user_gecos`
  - `user_dir`
  - `user_shell`
2014-09-24 14:05:31 -07:00
Jakub Roztocil 0073d2dd92 Remove unreachable code. 2014-09-23 07:13:59 +02:00
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
2014-09-16 12:05:55 -05:00
James Cammarata e54178f904 Catch additional errors in fetch_url
Fixes #8971
2014-09-11 09:47:28 -05:00
James Cammarata 317ab06bc6 Fixing multiline parsing to preserve newlines
Fixes #8813
2014-09-10 15:14:46 -05:00
James Cammarata 8bafc646cb Disable custom https handler for fetch_url on older pythons
Fixes #8898
2014-09-05 13:48:45 -05:00
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.
2014-09-05 07:39:17 -07:00
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
2014-09-04 17:57:52 -07:00
Toshio Kuratomi 4f55bcc298 Standardize on bytes internally to _log_invocation 2014-09-04 11:23:32 -07:00
James Cammarata cd99821f8a Fix py26 difference in ssl socket connect call from 99ba9d6 2014-09-03 10:04:02 -05:00
James Cammarata b827f791e1 Merge pull request #8832 from sivel/rax-validate-regions
rax modules: Perform region validation early
2014-09-02 13:03:31 -05:00
James Cammarata 35dfbff2e1 Merge pull request #8817 from meatballhat/support-sunos-certs-location
Supporting SSL cert location on SunOS (SmartOS, really)
2014-09-02 11:22:14 -05:00
Matt Martz 55ed4489e3 Perform region validation early to be more explicit about invalid region failures 2014-09-02 09:17:40 -05:00
Dan Buch 290f2759e1 Supporting SSL cert location on SunOS (SmartOS, really) 2014-08-29 10:33:14 -04:00
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.
2014-08-29 10:39:42 +02:00
James Cammarata dbc980eaf4 Merge branch 'mischapeters-devel' into devel 2014-08-28 20:31:00 -05:00
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
2014-08-28 20:23:48 -05:00
Michael DeHaan b7082677de Merge pull request #8790 from sivel/issue/8784
Don't use ternary if statements. Fixes #8784
2014-08-28 10:48:32 -04:00
James Cammarata 7fbdbcdec7 Default fetch_url to use TLSv1 instead of SSLv2/3 2014-08-28 08:45:01 -05:00
James Cammarata 99ba9d6e24 Default fetch_url to use TLSv1 instead of SSLv2/3 2014-08-28 08:22:24 -05:00
Matt Martz 2b307985bc Don't use ternary if statements. Fixes #8784 2014-08-27 19:16:48 -05:00
James Cammarata c21c66c740 Merge branch 'file_symbolic_mode' of https://github.com/pbitty/ansible into pbitty-file_symbolic_mode 2014-08-25 19:38:44 -05:00
James Cammarata 3b19b83806 Add GovCloud region to list of regions for AWS
Fixes #8604
2014-08-21 16:12:51 -05:00
James Cammarata 24c4277479 Remove tabs added from 677de07 2014-08-21 14:07:18 -05:00
James Cammarata 5e240fec71 Merge branch 'devel' of https://github.com/l1k/ansible into l1k-devel
Conflicts:
	test/integration/roles/test_copy/tasks/main.yml
2014-08-21 13:56:26 -05:00
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
2014-08-19 10:47:18 -05:00
Lukas Wunner 677de07f44 Try optimistic chown, do not error out if not permitted to chown
Add unit test
2014-08-17 22:08:45 +02:00
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
2014-08-15 11:04:27 -05:00
James Cammarata 600a4657b4 Catch error in atomic_move when creating temporary file
Fixes #8480
2014-08-14 13:26:24 -05:00
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.)
2014-08-14 16:56:11 +02:00
James Cammarata 83fa9a8cde Make sure we only use unquote on quoted lines in lineinfile when needed 2014-08-11 11:23:52 -05:00
James Cammarata 9f34ea54f5 Correct parser to ignore escaped quotes when not in quotes already
Related to #8481
2014-08-11 10:16:58 -05:00
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
2014-08-08 14:58:09 -04:00
Michael DeHaan ea53576759 Merge pull request #6777 from GuiGui2/devel
Setup module: Additional facts when using ansible with Linux on System z
2014-08-08 14:30:49 -04:00
Michael DeHaan 5d05049ee1 Merge pull request #7670 from dagwieers/patch-3
Added cross-platform uptime fact
2014-08-08 14:23:53 -04:00
Michael DeHaan a48328fa12 Merge pull request #7725 from slapers/network-secondaries-issue
fix incorrect secondary ip handling, fixes #7724
2014-08-08 13:50:52 -04:00
James Cammarata 63bf2f6d9a Preserve all line breaks in literal blocks
Fixes #8512
2014-08-08 12:11:15 -05:00
Michael DeHaan d0205b2878 Merge pull request #8500 from sivel/rax-de-dupe
rax: Move additional shared code into module utils
2014-08-08 12:33:35 -04:00
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
2014-08-08 12:17:37 -04:00
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
2014-08-08 11:05:13 -04:00
Michael DeHaan b413a7d7f3 Merge pull request #8449 from emonty/feature/openstack-auth-handling
Handle auth arguments across openstack modules consistently
2014-08-08 10:56:21 -04:00
Bekim Berisha 5272e1099d Keep docstring up to date with the code in basic module 2014-08-07 13:40:57 +02:00
Matt Martz 7d0eba19ab Dedupe PTR record related code in rax_dns_record 2014-08-06 16:47:33 -05:00
Matt Martz 88acb48753 Add ANSIBLE_VERSION to module_utils/basic.py and manipulate the pyrax user-agent 2014-08-06 16:28:42 -05:00
Matt Martz 585fd5a138 Move additional rackspace common code into module_utils/rax.py 2014-08-06 16:26:48 -05:00
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.
2014-08-04 20:55:30 -07:00
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
2014-08-04 15:32:41 -05:00
James Cammarata 74cbeb1292 Default interface type to ipv4 when checking flags for Solaris
Fixes #8330
2014-08-04 13:36:37 -05:00
James Cammarata af0d8cda7b Fix literal block multiline parsing
Fixes #8394
2014-08-04 11:10:07 -05:00
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.
2014-08-02 22:31:27 -07:00
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.
2014-08-02 17:39:19 -07:00
Luke Sneeringer a4fce4818e Add support for environment variables in GCE module. 2014-08-01 11:44:58 -05:00
James Cammarata 7a5076c8b8 Catching shlex splitting error in fact gathering get_cmdline call
Fixes #8352
2014-07-30 14:47:50 -05:00
James Cammarata 189824dd76 Remove whitespace around args
Fixes #8343
2014-07-30 08:51:27 -05:00
James Cammarata e6fa50a306 Move splitter to module_utils so modules can use it and fix command arg splitting
Fixes #8338
2014-07-29 14:55:16 -05:00
Michael DeHaan 645ab7baff Merge pull request #7950 from mesk41in/devel
Fix unsupported regexp parameter in assemble
2014-07-28 12:01:12 -04:00
Michael DeHaan fb60e767a7 Taking alternate approach.
Revert "Fix hostname when get_distribution_version() returns a string."

This reverts commit 08f97c0b9d.
2014-07-28 11:35:33 -04:00
Michael DeHaan 628d828876 Merge pull request #8087 from neersighted/string_version
Fix hostname when get_distribution_version() returns a string.
2014-07-28 11:24:58 -04:00
Michael DeHaan 30e6a659ae Merge pull request #8171 from jbenden/osx-10.10
Support for OS X 10.10 DP3.
2014-07-28 11:08:53 -04:00
Michael DeHaan 20f65f2c79 Merge pull request #8262 from icoloma/patch-1
Bugfix: bulletproof unexpected_error_msg at gce.py
2014-07-28 11:03:54 -04:00
Nacho Coloma 979824eedc Moved import to the top 2014-07-28 08:36:56 +02:00
James Cammarata 10a850c70f Merge branch 'new_arg_splitting' into devel 2014-07-24 21:27:25 -05:00
Michael DeHaan 630f080cf0 Start of unit tests for split_args function, moved split_args to utils since not needed by modules (so far). 2014-07-24 20:15:04 -04:00
Michael DeHaan b5d64fdb36 Some notes/comment upgrades on split_args. 2014-07-24 16:34:06 -04:00
James Cammarata 43154e5101 Using custom splitting function for module param counting 2014-07-24 14:42:35 -05:00
Michael DeHaan e143d7dab7 Merge pull request #7543 from yangliping/fix_local_facts_file_checking_portability
Fix portability issue when checking local facts file permission.
2014-07-24 09:37:22 -04:00
Michael DeHaan 635bea645c Merge pull request #7992 from dehylton/devel
fix swap translation on 4.x openbsd with 2.5.4 python
2014-07-24 09:34:38 -04:00
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.
2014-07-23 16:45:24 +02:00
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)
2014-07-21 11:20:49 -05:00
Joseph Benden da5e32b316 Needs additional divisor. 2014-07-18 07:55:24 -07:00
Joseph Benden b55791ef43 Support for OS X 10.10 DP3. 2014-07-16 12:37:11 -07:00
Ruggero Marchei 909955f2e2 fix get_distribution_version() on amazon linux 2014-07-15 18:04:46 +02:00
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.
2014-07-10 11:27:03 -07:00
Casey Fitzpatrick 7115cb1f37 removed port from domain name qualification, fixes 7941 2014-07-02 19:54:50 -04:00
James Cammarata 81f35323e9 Revert "Fix get_distribution() for platforms that may have spaces"
This reverts commit 2493020d9f.
2014-07-02 09:44:44 -05:00
dewey hylton 379e1a49cb fix swap translation on 4.x openbsd with 2.5.4 python 2014-06-30 17:23:55 -04:00
mesk41in 488aec3936 Fix unsupported regexp parameter in assemble 2014-06-27 13:54:59 +04:00
James Cammarata 9564818e1e Merge branch 'fix_lineinfile_newlines' into devel 2014-06-23 12:38:12 -05:00
Ivo Senner f4fd9d366b Check for empty os-release file, fixes #7885 2014-06-22 04:08:59 +02:00
James Cammarata 3c3c710a58 Merge branch 'module_safe_eval' into fix_lineinfile_newlines 2014-06-20 00:16:52 -05:00
James Cammarata d8bb116c1a Merge branch 'devel' of https://github.com/tgolly/ansible into tgolly-devel 2014-06-19 22:41:58 -05:00
Michael DeHaan 5156794738 Merge pull request #7861 from cchurch/devel
Windows Remote Support
2014-06-19 22:10:41 -05:00
Matt Martz 09dd535296 Make helper functions more robust against undefined powershell objects 2014-06-19 14:26:36 -05:00
Matt Martz df8866b8bd Add examples for how to use powershell common functions 2014-06-19 14:25:50 -05:00
Matt Martz e4e610565c Add convenience function (Get-Attr) for getting an attribute/member from a powershell psobject 2014-06-19 14:25:50 -05:00
Matt Martz 90c98ada7c Add ConvertTo-Bool filter function in powershell common code 2014-06-19 14:25:50 -05:00
Chris Church 243cd877ae Add integration tests for fetch/slurp, make powershell fetch/slurp work as close as possible to existing fetch/slurp modules. 2014-06-19 14:25:28 -05:00
Matt Martz 97f4f56286 Add Exit-Json and Fail-Json powershell helper functions 2014-06-19 14:24:15 -05:00
Matt Martz a25c441300 Add shared functions to module_utils/powershell.ps1 and refactor powershell modules to utilize the common powershell code 2014-06-19 14:24:13 -05:00
James Cammarata 360d8b0fc2 Don't try to scan SSH signatures for non-ssh urls
Fixes #7812
2014-06-18 14:22:20 -05:00
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.
2014-06-18 13:10:39 -05:00
James Cammarata 3529b1cb33 Merge branch '7763' of https://github.com/rmarchei/ansible into rmarchei-7763 2014-06-18 12:16:01 -05:00
Michael DeHaan 627ff30a6f Add module replacer capability for powershell files. 2014-06-17 12:30:34 -05:00
Ruggero Marchei e3f5af377f move get_distribution_version() to basic.py 2014-06-17 10:22:14 +02:00
James Cammarata 9b17e8a555 Merge pull request #7771 from jkramarz/issue-5761
Added missing fallback to hw_sector_size
2014-06-16 15:15:41 -05:00
Matt Bray 578e881142 fix for urls like ssh://git@github.com/ansible/ansible.git 2014-06-16 11:58:59 +01:00
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
2014-06-14 19:42:41 +02:00
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
2014-06-12 16:16:42 -05:00
James Cammarata 395192ffbc Merge pull request #7740 from jkramarz/issue-5761
changed sector size fact source
2014-06-12 08:56:03 -05:00
James Cammarata b4d130d086 Add a new password pattern to the run_command filter 2014-06-12 07:42:25 -05:00
Jakub Kramarz 4e4c9235e8 changed sector size fact source from hw_sector_size to physical_block_size, fixes issue 5761 2014-06-12 12:14:40 +02:00
Stefan Lapers 78f4842982 fix incorrect secondary ip handling, fixes #7724 2014-06-11 09:32:35 +02:00
Dag Wieers fd6f0cb4b4 Update facts.py 2014-06-05 15:09:43 +02:00
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.
2014-06-05 11:58:00 +02:00
James Cammarata 849b0f87ce Fix error when using os.getlogin() without a tty 2014-06-03 09:36:19 -05:00
James Cammarata b94bde9711 Merge pull request #7609 from jimi-c/issue_7553_su_copy
Support checking for su user to atomic_move
2014-05-30 15:46:34 -05:00
James Cammarata 061911c9c2 Merge pull request #7558 from dermute/pkg_mgr
added solaris fact detection for ansible_pkg_mgr
2014-05-27 16:23:31 -05:00
James Cammarata e99df21647 Support checking for su user to atomic_move
Fixes #7553
2014-05-27 16:04:02 -05:00
Alexander Winkler 4980e76a3a added solaris fact detection for ansible_pkg_mgr 2014-05-27 06:40:47 +00:00
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 ':'.
2014-05-26 07:56:46 +02:00