Training #2 Familiar with Inventories and Playbooks
Overview:
Use Ansible with multiple inventories and playbooks.
Practice items:
- – On the Ansible controller node
- – Create a inventory file that contained ungrouped, grouped and nested hosts. Then use command “ansible” and ansible-inventory” to view them. Familiar with way to call and list them.
- – Familiar with multiple inventories. Create another inventory file that contained different group of hosts. View all of hosts in the created inventory files, which include hosts created previously.
- – Create a playbook to do following tasks on target group:
- + Prompt to perform PING test.
- + Single package installation
- + Multiple packages installation.
- + User account creation: linda, laura, lori and bob
- + Gather accounts’ info, eg. id <username>
- + Display gathered information on accounts and some system fact like OS distribution.
- – Create four playbooks: init, discovery, main and cleanup. The “init” playbook will initiate other playbooks.
- + init playbook calls playbooks in play in orders: discovery -> main -> clean-up.
- + discovery playbook contains host discovery.
- + main playbook contains main play/configuration: create user and file.
- + cleanup: remove the file.
Practice items with some samples:
- See initial post: Ansible playbook examples and techniques.
Thanks for this informative post! Really appreciate how you break down complex concepts into digestible chunks. I’ve been working on similar projects lately. Keep up the fantastic work – your explanations are always crystal clear! #0yPe0HaM
素晴らしいチュートリアルです!分かりやすくて理解が一気に進みました。ちなみに、顔文字を探すときは https://kaomoji.one も便利でした。丁寧な解説ありがとうございます! #Ob4yfbx4