DevOps Classroom notes 05/Mar/2024

Ansible Contd

Ansible Roles and Collections

  • DRY (Dont Repeat Yourself) Principle: This speaks about reusability
  • Ansible has 3 popular ways of reusability
    • including or importing ansible playbooks
    • using roles
    • using collections
  • Reusability can be acheived in two ways
    • reusable tasks in the form of roles or collections or playbooks
      • this requires re-arranging the playbooks
    • reusable modules:
      • This requires writing python code
  • Re-using tasks:
    • import or include tasks
  • Example with include tasks Refer Here

Roles

  • Role is a reusable playbook. Refer Here
  • Ansible Galaxy hosts lots of reusable community roles Refer Here
  • Refer Here for the changes done to install apache using community role
  • Refer Here for refactoring playbook into role

Ansible Variables

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%