DevOps Classroomnotes 30/Mar/2022

Lamp Stack Creation using Ansible

  • Refer Here for the changes done to install lamp stack skipping mysql
  • on the redhat7 php-mysql is not found, so removed that variable from host_vars Refer Here

What can be done if the module is not found/available

  • Lets assume sudo ufw app list is the command which we need to execute from ansible but we don’t have module for that
  • In ansible we have some modules like
  • These modules are not idempotent i.e. they execute every time ansible playbook is executed, so when using these modules ensure you build some condition on your own or try to find an alternative module.

Your Organization is Already using a Shell script to deploy application

  • You are asked to create an ansible equivalent.
  • This doesn’t mean to create a shell module and call the script directly if that was the case, they would have used the cron job.
  • Read each statement in shell script and start converting that into ansible task with a suitable module.

Special Variables in Ansible

  • Refer Here for the list of special variables
  • Refer Here for the change set containing some magic variables

Next Steps:

  • Variable Precedence
  • Reusing playbooks
  • Ansible Galaxy

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner