CI/CD Pipeline through Ansible-Playbook Automation with docker

Harshet Jain
5 min readAug 9, 2020
CI/CD Automation on Jenkins Using Ansible

Hey everyone,

Today I want to show you a CI/CD automation of Jenkins through Ansible. This is a fully Automated system from just after uploading the code to GitHub to ready the web-server but behind the scene, there is a lot of things. I want to show you all the process which I do to set up this Automated system.

You Know about GitHub, Jenkins, Docker as I talk about this so many times. But, what is Ansible ?

Configuration Management

Ansible is an open-source software provisioning, configuration management, and application-deployment tool enabling infrastructure as code. It runs on many Unix-like systems, and can configure both Unix-like systems as well as Microsoft Windows. It includes its own declarative language to describe system configuration. Ansible was written by Michael DeHaan and acquired by Red Hat in 2015. Ansible is agentless, temporarily connecting remotely via SSH or Windows Remote Management to do its tasks. For more info you can take reference from here

There are two ways in Ansible to write the code.

  • Ansible ad-hoc command: An ansible ad-hoc command is a one-line command that lets you perform basic tasks efficiently without writing playbooks. An Ansible ad-hoc command uses ansible command-line tool to automate a single task on one or more managed nodes. Ad-hoc commands are quick and easy, but they are not reusable. Ad-hoc commands demonstrate the simplicity and power of Ansible. To know more about this, you can click here.
  • Ansible-Playbooks: Playbooks are nothing but files consisting of your written code, and…



Harshet Jain

Passionate Tech Enthusiast, Researcher & Writer. DevOps Engineer by profession. Connect with me: