Commit Graph

434 Commits (d427df1ad81281e882adb44dbf14a8d8e93f6b57)

Author SHA1 Message Date
ABond 65c9090714 DigitalOcean inventory deprecation warning (#45054)
Handle DeprecationWarning for ConfigParser in python3

Fixes #45053
6 years ago
Simon Wydooghe 505ce6ccf6 ec2 inventory: python 3.7 compatibility (#43716)
ec2 inventory script was throwing errors when using Python 3.7:

TypeError: option values must be strings

This changes the None ConfigParser options to empty strings instead.
6 years ago
Max Cameron cf1006179d Fixes ec2.py assume_role. (#37357)
* Fixes ec2.py assume_role

Previously when connect_to_aws was called it updated the credentials in place.  "connect_to_aws" is called multiple times: on the second run it tries to assume the same role it is already using, and potentially failing depending on your iam policies.
6 years ago
Yves Martin 2f9a5a75a8 Update vault-keyring to ConfigManager internals (#41967)
Fix failure since ConfigManager changes
6 years ago
Miguel C fa8154db40 Fix #43917 (#43929)
Support upper/lower case resource groups
6 years ago
Matt Martz c1c229c6d4
Remove use of simplejson throughout code base (#43548)
* Remove use of simplejson throughout code base. Fixes #42761

* Address failing tests

* Remove simplejson from contrib and other outlying files

* Add changelog fragment for simplejson removal
6 years ago
Etienne Deneuve 379fb87b44 add group_by_os_family in azure dynamic inventory (#40702) 6 years ago
Abhijeet Kasurde e364d717cb
VMware: remove unused imports (#43804)
Idea taken from https://github.com/ansible/ansible/pull/43402

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Joren Vrancken b954917761 Surround top-level function and class definitions with two blank lines. 6 years ago
Alan Rominger fa45c44026 Update openstack inventory script to keep basic functionality (#43432)
re-applies commit 6667ec4474 which
fixed the plugin to the script so that it will work with current
ansible-inventory.

Also redirect stdout before dumping the ouptput, because not doing
so will cause JSON parse errors in some cases.
6 years ago
Theodotos Andreou bc9a40b32d scaleway: initialise auth_token to none (#43183)
Fixes: #43132
6 years ago
tod-uma 1a0330488f VMware: blacklist custom fields in vmware_inventory.py (#36877)
* Provide the ability to blacklist custom fields from having groups created for them.

* Updated configuration parameter name
6 years ago
Filippo125 5864871fc1 Zabbix inventory improvement (#42669)
* Add validate_certs option to zabbix inventory

* Add validation option

* Fix pep8

* Add changelog
6 years ago
Marcos Alano 82b050e6b8 Changed 'all' group to 'scaleway' group to avoid conflict with real 'all' group. Closes ##35092 (#42367) 6 years ago
smutel f7dbf581b1 Name of global custom attributes are not managed by the inventory (#41786) 6 years ago
Yuwei Zhou 60ea14fe1f Retrive subscription id from env (#42036) 6 years ago
Abhijeet Kasurde c68aa804c4 Remove redundant API method from foreman inventory (#41720)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Monty Taylor 16fb74ffb3
Fix openstack inventory script for multi-cloud case (#41664)
The shift to openstacksdk left us with a bug in that when running bare
with --list, the cloud argument to get_one is None. We just need _one_
of the clouds to pull the cache settings, since they are global (yet,
we'll go back and fix this in sdk)

If it's None, just use get_all and grab the first one.
6 years ago
Jon Dufresne bf304832ff Prefer readthedocs.io instead of readthedocs.org for doc links (#41537)
Read the Docs moved hosting to readthedocs.io instead of
readthedocs.org. Fix all links in the project.

For additional details, see:

https://blog.readthedocs.com/securing-subdomains/

> Starting today, Read the Docs will start hosting projects from
> subdomains on the domain readthedocs.io, instead of on
> readthedocs.org. This change addresses some security concerns around
> site cookies while hosting user generated data on the same domain as
> our dashboard.
6 years ago
Abhijeet Kasurde d65451fa7b
VMware: Add documentation for customValue (#41399)
* VMware: Add documentation for customValue

In order to populate custom values (custom attributes of virtual machine)
inside hostvars, customValue needs to be uncommented under the section
properties in vmware_inventory.ini

* Remove unwanted single quotes from custom_field_group_prefix

Fixes: #41395

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
ABond 5d26477b94 DigitalOcean - Fix TypeError when users have tags named the same as droplets (#41368)
* Fix TypeError when users have tags named the same as droplets
* Updated code based on review comments
6 years ago
Yunge Zhu bd34194ace add adfs_authority_url arg in azure_rm.py (#41071) 6 years ago
rubal033 61c6f4fda1 Fixes #40661 fixed elasticache inventory node limit issue. (#40674)
* fixed elasticache inventory node limit issue

* fixed elasticache inventory node limit issue, sanity fixes

* fixed elasticache inventory node limit issue, sanity fixes

* fixed elasticache inventory node limit issue, spelling corrections

* fixed elasticache inventory node limit issue, removed blank lines
6 years ago
Monty Taylor d0f43bc6f8 Pass cloud parameter to get_one call (#40892)
When we switch this to pull from the CloudRegion object, we missed
passing the parameter along.
6 years ago
Artem Goncharov 89ce826a9f retire shade in favor of openstacksdk for openstack modules (#40532)
* Establish connection through openstacksdk
* Switch from shade to openstacksdk
* fix typo in link to openstacksdk
* remove nova_client usage
* further remove of min_version from openstack modules
6 years ago
Jesse Pretorius 7e603c3cb1 Remove old openstack nova dynamic inventory script (#40465)
This script was deprecated in 2.0.0. There is no point
carrying it around any longer given that there is now
a replacement dynamic inventory script and an inventory
plugin too.
6 years ago
uberlinuxguy bf50274945 Added ability to read config from env. instead of .init for use in Asible Tower (and AWX) (#36179)
* Added ability to read config from env. instead of .init for use in Ansible
Tower (and AWX)

* Detect when NoneType is passed to cache_path

* Formatting fixes
6 years ago
denraf 03e90968c2 Use DOCKER env variables when defined (#36759)
* Use DOCKER_DEFAULT_IP when defined

* default localhost value overwrites DOCKER_TLS_HOSTNAME

* Backward compatibility, allow localhost as default docker_tls_hostname
6 years ago
Yunge Zhu 21ea92feca Fixes #36621, support adfs auth through adal (#37909)
* update username/password auth to use adal lib

* remove default client_id after discussion

* fix lint error: trailing whitespace
6 years ago
Matt Clay 8deced3e04
Fix shebangs and file modes and update tests. (#40563)
* Add execute bit sanity test and apply fixes.
* Add shebang test for `lib` dirs and apply fixes.
* Shebang and execute bit cleanup.
6 years ago
Jon Dufresne 1d640182c6 Update all pypi.python.org URLs to pypi.org (#38988)
For details on the new PyPI, see the blog post:

https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
6 years ago
Peter Farmer 16994bbdca cloudstack: use paging for listVirtualMachines (#40018)
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
6 years ago
John Roach 22456a57de Adding multiple project support for GCE (#39473)
* Adding multiple project support for GCP inventory.

* Adding some documentation on the .ini file
6 years ago
Yuwei Zhou 127cfd4851 add user-agent to Azure API calls, and support MSI/CLI cred for inventory (#39785)
* add user agent

* add msi

* support cli

* check subscription

* lint

* fix lint

* fix lint

* fix lint
6 years ago
Abhijeet Kasurde 5ed81820c0
VMware: Custom Field in vmware_inventory (#39796)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Daryl Banttari e0893aacc5 [ec2 contrib script] Add ability to filter EC2 instances via shell environment (#39034) 6 years ago
Sylvain Rabot 521cc3d4e6 [contrib] azure_rm.py add mechanism to force use of private ip as ansible_host (#36109)
Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
6 years ago
Ondra Machacek fac7b2f1ca ovirt: Clarify secrets configuration (#39501)
Fixes: https://github.com/ansible/ansible/issues/39478
6 years ago
Matt Clay 32d786af65 Convert more http links to https. 6 years ago
Javier Beaumont 8faf9837d0 [cloud][aws] PEP8 renaming in EC2 dynamic inventory (#39164) 6 years ago
Abhijeet Kasurde 12431d23cd VMware: Support for multiple jinja filters in vmware_inventory (#38173)
This fix adds support for multiple jinja filters for groupby_patterns
and host_filters.

Fixes: #37961

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
John Roach 3f2c90914e Fixes Making sure that the key value returns a string to avoid concatenation issues (#37445) 6 years ago
Bill Nottingham 15b6ec66bb Set `raw=True` when reading passwords from ConfigParser files. (#35582)
* Set `raw=True` when reading passwords from ConfigParser files.

The assumption is that no one is actually doing interpolation on the
password value, even if they may for other configuration values, and
passwords are far more likely to contain '%'.

* Add vmware_inventory as well.
6 years ago
Hideki Saito 1b121fc9e4 Fix dynamic inventory for vagrant does not work on python3 (#37631)
* Fix dynamic inventory for vagrant does not work on python3 #35129
6 years ago
Patrick Marques d5cd10c214 Remove unused import from azure dyn inventory (#34980) 6 years ago
Jordan Borean 89a80e0591
Removed windows_azure inventory script to avoid confusion with azure_rm.py (#37439) 6 years ago
Tyler Gregory 6dfc82fe3e Set win_rm protocol to the name, not the full ProtocolTypes object (#37499) 6 years ago
Peter Schiffer 8c992ccbc7 Allow filtering of instances by tags in GCE dynamic inventory (#35770)
* Allow filtering of instances by tags in GCE dynamic inventory

* Optimize instance tags configuration

* Fix for PEP8
6 years ago
Pilou 1c43f7c482 FreeIPA inventory (ipalib 4.6.2): avoid exception (#34356)
Workaround for https://pagure.io/freeipa/issue/7345.

mentions:
- IPA_CONFDIR environment variable when directory doesn't exist
- domain, xmlrpc_uri or jsonrpc_uri parameters when one is missing

Exception was:
$ IPA_CONFDIR=/path/to/empty/dir ./ansible/contrib/inventory/freeipa.py --list
Traceback (most recent call last):
  File "./ansible/contrib/inventory/freeipa.py", line 95, in <module>
    api = initialize()
  File "./ansible/contrib/inventory/freeipa.py", line 18, in initialize
    api.finalize()
  File "local/lib/python2.7/site-packages/ipalib/plugable.py", line 738, in finalize
    self.__do_if_not_done('load_plugins')
  File "local/lib/python2.7/site-packages/ipalib/plugable.py", line 425, in __do_if_not_done
    getattr(self, name)()
  File "local/lib/python2.7/site-packages/ipalib/plugable.py", line 618, in load_plugins
    for package in self.packages:
  File "local/lib/python2.7/site-packages/ipalib/__init__.py", line 949, in packages
    ipaclient.remote_plugins.get_package(self),
  File "local/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 120, in get_package
    server_info = ServerInfo(api)
  File "local/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 26, in __init__
    hostname = DNSName(api.env.server).ToASCII()
AttributeError: 'Env' object has no attribute 'server'
6 years ago
Monty Taylor 0f893027c4 Add a module_utils OpenStack Cloud constructor (#20974)
Start using this to construct shade OpenStack Cloud objects in a
consistent manner. This will let us centralize things like dealing with
password arguments and whatnot. It also allows us to introduce the
ability to pass a fully formed config dict directly to the module.

Migrate all OpenStack modules to use openstack_cloud_from_module.

Have it return the shade library since it's responsible for
importing shade and shade is needed for the exceptions.

Only pull specific OpenStack arguments for the constructor

Rather than passing **module.params to the shade constructor, pull out
only the values that make sense. This should prevent the issues with
module parameters stepping on shade parameters.

Replace module.params.pop with module.params.get

We don't need to pop these anymore since the shade constructor is now
using opt-in values.

Using real urls is ungood. Use example.com domains. Also, get rid of the
antiquated port numbers.
6 years ago