Trending Technology Machine Learning, Artificial Intelligent, Block Chain, IoT, DevOps, Data Science

Recent Post

Codecademy Code Foundations

Search This Blog

playbooks in Ansible for DevOps

Ansible -Playbooks :

Playbooks are the files where Ansible code is written.

Playbooks are written in YAML format.

YAML stands for Yet Another Markup Language.

Playbooks are one of the core features of Ansible and tell Ansible what to execute.

Playbook Structure  : Playbooks are structured using plays

The function of the play is to map a set of instructions defined against a particular host.

Create a Playbook :

   name: install and configure DB
   hosts : testServer
   become : yes
   vars : 
      oracle_db_port_value : 1521
   tasks :
   - name : Install the Oracle DB
       yum : <code to install the DB>
  - name : Ensure the installed service is enabled and running 
   service :
     name : <Your services name > 

The Different YAML Tags :
  • name
  • hosts
  • vars
  • tasks

No comments:

Post a Comment

Popular Articles