Skip to Content
Practical Ansible 2
book

Practical Ansible 2

by Daniel Oh, James Freeman, Fabio Alessandro Locati
June 2020
Intermediate to advanced
410 pages
9h 52m
English
Packt Publishing
Content preview from Practical Ansible 2

Authentication

There are two different approaches to obtain a working set of credentials in Google Cloud Platform:

  • The Service Account
  • The Machine Account

The first approach is the suggested one in the majority of cases since the second applies only to circumstances where Ansible is run directly within the Google Cloud Platform environment.

Once you have created the Service Account, you should set the following environmental variables:

  • GCP_AUTH_KIND
  • GCP_SERVICE_ACCOUNT_EMAIL
  • GCP_SERVICE_ACCOUNT_FILE
  • GCP_SCOPES

Now, Ansible can use the proper Service Account.

The second approach is by far the easiest since Ansible will be able to auto-detect the Machine Account if you are running it in a Google Cloud instance.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Ansible - Third Edition

Mastering Ansible - Third Edition

James Freeman, Jesse Keating
Security Automation with Ansible 2

Security Automation with Ansible 2

Akash Mahajan, MADHU AKULA

Publisher Resources

ISBN: 9781789807462Supplemental Content