DevOps Classroom notes 07/Nov/2024

Ansible contd

Installing spc on redhat 9

  • Manual steps
sudo dnf install java-17-openjdk -y

# for rest of steps refer previous classroom notes
  • Refer Here for the changes done to accomodate the redhat support

Accomodating changes in values

  • For instance, few months down the line i might need to install java 21 or the username should be something else or url etc
  • In ansible we can create variables.
  • Variables can be passed at runtime and also can have default values if not passed
  • Ansible allows to create variables at multiple locations (TBD)
  • Refer Here for offical docs
  • debug module Refer Here

Variables in inventory

  • Generally when we define variables at inventory we have two types of variables
    • host variables:
    • group variables:
  • Refer Here for a host level varaible defined in inventory
  • Updated the playbook to use generic package manager Refer Here
  • Refer Here for the changes to use group variables
  • Ansible provides a better way for creating host and group variables by using host_vars directory and group_vars directory,
  • Refer Here for the changes

Good Practice

  • Ensure you add necessary debug statements to inform users about activities

Templating

  • Ansible uses jinja templates to handle dynamic content in files Refer Here

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