DevOps Classroom notes 08/Oct/2023

Ansible contd

Inventories in Ansible

  • Inventory is collection of nodes.
  • Inventory is of two types
    • Static
    • Dynamic
  • Inventory can be written in two formats
    • ini format
    • yaml format
  • ini format
ipaddress/name

[group1]
ipaddress/name
ipaddress/name

[group2]
ipaddress/name
ipaddress/name

Preview
* Refer Here for inventory documentation
* Yamls for inventories. Refer Here for changeset with inventory in yaml format
Preview
Preview

fact collection

Activity 4: Lets write one playbook for installing php in both redhat and ubuntu

  • What is needed?
    • inventory
    • facts
    • using facts with conditionals Refer Here
  • Refer Here for the changes done
    Preview
  • Add a failback message for unsupported operating systems Refer Here for module. Refer Here for the changes done to the playbook
    Preview
  • Lets parametrize using Ansible variables. Refer Here
  • Adding variables to inventory Refer Here
  • debug module Refer Here
  • Refer Here for the variables added
  • Lets use generic package manager Refer Here
  • Refer Here for loops and Refer Here for the changes done
  • Refer Here for the changes done to move common values (i.e. ubuntu) to group vars and specif host values in host vars.

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

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