DevOps Classroom Series – 30/Oct/2021

Basic Terminology

  • Convergence:
    • It is the when node (chef-client) interacts with chef-server.
    • During the convergence the chef server responds back with the recipes in run_list configured for the node to be executed.
    • By default the convergence happens every 1/2 hour and this can be changed Preview
  • Resource:
    • In chef resource is smallest unit of work that automates some activity and allows us to express the desired state
    • Refer Here for all the infra resources. Preview

Approach for Automating Deployments

  • To automate any deployment,
    • make a note of all the manual steps involved
    • Try to execute them on some test server to ensure manual steps are correct
  • Once you have consolidated steps, for each step try to find a chef resource.

Activity-1: Installing a Lamp Server on Ubuntu 20.04

sudo apt update
sudo apt install apache2 -y
sudo apt install php libapache2-mod-php php-mysql -y
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
sudo systemctl restart apache2
  • Evalaute whether these commands work or not:
    • Lets create an ubuntu 20.04 vm and execute the commands
    • Navigate to http://<public-ip> Preview
    • Navigate to http://<public-ip>/info.php Preview
  • Goal: To automate the above mentioned manual steps in chef
  • Steps to Achieve:
    • We can start by creating a cookbook
    • finding right resources
    • Expressing the desired state
    • Upload the cookbook
    • Wait for convergence or manually force the chef-client run

Leave a Reply

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

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers

Discover more from Direct DevOps from Quality Thought

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

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube