Commit graph

301 commits

Author SHA1 Message Date
Aleksey Zhukov
b7d644d484 Fix broken cache logic 2015-05-14 09:42:48 +03:00
Aleksey Zhukov
3861597696 Bring back cache 2015-05-13 18:12:48 +03:00
Aleksey Zhukov
0d3e015dd1 Update DigitalOcean dynamic inventory to API v2 2015-05-07 22:53:10 +03:00
Brian Coca
69ac1b7eee Merge pull request #9835 from resmo/feature/cloudstack-inventory
cloudstack: add dynamic inventory
2015-05-04 11:30:04 -04:00
Carlos E. Garcia
cfbfd38723 just a few spelling error changes 2015-04-28 09:36:42 -04:00
Rene Moser
d9633037d5 cloudstack: update copyright in dynamic inventory 2015-04-28 09:20:54 +02:00
Rene Moser
9e5a16703b cloudstack: add check for empty inventory 2015-04-28 09:20:54 +02:00
Milamber
bfa71054f5 Fix an issue when the cloudstack installation don't have any instance group 2015-04-28 09:20:54 +02:00
René Moser
92a25b340b cloudstack: add dynamic inventory
Signed-off-by: René Moser <mail@renemoser.net>
2015-04-28 09:20:54 +02:00
Paul Logston
e8768b2b87 Use six to check for string_types 2015-04-25 19:45:22 -04:00
Paul Logston
50932ce556 Use six.moves to import configparser 2015-04-25 17:06:01 -04:00
Paul Logston
1674b47445 Make ec2 inventory plugin Python 3 compatible 2015-04-24 21:14:06 -04:00
James Laska
1359bbee87 Fix traceback with using GCE on EL6 with python-crypto2.6
This fix resolves an issue on EL6 systems where there may be multiple versions
of pycrypto installed.  EPEL provides both `python-crypto` and
`python-crypto2.6`.  These packages are co-installable.  However, modules
importing the `Crypto` library must specify which version to use, otherwise the
default will be used.

This change follows the same pattern established in `bin/ansible` for
specifying python library requirements.
2015-04-20 12:49:25 -04:00
Romain Dartigues
e38eb2589a Undefined names found by pyflakes 2015-04-19 18:18:52 +02:00
Brian Coca
309bbda5c4 Merge pull request #10574 from joefis/patch-1
Vagrant inventory: exit 0 on success
2015-04-15 15:33:16 -04:00
Brian Coca
8d871f9650 Merge pull request #7444 from carsongee/cg/nova_inventory_improvements
Improvements to OpenStack inventory script
2015-04-14 14:59:41 -04:00
Brian Coca
af960fe8d5 Merge pull request #9624 from andrewrothstein/devel
an ansible inventory garnered from fleetctl
2015-04-13 10:06:27 -04:00
Erinn Looney-Triggs
a3b35ed1a6 Small change for FreeIPA < 4.0 compatibility. 2015-04-08 20:33:38 -06:00
John Galt
72457e4326 Fixed typo 2015-04-07 12:19:37 -04:00
Johannes 'fish' Ziemke
c7f3362795 Replace - in ec2 inventory as well
Dash (-) is not a variable ansible group name, so it needs to be replaced as well.
2015-04-06 14:43:39 +02:00
joefis
3a70affb9a Vagrant inventory: exit 0 on success
Current code has sys.exit(1) at the end of the codepath for the
options --help, --list and --host. These are not error conditions
so should be returning 0 for success, not 1 which is EPERM i.e.
"Operation not permitted". Newer Vagrant versions examine the exit
codes from subprocesses and interpret this as a failure.
2015-03-30 16:39:09 +01:00
Kim Johansson
576832e4c9 Always define error before using it
When the error reason is "Forbidden", the code throws a Python exception
rather than simply outputting the exception reason.

It's not nice to throw a Python exception when all the info to display
a proper message is available.
2015-03-27 10:46:01 +01:00
deimosfr
7b63a57993 fix consul inventory issue (missing method param) 2015-03-26 21:40:36 +01:00
Steve Gargan
ada2567dfb log errors and explicitly exit rather than raising exceptions 2015-03-16 20:00:18 +00:00
Steve Gargan
fbff0449ce fix for issue #10422. outputs informative error message when AWS credentials are not available 2015-03-15 12:24:42 +00:00
Monty Taylor
57c81dfcf7 Add documentation for the new OpenStack Inventory 2015-02-26 12:01:27 -05:00
Brian Coca
8be8a7e2f5 Merge pull request #10277 from dago/solaris
Add Solaris zone support for inventory and connection

