Skip to content

ansible-injection/test-gcp-iaas-roles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test-gcp-iaas-roles

Test boilerplate for Ansible role(s) for GCP IaaS scenarios. For more detail

Requirements

  • ansible client
  • ansible.cfg file and enable gcp_compute plugin
  • service account and gcp account

Structure

Playbook based project structure in Ansible projects.

If you are using role based project structure

your project folder

- ansible.cfg
- hosts
- requirements.yaml        Installs roles under ~/.ansible
- provision.yaml           to run roles w/ your valid vars
- configuration.yaml       to run roles w/ your valid vars

inside ~/.ansible folder

- role1
- role2
- ..

Installation

  • Install Ansible cli on your local w/ brew install ansible, then check ansible --version

Preperations

  • Configure gcloud cli on your local. This will create .ssh/google_compute_engine
  • Create service account manually as ansible and give roles/admin role, or Do automatically
  • Edit ansible.cfg and change remote_user value
  • Edit provision.yaml file and change vars.general.project value

How To Run

  • Run ansible-galaxy install -r requirements.yaml --force to get related roles
  • For provisioning, Run ansible-playbook provision.yaml
  • Edit hosts file, manually. Align network Tags in GCP and host grouping.
  • For configuration, Run, ansible-playbook configuration.yaml -i hosts.

About

Ansible sample boilerplate to inject into the projects that runs on GCP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published