Playbooks to create simple instances of gce centos/apache with load balancing
- Steps described in Google Cloud Platform Guide
You need to modify the playbooks with the corresponding variables of your GCP account:
vars:
service_account_email: _Your_gce_service_account_email_
credentials_file: _Your_json_credentials_file_
project_id: _Your_project_id_
metadata: '{"sshKeys":" _Your_gce_user:_Your_rsa_public_key_ "}'
remote_user: _Your_gce_user_
These playbooks were successfully tested in Fedora 34 and CentOS 8 Stream with Ansible 2.9 @ 2021.
You need to run the playbook specifying the private key file to connect to the gce instances:
$ ansible-playbook gce-lb-apache.yml --key-file _Your_rsa_private_key_path_
All parts of this material are made available under the terms of the MIT License.
This playbooks was created in 2018 and updated in 2021 by Alex Callejas, blog rootzilopochtli.com.