Implementation of Ansible
Deployment of multi node servers with Ansible
Didiet A. Pambudiono
Operational Engineer Dicoding
didiet@dicoding.com
About Me
●
Former System Administration and Network Engineer @ catfi.com
●
Operational Engineer @ dicoding.com :
– Site Reliability
– Chaos Experiment
– Observability
●
Member of Kelompok Linux Arek Suroboyo (KLAS), openSUSE-Id and LibreOfce-Id
●
Use openSUSE since 2005
●
Rarely use Ubuntu server by request
●
Used to be a Windows user a long time ago
●
Website :
https://medium.com/@pambudiono.os
About dicoding
● 1st Developers Hub in Indonesia
● Connecting developers with global market opportunities through
three pillars: academy, challenge, and event.
● So far we have more than 120k users
● Our clients i.e. : Microsoft, Google, Go-Jek, IBM, Bekraf, etc
● Our trainings i.e. : Android Dev Expert, Game Dev Expert,
Kotlin Expert, etc
● Need more information? Please visit : https://www.dicoding.com
Before we use ansible
●
We need about 30m to deploy a single server for
webserver and we have 3 webserver
●
We need more than an hour to setup 3 database
servers include galera replication system
●
And we need more than an hour to setup a pair of
redis server with master-slave replication
What we need :
●
Inside the webserver :
– Php7.2
– Apache
– Laravel
– Beanstalkd
●
Inside the database server :
– Mariadb
– Galera cluster replication
●
For session storage :
– Redis
– Replication master-slave
Struggle
●
Too many terminal console
●
Missing part
●
One server sometimes is not identic with the others
●
Need more times to deploy
What we need?
●
A tool for the solution of our problems
●
We need less time to build our new platforms
●
We need to simplify our deployment process
Why Ansible?
●
Simplifying automation
●
Lower Learning Curve
●
Mutable Infrastructure
●
No Agents: Only an “Ansible Control”
●
Automate right now
How we do it?
●
Build a playbook for webserver deployment :
– Install apache2 with modules and confguration fles
– Install php7.2 and the confguration fles
– Install beanstalkd and the confguration fles
– Add new users for maintenance
– Install composer with all dependencies
How we do it?
●
Build a playbook for database server deployment :
– mariadb
– Galera cluster
– Master-master replication
How we do it?
●
Build a playbook for session storage deployment :
– redis
– Redis Master-Slave replication
Playbook for
webserver diagram
Playbook for
database server diagram
Playbook for
storage server diagram
We use ansible for
●
Build new clusters for :
– Webserver
– Database
– Storage session
– Imutable update and installation
Conclususion
●
What we get :
– Less time deployment (less than an hour)
– Minimiie the risk
– No need CTO for deployment
– Everyone in DevOps Division can build the cluster

Ansible deployment

  • 1.
    Implementation of Ansible Deploymentof multi node servers with Ansible Didiet A. Pambudiono Operational Engineer Dicoding didiet@dicoding.com
  • 2.
    About Me ● Former SystemAdministration and Network Engineer @ catfi.com ● Operational Engineer @ dicoding.com : – Site Reliability – Chaos Experiment – Observability ● Member of Kelompok Linux Arek Suroboyo (KLAS), openSUSE-Id and LibreOfce-Id ● Use openSUSE since 2005 ● Rarely use Ubuntu server by request ● Used to be a Windows user a long time ago ● Website : https://medium.com/@pambudiono.os
  • 3.
    About dicoding ● 1stDevelopers Hub in Indonesia ● Connecting developers with global market opportunities through three pillars: academy, challenge, and event. ● So far we have more than 120k users ● Our clients i.e. : Microsoft, Google, Go-Jek, IBM, Bekraf, etc ● Our trainings i.e. : Android Dev Expert, Game Dev Expert, Kotlin Expert, etc ● Need more information? Please visit : https://www.dicoding.com
  • 4.
    Before we useansible ● We need about 30m to deploy a single server for webserver and we have 3 webserver ● We need more than an hour to setup 3 database servers include galera replication system ● And we need more than an hour to setup a pair of redis server with master-slave replication
  • 5.
    What we need: ● Inside the webserver : – Php7.2 – Apache – Laravel – Beanstalkd ● Inside the database server : – Mariadb – Galera cluster replication ● For session storage : – Redis – Replication master-slave
  • 6.
    Struggle ● Too many terminalconsole ● Missing part ● One server sometimes is not identic with the others ● Need more times to deploy
  • 7.
    What we need? ● Atool for the solution of our problems ● We need less time to build our new platforms ● We need to simplify our deployment process
  • 8.
    Why Ansible? ● Simplifying automation ● LowerLearning Curve ● Mutable Infrastructure ● No Agents: Only an “Ansible Control” ● Automate right now
  • 9.
    How we doit? ● Build a playbook for webserver deployment : – Install apache2 with modules and confguration fles – Install php7.2 and the confguration fles – Install beanstalkd and the confguration fles – Add new users for maintenance – Install composer with all dependencies
  • 10.
    How we doit? ● Build a playbook for database server deployment : – mariadb – Galera cluster – Master-master replication
  • 11.
    How we doit? ● Build a playbook for session storage deployment : – redis – Redis Master-Slave replication
  • 12.
  • 13.
  • 14.
  • 15.
    We use ansiblefor ● Build new clusters for : – Webserver – Database – Storage session – Imutable update and installation
  • 16.
    Conclususion ● What we get: – Less time deployment (less than an hour) – Minimiie the risk – No need CTO for deployment – Everyone in DevOps Division can build the cluster