NOTE: the connection plugin will need some work for v2 (after 1.9 gets released)
2015-02-19 13:13:31 -05:00
Brian Coca
94aca71546 Merge pull request #9475 from jhawkesworth/simple_timer_plugin
Add simple plugin that times ansible-playbook runs.
2015-02-18 15:43:06 -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
Monty Taylor
3188f7f1c1 Add new OpenStack Inventory module
This inventory module is based on the shade library like the new os_
modules. It shares the ability to configure itself from os-client-config
configuration files or from the standard OS_ environment variables.

More importantly the guts of the code to get the server vars is now
shared with os_compute_facts. This means that playbooks that provision
compute hosts and then want to run plays on them can refer to server
variables in exactly the same way whether the provsioning play ran first
or whether the play ran in the context of a pre-existing inventory.
2015-02-11 19:13:31 -05:00
Brian Coca
788889225d Merge pull request #10078 from sgargan/consul
Ansible support for Consul
2015-02-11 13:58:15 -05:00
Dagobert Michelsen
9cf8c3a901 Add support for Solaris zones 2015-02-11 16:48:04 +01:00
Brian Coca
bbe19f8ed2 Merge pull request #10212 from cchurch/vmware_inventory_improvements
VMware inventory script updates from Tower.
2015-02-11 08:47:51 -05:00
Chris Church
48a0b6fb12 VMware inventory script updates from Tower. 2015-02-11 03:06:27 -05:00
Chris Church
05bb31450b Update EC2 inventory script with changes from Tower.
- Adds to changes from #6676 to support nested VPC group and VPC grouping for RDS.

- Adds to changes from #8822 to ignore invalid instance filters.

- Implements grouping by AMI ID based on #7573.

