DevOps Classroom Series – 14/Oct/2021

Ansible Contd

  • Lets start using variables by defining them in the inventory Refer Here

  • Refer Here for the changeset containing group level and host level variables defined in the inventory.

  • Corrected the syntax issue by adding quotes Refer Here for the changeset Preview

  • To improve the readability when the playbook executes lets add some messages by using debug module Refer Here Preview

  • Now add variables for php packages Refer Here for the changes Preview

  • Also refer the to changesets with fix and improvements Refer Here

  • In Ansible we have a module called as package which when executed on ubuntu node behaves like apt and when run on redhat nodes behaves like yum Refer Here

  • Refer Here for the changeset containing changes

  • Areas of improvement:

    • Writing inventory files with both server details and variables will be unmaintable as servers grow, so we need to have different locations for variables and inventories.
    • PHP Info page is still hardcoded in playbook
  • Exercise: Write an Ansible Playbook to deploy the following application Refer Here. You can skip the database part.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin