Merge pull request #50047 from rallytime/bp-49605

Back-port #49605 to 2017.7
This commit is contained in:
Nicole Thomas 2018-10-15 13:11:19 -04:00 committed by GitHub
commit 9eb17ea21e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View file

@ -114,6 +114,12 @@ Set up the provider cloud config at ``/etc/salt/cloud.providers`` or
driver: gce
.. note::
Empty strings as values for ``service_account_private_key`` and ``service_account_email_address``
can be used on GCE instances. This will result in the service account assigned to the GCE instance
being used.
.. note::
The value provided for ``project`` must not contain underscores or spaces and

View file

@ -4,3 +4,13 @@ In Progress: Salt 2017.7.9 Release Notes
Version 2017.7.9 is an **unreleased** bugfix release for :ref:`2017.7.0 <release-2017-7-0>`.
This release is still in progress and has not been released yet.
Salt Cloud Features
===================
GCE Driver
----------
The GCE salt cloud driver can now be used with GCE instance credentials by
setting the configuration paramaters ``service_account_private_key`` and
``service_account_private_email`` to an empty string.

View file

@ -129,7 +129,8 @@ def __virtual__():
parameters = details['gce']
pathname = os.path.expanduser(parameters['service_account_private_key'])
if salt.utils.cloud.check_key_path_and_mode(
# empty pathname will tell libcloud to use instance credentials
if pathname and salt.utils.cloud.check_key_path_and_mode(
provider, pathname
) is False:
return False