Commit Graph

293 Commits (d83f254bb683bb3181f78bd0acd52ccb6bfede0f)

Author SHA1 Message Date
James Elford bc9dbf38b0 python 3 compatibility: import guard around ConfigParser
In python3 `ConfigParser` has become `configparser`. Added
an import guard that aliases it back to the old name.
8 years ago
Eric L eb53f3c129 Fix inventory script for Foreman where group by pattern are not prope… (#25173)
* Fix inventory script for Foreman where group by pattern are not properly safe-guarded.

* Fix pep8 error about tab mixed with blanks.
8 years ago
Sloane Hertel e67cdd448e [cloud] EC2 dynamic inventory default filename is documented as ec2.ini - fixes #24396 (#24515)
* the default filename is ec2.ini

(to override that use the env var EC2_INI_PATH)

* allow fallback to ec2.ini
8 years ago
Dag Wieers 758cfeb73e contrib: PEP8 compliancy (#24680)
- Make PEP8 compliant
8 years ago
Abhijeet Kasurde 3a82246d82 Misc typo fix in fleet inventory (#25174)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
8 years ago
Michael b65ebf3519 Fixed import of urlencode and pathname2url from urllib for python3 (#24424) 8 years ago
Jorge Quintás d3c94e82a5 take into account if cache file exists when loading data from digitalocean even with --force-cache 8 years ago
Matt Martz d3249e7875 pep8 fixes for contrib (#24344) 8 years ago
Elijah Lynn c7ae6b9fd5 [cloud][inventory] Get tags for RDS instances. (#23989)
* Get tags for RDS instances.

Boto3 only at this time.

Relates to #11569, #14464.

* Add a check for boto3

* Fix HAS_BOTO3 error
8 years ago
Ondra Machacek 2c58ac1833 inventory: ovirt4: Add support for devices without IP (#24287) 8 years ago
Tom Melendez 9d5c399313 Added subnetwork parameter to inventory instance dictionary. (#23984) 8 years ago
Matt Clay 48eeab8a53 Fix errors reported by pylint. (#23282)
* Fix pylint misplaced-bare-raise errors.
* Fix pylint return-in-init error.
* Fix pylint bad-format-character error.
* Fix pylint too-many-format-args errors.
* Fix pylint too-few-format-args errors.
* Fix pylint truncated-format-string error.
8 years ago
Toshio Kuratomi 6bad4e57bd Migrate most uses of if type() to if isinstance()
Also convert those checks to use abcs instead of dict and list.

Make a sentinel class for strategies to report when they've reache the end
8 years ago
Wayne Witzel III 1a1e12cf46 fetch spacewalk.ini from the environment if set 8 years ago
Tim Rupp 2d8c5e6b8f [openstack] Adds the non-deprecated ansible_host var (#23153)
OpenStack dynamic inventory is still using the deprecated
ansible_ssh_host. This patch adds ansible_host until such
time as ansible_ssh_host is removed
8 years ago
rafstef 25019fe70c Fix vmware property filter (#23228)
Fixes errors on properties that do not exist.
8 years ago
Matt Martz 495a1340a6 Address lxd inventory pep8 error (#23021) 8 years ago
Francisco Ros 0fa797030e Brook inventory (#16122)
* Do not ask for templates in Brook inventory if they do not exist

* Add availability zone variable to Brook inventory

* Add provider id variable to Brook inventory

* Error output sent to stderr in Brook inventory
8 years ago
Andrew Clarke 73438de862 A basic lxd dynamic inventory script (#15848)
* A basic start on an lxd dynamic inventory script

The script is a fairly basic start on an lxd dynamic inventory script. Only tested on ubuntu 16.04 and currently only reports ipv4 container addresses. Improvements to come.

* Updated formatting, indenting and python3 support

Updated to work on python3

* Additional options read from the ini file

Added options for connection and group to the ini file and modified to use these.

Host returned is now the name by default. For non-lxd connection, the ansible_host var is populated with the ip address.

* Additional options for group and connection

* Minor change to re-run tests
8 years ago
Toshio Kuratomi 2fff690caa Update module_utils.six to latest (#22855)
* Update module_utils.six to latest

We've been held back on the version of six we could use on the module
side to 1.4.x because of python-2.4 compatibility.  Now that our minimum
is Python-2.6, we can update to the latest version of six in
module_utils and get rid of the second copy in lib/ansible/compat.
8 years ago
Steve Kuznetsov 6318229bc4 Only read EC2 `regions_exclude` list if necessary (#18720)
When specifying a literal whitelist of AWS EC2 regions in the dynamic
inventory configuration file, it should not be necessary to also include
a literal blacklist, especially as the blacklist is not honored in this
case anyway. By reading the literal blacklist only when necessary, it is
possible for a user to provide a more minimal EC2 configuration file.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
8 years ago
Rune T. Sorensen 6804d69557 [cloud][contrib] IAM role support for EC2 dynamic inventory (#15196)
* EC2 inventory can now connect using an IAM role

* Fix comment indentation

* Make sure that Ec2Inventory.iam_role is always defined

* Add missing import
8 years ago
jctanner 447bb2b150 Add a custom regex_match filter to the vmware_inventory script (#21488) 8 years ago
Markus Liljedahl 67dc8c146e Added support for specifying zone for gce dynamic inventory (#20938) 8 years ago
William Holroyd 4ca7726e75 Fix Elasticcache issue where ec2 script would fail on finding lack of primary endpoint address on Redis cluster (#20190) 8 years ago
Ondra Machacek 0433be33bd ovirt: dyn_inventory fix Python2 and Python3 compat (#22453) 8 years ago
Matt Davis cbedc4a12a azure_rm inventory version comparison fix (#22341) 8 years ago
Damien 2376d891c7 [inventory/aos] Few fixes and small tweaks (#22259)
* Add ads server itself as an host in the inventory

* Comment all value in example

* Add Id in variable list per device

* Centralize code to add device status to variables

* Fix device variable name for blueprint
8 years ago
Damien 8032c9a715 Clean up group name before creation to remove spaces etc .. (#22020) 8 years ago
René Moser 87119479d8 cloudstack: fix pep8 cloudstack inventory (#22092) 8 years ago
Matt Clay dd9a39b27b Make sure all inventory scripts are executable. 8 years ago
Damien 0141c0c336 inventory/Aos - Add session information to group all variables (#21719)
* Add aos.session information to group all variables

* Revert IP address change

* Remove space in empty line for PEP8
8 years ago
Brian Coca 5258e6d52a use safe load instead
fixes #21724
8 years ago
Daniel Lobato García 01436cf186 Add Foreman inventory (#19510)
This commit adds the foreman inventory based on
https://github.com/theforeman/foreman_ansible_inventory
and its configuration file.
8 years ago
Roman Belyakovsky aa6585942e Fix for crash on missing privileges, closes #21051 (#21518) 8 years ago
Loïc Blot d144cf9c27 vmware_inventory: permit to skip nopermission error on host subkeys (notify user in debug mode) (#21663)
example use case: you have rights on guest but you cannot see the VMWare host

Signed-off-by: nerzhul <loic.blot@unix-experience.fr>
8 years ago
Alex Trevino 0d060a185f Allow ec2.py to be imported (#21637) 8 years ago
Matt Clay 3f91e3531a Fix py3 issue in nagios_livestatus inv script. (#21687)
* Fix py3 issue in nagios_livestatus inv script.
* Fix PEP 8 issues.
8 years ago
Yannig 5d0805b25a Add Nagios livestatus inventory plugin. (#12342)
* Add Nagios livestatus inventory plugin.

* Add new capabilities for the nagios_livestatus inventory:
- host_field: set the name returned (default: 'name')
- group_field: set the field used for group (default: 'groups')
- host_filter: filter host using this filter (default: None)

To be more consistent, prefix was renamed into var_prefix.

* Fix py34 runtests errors against print call.
8 years ago
rafstef 8acb6417cb [cloud][inventory] Let ec2.py be renamed and search for a matching .ini file (#21567)
With this proposed PR, we want to make the use of many ec2 dynamic inventory files more flexible.
We are using multiple AWS accounts. We want to use different ini file (one for every account) and only one ec2.py.
8 years ago
Brian Coca e4022906d3 manually integrated from PR #10350 8 years ago
Damien 4d4fdb3500 inventory/apstra_aos - Add a new output format when a blueprint name is provided (#21434)
* Add a new output format when a blueprint name is provided

* Add author name
8 years ago
Ryan S. Brown 3c25a39b3e [cloud][aws] Use binary read for inventory cache file 8 years ago
Alex Trevino 413dfa7273 [cloud][aws] Use `with` statement for file rw in EC2 dynamic inventory (#21390)
* Use with statement when doing rw on files

* Deserialize file-like object directly instead of a string

For python 2/3 compatibility reasons, per PR feedback.
8 years ago
Jonathan McCall 047ed2728c Pass boto_profile to get_route53_records (#14354)
* Pass boto_profile to get_route53_records

* Add conditional around r53_conn to check for boto_profile
8 years ago
Ian White 80bc7048bd Feature: adding route53_hostnames option to set the hostnames from route 53 (#20909)
* adding route53_hostnames option to set the hostnames from route 53

* checking whether the route53_hostnames option is present as suggested by @s-hertel

* setting route53_hostnames to None when config option not present

* skip the to_safe only when using route53_hostnames option, as suggested by @ryansb

* skipping the to_safe strip only for the hostnames that came from route53 as suggested by @ryansb
8 years ago
gregorydulin cf424f0413 [cloud] Add group_by_instance_state to EC2 Dynamic Inventory (#20430) 8 years ago
Allan e246bd10ac Update nsot.py (#19421)
To make this compatible with NSoT v1.x, removing ['data']['devices'].
8 years ago
Damien a995fa43a6 New dynamic inventory for Apstra AOS (#21045)
* Initial release of dynamic inventory for AOS
8 years ago
Ryan S. Brown 9794bd8c35 [cloud][docs] Add more EC2 dynamic inventory stack_filter docs 8 years ago