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

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

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

  • 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 ReplyCancel reply

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

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%