SlideShare a Scribd company logo
1 of 11
Download to read offline
Esther Lozano | @esloho
Set up the place: GCE
- Create project and add instances in Google Cloud Engine
- Check the first steps tutorial for VM instances
- Add ssh public key to project
- Compute engine → Metadata → SSH keys
- Test ssh connection from your local
- Create service key and download it (i.e. ansible_service_account.json)
- IAM & admin → Service account → Create key
- Place it into your ansible project
- Install gcloud in your local machine (optional)
Manage invitations: Ansible
- Copy from contrib/inventory files gce.ini and gce.py into your inventory
- Download from https://github.com/ansible/ansible
- Create secrets.py
- Use absolute path or relative to playbook execution for ansible_service_account.json
- Indicate absolute path of secrets.py in gce.ini
- pip install apache-libcloud
- Test the gce connection
- $ inventory/gce.py --list
- $ ansible all -u esloho -i inventory/gce.py -m ping
Party!
- Run your playbooks as usual
- $ ansible-playbook -i inventory monitoring.yml
- Select hosts by network tag from your gce instances
- hosts: tag_mongo
- hosts: all:!tag_http_server
- Host configuration (host_vars, --limit, hosts…) by instance name
- Possible to combine static inventory and dynamic gce.py
Some party favors
- Ansible documentation for GCE
http://docs.ansible.com/ansible/latest/guide_gce.html
- Managing SSH keys in GCE
https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys
- Service account keys and permissions
https://cloud.google.com/iam/docs/service-accounts
- Github repository of this demo https://github.com/esloho/ansible-gce-demo

More Related Content

What's hot

From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShift
Eric D. Schabell
 

What's hot (20)

RedisGears: Meir Shpilraien
RedisGears: Meir ShpilraienRedisGears: Meir Shpilraien
RedisGears: Meir Shpilraien
 
Terraform and cloud.ca
Terraform and cloud.caTerraform and cloud.ca
Terraform and cloud.ca
 
RedisGears
RedisGearsRedisGears
RedisGears
 
Concourse webhook
Concourse webhookConcourse webhook
Concourse webhook
 
Concourse and Database
Concourse and DatabaseConcourse and Database
Concourse and Database
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Scalable Event Tracking
Scalable Event TrackingScalable Event Tracking
Scalable Event Tracking
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoin
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
ConcourseCI love Minio
ConcourseCI love MinioConcourseCI love Minio
ConcourseCI love Minio
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShift
 
Зоопарк React-у
Зоопарк React-уЗоопарк React-у
Зоопарк React-у
 
Automating Aegir Platform builds with Git; Fabric; and Drush
Automating Aegir Platform builds with Git; Fabric; and DrushAutomating Aegir Platform builds with Git; Fabric; and Drush
Automating Aegir Platform builds with Git; Fabric; and Drush
 
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesComandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
 
Docker včera, dnes a zítra
Docker včera, dnes a zítraDocker včera, dnes a zítra
Docker včera, dnes a zítra
 
OSCONF - April 2021 - Run GitHub Actions Locally with nektos/act and Docker
OSCONF - April 2021 - Run GitHub Actions Locally with nektos/act and DockerOSCONF - April 2021 - Run GitHub Actions Locally with nektos/act and Docker
OSCONF - April 2021 - Run GitHub Actions Locally with nektos/act and Docker
 
Alexandr Marchenko "Kubernetes - easy peasy"
Alexandr Marchenko "Kubernetes - easy peasy"Alexandr Marchenko "Kubernetes - easy peasy"
Alexandr Marchenko "Kubernetes - easy peasy"
 
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow managementIntro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
 
COSCUP 2017 - infrastructure As Code
COSCUP 2017 - infrastructure As Code COSCUP 2017 - infrastructure As Code
COSCUP 2017 - infrastructure As Code
 