- Implements configuration options to limit which groups are created automatically, based on #7573.
2015-02-11 01:47:37 -05:00
Brian Coca
349b34109b Merge pull request #10138 from bcoca/vbox_inv
initial draft virtualbox inventory script
2015-02-10 10:07:43 -05:00
Brian Coca
100dd7f429 renamed to syslog_json 2015-02-10 09:50:39 -05:00
Brian Coca
7d9908743f small fixes to syslog callback
- renamed to syslog_json (leaving it open to other syslogs in future)
- moved logger to be part of callback object
- made logger configurable through env variables
2015-02-10 09:43:17 -05:00
Brian Coca
542fecfedd Merge pull request #10116 from r1k0/devel
add support for local/remote syslog logging
2015-02-10 09:24:28 -05:00
Arnoud Vermeer
cc4c70120a Make a COLLINS['SOMETHING'] variable instead of ATTRIBS['0']['SOMETHING'] 2015-02-06 15:06:09 +01:00
Brian Coca
5eafa1e7c3 Merge pull request #9825 from kalefranz/ec2-inventory-tags
Allow ec2 tags to be used to address servers in ec2 dynamic inventory.
2015-02-02 12:58:58 -05:00
Brian Coca
d4a89c8ead moved from callback_output to popen to keep 2.6 compat 2015-01-30 15:09:09 -05:00
Brian Coca
368285b351 initial draft virtualbox inventory script 2015-01-30 10:53:21 -05:00
Erick Michau
59e92bc92c add support for local/remote syslog logging 2015-01-28 10:02:36 +01:00
Steve Gargan
c02f114967 Initial commit of Ansible support for the Consul clustering framework (http://consul.io).
Submission includes support for
 - creating and registering services and checks
 - reading, writing and lookup for values in consul's kv store
 - creating and manipulating sessions for distributed locking on values in the kv
 - creating and manipulating ACLs for restricting access to the kv store
 - inventory support that reads the Consul catalog and group nodes according to
     - datacenters
     - exposed services
     - service availability
     - arbitrary groupings from the kv store

This submission makes extensive use of the python-consul library and this is required
as a dependency and can be installed from pip.

The tests were written to target a vagrant cluster which can be setup by following the
instructions here http://github.com/sgargan/consul-vagrant
2015-01-24 01:09:03 +00:00
Erinn Looney-Triggs
d2c49db005 Cleanup and expand FreeIPA inventory script it now accepts CL
parameters.
2015-01-20 15:45:41 -07:00
Chris Meyers
48d4da3a94 add tagless grouping for destinations without any tags 2015-01-16 10:28:34 -05:00
Jason
d39a25d225 Corrected spelling mistake 2015-01-08 17:11:16 +11:00
Michael Scherer
58dbf2446c Fix various inventory scripts to use env python
Fix https://github.com/ansible/ansible/issues/9948
2015-01-07 01:29:19 +01:00
Dan Jenkins
d7b36dd9e7 Add a new inventory group so you can see instances in a particular VPC 2014-12-19 10:39:56 +00:00
Kale Franz
28e69b9017 Allow ec2 tags to be used to address servers in ec2 dynamic inventory. 2014-12-15 22:31:29 -08:00
Sebastien Goasguen
19d40cc54c Add tags for inventory 2014-12-10 11:29:12 -05:00
Andrew Rothstein
4ecaa78c79 incorporated code review feedback 2014-11-28 00:00:35 -05:00
Michael DeHaan
c9ecc51a5e Merge pull request #9530 from sivel/rax-inventory-access-network
rax.py inventory: improvements
2014-11-17 12:12:13 -08:00
Brian Coca
517ae8b29d Merge pull request #9368 from silvax/handle-return-non-on-join
as I read it, the issue is with a None item in the list, not with an empty list (tests return empty string), still fixes a traceback
2014-11-13 18:40:21 -05:00
Matt Martz
2f03e0c906 Support fallbacks for access network and access ip version 2014-11-10 11:54:33 -06:00
Matt Martz
b9b3c0ded6 Support boot from volume discovery 2014-11-10 11:27:39 -06:00
Matt Martz
1e92aadb5a Add support for reading from a config file 2014-11-10 11:27:39 -06:00
Matt Martz
2bd927fd81 Support RackConnect v3 by allowing a network to be specified for use in determining ansible_ssh_host 2014-11-10 11:27:35 -06:00
Sergei Antipov
8e32dda2e2 Delete import json. Several syntax changes.
Import json called twice. In first it will call an exception, if json
module not installed.
2014-11-10 15:41:44 +06:00
Jon Hawkesworth
d2c83bf007 Add simple plugin that times ansible-playbook runs. 2014-11-03 21:30:41 +00:00
James Cammarata
e8f675003f Merge pull request #9336 from dpkirchner/devel
Added _meta hostvars key to gce.py plugin
2014-10-20 14:39:05 -05:00
Andres Silva
4755bde28d adding for loop on list to to handle the return of none when the list is empty. With the previous method if the list was empty the script died. See http://stackoverflow.com/questions/18852324/typeerror-sequence-item-0-expected-string-nonetype-found 2014-10-17 12:16:35 -04:00
szk.kentaro
36c75d6c5e Add --pretty option for gce inventory plugin 2014-10-15 01:16:49 +09:00
David Kirchner
959520115c Added _meta hostvars key to gce.py plugin per the discussion in issue #9291. 2014-10-14 14:43:28 +00:00
Andrew Rothstein
fbc1cd553c an ansible inventory garnered from fleetctl 2014-10-14 07:29:21 -04:00
Adam Young
428674cb90 Inventory Plugin to get hostgroups from FreeIPA 2014-10-10 21:26:17 -04:00
Marc Abramowitz
7cc5ecae52 nova.ini: Distinguish between required and optional settings
Put them in separate sections of config to make it more clear what is
essential and what is not. Also comment out the optional settings.
And remove duplicate mention of `service_type`.
2014-10-01 15:19:05 -04:00
Marc Abramowitz
1560b963aa nova.py: Support OS_AUTH_SYSTEM and OS_REGION_NAME 2014-10-01 15:19:05 -04:00
Marc Abramowitz
cd5edc416c nova.py: Set defaults for OpenStack settings
- auth_system
- region_name
- service_type

These are config settings that could be left out in many scenarios, but
the current code is requiring them. In particular, "service_type" is a
new one in PR #7444 so if we add that and don't set a default, then
existing .ini files won't work:

```
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py",
line 618, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'service_type' in section:
'openstack'
```
2014-10-01 15:19:04 -04:00
Carson Gee
eccb48c8da Improvements to OpenStack inventory script 2014-10-01 15:19:04 -04:00
Michal Gasek
5b5103e6b4 Add support for filtering EC2 instances in dynamic inventory
This allows filtering out EC2 instances based on various different
filters including tags. As requested in 7480 it supports logical "OR"
instead of "AND" on the provided list of filters.
2014-09-03 00:50:28 +02:00
James Cammarata
1880279bfe Tweaking logical assignment of vm_metadata in abiquo inventory script 2014-09-02 11:00:12 -05:00
Daniel
f8104df457 Corrected VM metadata obtention between Abiquo versions 2014-08-28 16:22:06 +02:00
Michael Peters
8b1d6f5e75 fixing "else" typo 2014-08-12 15:48:14 -04:00
Michael Peters
7194fe1064 need to handle the case where include_pattern and exclude_pattern exist in the config file but contain empty strings 2014-08-12 15:40:15 -04:00
Michael DeHaan
3bead39c75 Merge branch 'spelling' of git://github.com/cgar/ansible into devel
Conflicts:
	docsite/rst/guide_rax.rst
	plugins/callbacks/mail.py
2014-08-08 13:28:45 -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
2d2178f2c5 Merge pull request #8516 from mpeters/ec2_dyn_inventory_include_exclude_patterns
adding include_pattern and exclude_pattern options to ec2.py
2014-08-08 11:21:38 -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 Peters
7c2cc15c59 adding include_pattern and exclude_pattern options to ec2.py 2014-08-08 09:26:14 -04: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
Luke Sneeringer
f706eba4a5 Envirionment variable support in GCE inventory plugin. 2014-08-01 16:12:57 -05:00
James Cammarata
0ae87cb725 Merge branch 'ec2inv-rdstoggle' of https://github.com/ingmar/ansible into ingmar-ec2inv-rdstoggle
Conflicts:
	plugins/inventory/ec2.py
2014-07-31 13:38:54 -05:00
James Cammarata
5764015876 Merge branch 'ec2_nested_groups' of https://github.com/cchurch/ansible into cchurch-ec2_nested_groups
Conflicts:
	plugins/inventory/ec2.py
2014-07-31 13:07:31 -05:00
Brian Coca
b65536bc56 removed parent, wasn't very useful and caused problems across versions
fixed cache expiration
2014-07-19 15:54:58 -04:00
Brian Coca
900a9f9556 added environment variables as config overrides for vmware inventory
fixed vmware properties, was getting parent's properties
cache now actually works
removed tags, they were not the ones i was looking for
renamed cache defaults fixed ini file to match
2014-07-19 13:11:31 -04:00
Adam Chainz
13a5993a49 Fix indentation in ec2.py 2014-07-14 10:59:17 +01:00
Michael DeHaan
fa2abe3816 Merge pull request #8089 from ssalevan/ssalevan/add-collins-inventory
Adding a Collins inventory script for Ansible
2014-07-10 16:19:41 -04:00
Steve Salevan
96e815d2b9 Don't write to cache if queries fail 2014-07-10 15:58:44 -04:00
Steve Salevan
71c46efe80 Moving to_safe back into class for consistency purposes 2014-07-10 15:58:44 -04:00
Steve Salevan
e621b3a8cc Adding a Collins inventory script for Ansible 2014-07-10 15:58:44 -04:00
Michael DeHaan
caef3a0de2 Merge pull request #8010 from cchurch/ec2_all_instances
Add option to return all EC2/RDS instances regardless of state.
2014-07-09 13:32:32 -04:00
James Cammarata
366b39cfc1 Merge pull request #8007 from msabramo/nova.py_set_defaults
nova.py: Set defaults for OpenStack settings
2014-07-05 00:36:18 -05:00
Michael DeHaan
51e014d915 Merge pull request #8012 from cchurch/callback_cleanup
Callback plugin cleanup
2014-07-03 19:29:59 -05:00
James Cammarata
67e56853d3 Merge pull request #7996 from msabramo/nova.py_JSON_indented_and_sorted
nova.py: indented and sorted JSON output
2014-07-01 20:10:49 -05:00
Chris Church
afbc7f8a0f Change parameter from pattern to name for playbook_on_play_start in example callback plugins. 2014-07-01 17:06:44 -04:00
Chris Church
955dadf743 Remove runner_on_error callback that is never used. 2014-07-01 17:02:10 -04:00
Chris Church
7f27c56a79 Add option to return all EC2/RDS instances regardless of state. 2014-07-01 15:50:04 -04:00
Chris Church
4036df11cf Add configurable option to support nested inventory groups. 2014-07-01 15:29:39 -04:00