From the course: Complete Guide to Configuration Management Using Ansible
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Lesson 6 lab: Making playbooks flexible with variables - Ansible Tutorial
From the course: Complete Guide to Configuration Management Using Ansible
Lesson 6 lab: Making playbooks flexible with variables
All right. We are now at the end of this lesson. Let's do a lab. So in this lab, you use host variables to define a variable web package and a variable web service, which is set to the appropriate packages for Ubuntu and Red Hat, where Ubuntu is using Apache2, and Red Hat is using httpd. Next, you write a playbook that installs the packages on each distribution based on these variables. As we have not yet talked about conditionals, I advise you not to use conditionals, but write one play for the Red Hat family hosts and another play for the Ubuntu hosts. Good luck.
Contents
-
-
-
-
-
-
-
-
(Locked)
Module 2: Developing flexible playbooks introduction27s
-
(Locked)
Learning objectives1m 5s
-
(Locked)
Separating code from site-specific configuration1m 1s
-
(Locked)
Using variables in a playbook9m 47s
-
(Locked)
Understanding where to define your variables5m 28s
-
(Locked)
Using ansible facts10m 12s
-
(Locked)
Using set_fact4m 10s
-
(Locked)
Understanding different notations for facts and variables4m 48s
-
Using multi-valued variables9m 24s
-
(Locked)
Using magic variables5m 24s
-
(Locked)
Using register3m 15s
-
(Locked)
Using vault to store sensitive information7m 24s
-
(Locked)
Lesson 6 lab: Making playbooks flexible with variables41s
-
(Locked)
Lesson 6 lab solution: Making playbooks flexible with variables6m 39s
-
(Locked)
-
-
-
-
-
-
-