[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator
[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator
[Kotlin Serverless 工作坊] 單元 4 - 實作 RSS Aggregator
 

Similar to Ansible party in the [Google] clouds

Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppet
Carl Caum
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Tenchi Security
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Alexandre Sieira
 

Similar to Ansible party in the [Google] clouds (20)

GCE 上搭配 Cloud Storage 建置 Drone CI
 GCE 上搭配 Cloud Storage 建置 Drone CI GCE 上搭配 Cloud Storage 建置 Drone CI
GCE 上搭配 Cloud Storage 建置 Drone CI
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Contributing to an os project
Contributing to an os projectContributing to an os project
Contributing to an os project
 
Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deployment
 
AWS ground zero; EC2 & S3 hands-on
AWS ground zero; EC2 & S3 hands-onAWS ground zero; EC2 & S3 hands-on
AWS ground zero; EC2 & S3 hands-on
 
Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppet
 
Deploy a compute instance with a remote startup script
Deploy a compute instance with a remote startup scriptDeploy a compute instance with a remote startup script
Deploy a compute instance with a remote startup script
 
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic TrainingGCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
 
Deploy django apps using docker
Deploy django apps using dockerDeploy django apps using docker
Deploy django apps using docker
 
Google cloud essential skills challenge lab
Google cloud essential skills challenge labGoogle cloud essential skills challenge lab
Google cloud essential skills challenge lab
 
DevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChungDevFest 2022 - Cloud Workstation Introduction TaiChung
DevFest 2022 - Cloud Workstation Introduction TaiChung
 
Ansible Automation Inside Cloudforms ( Embedded Ansible)
Ansible Automation Inside Cloudforms ( Embedded Ansible)Ansible Automation Inside Cloudforms ( Embedded Ansible)
Ansible Automation Inside Cloudforms ( Embedded Ansible)
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Automating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and AnsibleAutomating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and Ansible
 
Basic Rails Training
Basic Rails TrainingBasic Rails Training
Basic Rails Training
 
Set up a Development Environment in 5 Minutes
Set up a Development Environment in 5 MinutesSet up a Development Environment in 5 Minutes
Set up a Development Environment in 5 Minutes
 
Automation in the Small: Code to Cloud
Automation in the Small: Code to CloudAutomation in the Small: Code to Cloud
Automation in the Small: Code to Cloud
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
 

More from Esther Lozano

More from Esther Lozano (6)

Aterrizando en JS: Consejos para [node]sesperar en el intento
Aterrizando en JS: Consejos para [node]sesperar en el intentoAterrizando en JS: Consejos para [node]sesperar en el intento
Aterrizando en JS: Consejos para [node]sesperar en el intento
 
Aterrizando en JS: consejos para [node]sesperar en el intento
Aterrizando en JS: consejos para [node]sesperar en el intentoAterrizando en JS: consejos para [node]sesperar en el intento
Aterrizando en JS: consejos para [node]sesperar en el intento
 
Una Javera en JS: consejos para [node]sesperar en el intento
Una Javera en JS: consejos para [node]sesperar en el intentoUna Javera en JS: consejos para [node]sesperar en el intento
Una Javera en JS: consejos para [node]sesperar en el intento
 
The... Wonderful? World of Lambdas
The... Wonderful? World of LambdasThe... Wonderful? World of Lambdas
The... Wonderful? World of Lambdas
 
Geb+spock: let your functional tests live long and prosper
Geb+spock: let your functional tests live long and prosperGeb+spock: let your functional tests live long and prosper
Geb+spock: let your functional tests live long and prosper
 
Geb+spock: larga y próspera vida a tus tests funcionales
Geb+spock: larga y próspera vida a tus tests funcionalesGeb+spock: larga y próspera vida a tus tests funcionales
Geb+spock: larga y próspera vida a tus tests funcionales
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Ansible party in the [Google] clouds

  • 1. Esther Lozano | @esloho
  • 2. Set up the place: GCE - Create project and add instances in Google Cloud Engine - Check the first steps tutorial for VM instances - Add ssh public key to project - Compute engine → Metadata → SSH keys - Test ssh connection from your local - Create service key and download it (i.e. ansible_service_account.json) - IAM & admin → Service account → Create key - Place it into your ansible project - Install gcloud in your local machine (optional)
  • 3.
  • 4.
  • 5.
  • 6. Manage invitations: Ansible - Copy from contrib/inventory files gce.ini and gce.py into your inventory - Download from https://github.com/ansible/ansible - Create secrets.py - Use absolute path or relative to playbook execution for ansible_service_account.json - Indicate absolute path of secrets.py in gce.ini - pip install apache-libcloud - Test the gce connection - $ inventory/gce.py --list - $ ansible all -u esloho -i inventory/gce.py -m ping
  • 7.
  • 8. Party! - Run your playbooks as usual - $ ansible-playbook -i inventory monitoring.yml - Select hosts by network tag from your gce instances - hosts: tag_mongo - hosts: all:!tag_http_server - Host configuration (host_vars, --limit, hosts…) by instance name - Possible to combine static inventory and dynamic gce.py
  • 9.
  • 10.
  • 11. Some party favors - Ansible documentation for GCE http://docs.ansible.com/ansible/latest/guide_gce.html - Managing SSH keys in GCE https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys - Service account keys and permissions https://cloud.google.com/iam/docs/service-accounts - Github repository of this demo https://github.com/esloho/ansible-gce-demo