Red Hat RHCE - Pearsoncmg

Transcription

Red Hat RHCE 8(EX294) Cert GuideSander van VugtPearson221 River StreetHoboken, NJ 07030 USA

Red Hat RHCE 8 (EX294) Cert GuideCopyright 2021 by Pearson Education, Inc.Editor-in-ChiefMark TaubAll rights reserved. No part of this book shall be reproduced, stored ina retrieval system, or transmitted by any means, electronic, mechanical,photocopying, recording, or otherwise, without written permission fromthe publisher. No patent liability is assumed with respect to the use of theinformation contained herein. Although every precaution has been taken inthe preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damagesresulting from the use of the information contained herein.Product Line ManagerBrett BartowISBN-13: 978-0-13-687243-6Managing EditorSandra SchroederISBN-10: 0-13-687243-3Library of Congress Control Number: 2020941743ScoutAutomatedPrintCodeTrademarksAll terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Pearson IT Certificationcannot attest to the accuracy of this information. Use of a term in this bookshould not be regarded as affecting the validity of any trademark or servicemark.Pearson IT Certification and Sander van Vugt have no affiliation with RedHat, Inc. The RED HAT and RHCE trademarks are used for identificationpurposes only and are not intended to indicate affiliation with or approvalby Red Hat, Inc.Warning and DisclaimerEvery effort has been made to make this book as complete and as accurateas possible, but no warranty or fitness is implied. The information providedis on an “as is” basis. The author and the publisher shall have neitherliability nor responsibility to any person or entity with respect to any lossor damages arising from the information contained in this book.Special SalesFor information about buying this title in bulk quantities, or for specialsales opportunities (which may include electronic versions; custom coverdesigns; and content particular to your business, training goals, marketingfocus, or branding interests), please contact our corporate sales departmentat corpsales@pearsoned.com or (800) 382-3419.For government sales inquiries, please contactgovernmentsales@pearsoned.com.For questions about sales outside the U.S., please contactintlcs@pearson.com.Executive EditorDenise LincolnDevelopment EditorEllie BruSenior Project EditorTonya SimpsonCopy EditorChuck HutchinsonIndexerTimothy WrightProofreaderDonna MulderTechnical EditorsJohn McDonoughWilliam “Bo” RothwellPublishing CoordinatorCindy TeetersCover DesignerChuti PrasertsithCompositorcodeMantra

Contents at a GlanceContents at a GlanceIntroductionxxiiPart I: Introduction to AnsibleCHAPTER 1Understanding Configuration ManagementCHAPTER 2Installing AnsibleCHAPTER 3Setting Up an Ansible Managed EnvironmentCHAPTER 4Using Ad Hoc CommandsCHAPTER 5Getting Started with PlaybooksCHAPTER 6Working with Variables and Facts31531476997Part II: Common Ansible Management TasksCHAPTER 7Using Task Control131CHAPTER 8Deploying FilesCHAPTER 9Using Ansible RolesCHAPTER 10Using Ansible in Large EnvironmentsCHAPTER 11Troubleshooting Ansible173205229251Part III: Managing Systems with AnsibleCHAPTER 12Managing Software with Ansible281CHAPTER 13Managing UsersCHAPTER 14Managing Services and the Boot Process 333CHAPTER 15Managing StorageCHAPTER 16Final Preparation305351383Part IV: Practice ExamsPractice Exam A 387Practice Exam B 391Part V: AppendixesAPPENDIX AAnswers to the “Do I Know This Already?” Quizzes and ReviewQuestions 395APPENDIX BGetting Started with Ansible Tower415iii

ivRed Hat RHCE 8 (EX294) Cert GuideAPPENDIX CRed Hat RHCE 8 (EX294) Cert Guide Exam UpdatesGlossaryIndex433439Online Elements:Practice Exam CPractice Exam DAPPENDIX DMemory TablesAPPENDIX EMemory Tables Answer KeyAPPENDIX FStudy PlannerGlossary431

Table of ContentsTable of ContentsIntroduction xxiiPart I: Introduction to AnsibleChapter 1Understanding Configuration Management 3“Do I Know This Already?” Quiz 3Foundation Topics 6Understanding AutomationWhat Is Automation?66Understanding the DevOps Way of WorkingUnderstanding Infrastructure as CodeOther Automation Solutions88Understanding Ansible Essential ComponentsAnsible Is Python99Ansible Architecture9Understanding Ansible Tower10Understanding the Ansible WayUnderstanding Ansible Use Cases1111Using Ansible for Configuration ManagementUsing Ansible for Provisioning12Using Ansible for Continuous Delivery12Summary 12Exam Preparation TasksReview All Key TopicsDefine Key TermsChapter 2121213Installing Ansible 15“Do I Know This Already?” QuizFoundation Topics71518Understanding an Ansible Environment18Understanding Controller Host RequirementsUnderstanding Installation Methods 20Installing Ansible on RHEL 8Installing Ansible on CentOS 82121Using python-pip to Install Ansible212011v

viRed Hat RHCE 8 (EX294) Cert GuideConfiguring Managed HostsConfiguring the Ansible User2223Setting Up SSH for the Ansible UserConfiguring sudo for the Ansible User2325Summary 26Exam Preparation TasksReview All Key Topics2626Memory Tables 27Define Key Terms27Review Questions27End-of-Chapter Lab 28Lab 2-1Chapter 328Setting Up an Ansible Managed Environment 31“Do I Know This Already?” QuizFoundation Topics3134Understanding Projects 34Configuring Static InventoryListing Hosts3535Inventory Host Groups36Using Inventory in Commands 37Specifying Host Variables38Working with Dynamic Inventory 39Working with Community-Provided Dynamic Inventory ScriptsWriting Your Own Inventory ScriptsUsing Multiple Inventory FilesManaging Settings in ansible.cfg 42Summary 44Exam Preparation TasksReview All Key Topics4444Memory Tables 44Define Key Terms44Review Questions45End-of-Chapter Lab 45Lab 3-145424039

Table of ContentsChapter 4Using Ad Hoc Commands 47“Do I Know This Already?” QuizFoundation Topics4750Understanding Ad Hoc CommandsWorking with Modules53Exploring Essential 54545656Browsing Available Modules58Consulting Module DocumentationUsing ansible-doc5858Using https://docs.ansible.com62Running Ad Hoc Commands from Shell ScriptsSummary 66Exam Preparation TasksReview All Key Topics6666Memory Tables 66Define Key Terms 66Review Questions67End-of-Chapter Lab 67Lab 4-1Chapter 567Getting Started with Playbooks 69“Do I Know This Already?” QuizFoundation Topics6972Exploring Your First Playbook 72From Ad Hoc Commands to PlaybookPlaybook Elements73Running the Playbook 74Undoing Playbook Modifications757264vii

viiiRed Hat RHCE 8 (EX294) Cert GuideWorking with YAML 77Indentation77Using Key-Value Pairs 78Understanding YAML ListsUsing YAML Strings7979Verifying Syntax 80Performing a Playbook Dry RunManaging Multiplay Playbooks8183Multiplay Playbook ConsiderationsMultiplay Playbook Example84Increasing Output Verbosity8683Summary 92Exam Preparation TasksReview All Key Topics9293Memory Tables 93Define Key Terms93Review Questions93End-of-Chapter Lab 94Lab 5-1Chapter 694Working with Variables and Facts“Do I Know This Already?” QuizFoundation Topics9797100Understanding the Use of Variables in Ansible PlaybooksWorking with Ansible FactsGathering Facts101102Understanding How Facts Are DisplayedManaging Fact Gathering 108Working with Custom FactsWorking with Variables109111Defining Variables 112Using Include Files112Managing Host and Group VariablesUsing Multivalued VariablesWorking with Magic Variables113115117Understanding Variable Precedence119104100

Table of ContentsUsing Vault to Manage Sensitive Values 119Understanding Vault 119Managing Encrypted FilesUsing Vault in Playbooks120120Managing Files with Sensitive Variables121Capturing Command Output Using register122Summary 125Exam Preparation TasksReview All Key Topics125125Memory Tables 125Define Key Terms126Review Questions126End-of-Chapter Labs 126Lab 6-1127Lab 6-2127Part II: Common Ansible Management TasksChapter 7Using Task Control 131“Do I Know This Already?” QuizFoundation Topics131134Using Loops and ItemsWorking with Loops134134Using Loops on Variables135Using Loops on Multivalued VariablesUnderstanding with items137Using when to Run Tasks ConditionallyWorking with when139139Using Conditional Test StatementsTesting Multiple ConditionsCombining loop and when141144145Combining loop and registerUsing Handlers136147149Working with Handlers149Understanding Handler Execution and Exceptions154ix

xRed Hat RHCE 8 (EX294) Cert GuideDealing with Failures156Understanding Task ExecutionManaging Task Errors156156Specifying Task Failure ConditionsManaging Changed StatusUsing Blocks158161163Using Blocks with rescue and always Statements164Summary 169Exam Preparation TasksReview All Key Topics169169Memory Tables 170Define Key Terms170Review Questions170End-of-Chapter Lab 171Lab 7-1Chapter 8171Deploying Files173“Do I Know This Already?” QuizFoundation Topics173176Using Modules to Manipulate Files 176File Module Manipulation OverviewManaging File Attributes176Managing File Contents180176Creating and Removing Files 182Moving Files Around183Managing SELinux Properties187Managing SELinux File Context 188Applying Generic SELinux Management TasksUsing Jinja2 Templates194Working with Simple Templates194Applying Control Structures in Jinja2 Using forUsing Conditional Statements with ifUsing FiltersSummary 200198189198197

Table of ContentsExam Preparation TasksReview All Key Topics200200Memory Tables 201Define Key Terms201Review Questions201Exercise Answers201End-of-Chapter Labs 202Lab 8-1: Generate an /etc/hosts File 202Lab 8-2: Manage a vsftpd ServiceChapter 9Using Ansible Roles202205“Do I Know This Already?” QuizFoundation Topics205208Using Ansible Roles208Understanding Ansible Roles208Understanding Role LocationUsing Roles from PlaybooksCreating Custom Roles209210210Managing Role Dependencies213Understanding File Organization Best Practices 213Using Ansible Galaxy Roles214Working with Galaxy 215Using the ansible-galaxy Command 216Managing Ansible Galaxy RolesUsing RHEL System Roles218219Understanding RHEL System RolesInstalling RHEL System Roles220220Using the RHEL SELinux System RoleUsing the RHEL TimeSync System RoleSummary 225Exam Preparation TasksReview All Key TopicsMemory Tables 226Define Key Terms226Review Questions226225226221224xi

xiiRed Hat RHCE 8 (EX294) Cert GuideEnd-of-Chapter Labs 227Chapter 10Lab 9-1227Lab 9-2227Using Ansible in Large Environments 229“Do I Know This Already?” QuizFoundation Topics229232Advanced Inventory Usage232Working with Host Name PatternsConfiguring Dynamic Inventory232233Using the ansible-inventory Command235Working with Multiple Inventory Files 236Optimizing Ansible Processing237Managing Parallel Task ExecutionManaging Serial Task ExecutionIncluding and Importing FilesImporting Playbooks237238239240Importing and Including Task Files242Using Variables When Importing and Including FilesSummary 247Exam Preparation TasksReview All Key Topics247248Define Key Terms248Review Questions248End-of-Chapter Lab 249Lab 10-1Chapter 11249Troubleshooting Ansible 251“Do I Know this Already?” QuizFoundation Topics251254Managing Ansible Errors and LogsUsing Check Mode254254Understanding Output256Optimizing Command Output Error FormattingLogging to Files259Running Task by Task260259243

Table of ContentsUsing Modules for Troubleshooting and TestingUsing the Debug Module263263Using the uri Module 263Using the stat Module 265Using the assert ModuleUsing Tags268271Troubleshooting Common ScenariosAnalyzing Connectivity Issues275275Analyzing Authentication Issues276Summary 277Exam Preparation TasksReview All Key Topics277278Memory Tables 278Define Key Terms278Review Questions278End-of-Chapter Lab 279Lab 11-1279Part III: Managing Systems with AnsibleChapter 12Managing Software with Ansible 281“Do I Know This Already?” QuizFoundation Topics281284Using Modules to Manage Packages 284Configuring Repository AccessManaging Software with yum284285Managing Package Facts 287Using Modules to Manage Repositories and SubscriptionsSetting Up Repositories290Managing GPG Keys 291Managing RHEL Subscriptions292Implementing a Playbook to Manage SoftwareSummary 301Exam Preparation TasksReview All Key Topics302302297289xiii

xivRed Hat RHCE 8 (EX294) Cert GuideMemory Tables 302Define Key Terms 302Review Questions302End-of-Chapter Labs 303Chapter 13Lab 12-1303Lab 12-2303Managing Users305“Do I Know This Already?” QuizFoundation Topics305308Using Ansible Modules to Manage Users and GroupsModules Overview308Managing Users and GroupsManaging sudo308308309Managing SSH Connections313Understanding SSH Connection Management RequirementsUsing the Lookup Plug-in314Setting Up SSH User Keys 314Managing Encrypted Passwords319Understanding Encrypted PasswordsGenerating Encrypted PasswordsUsing an Alternative Approach319319321Managing Users Advanced Scenario Exercise323Summary 329Exam Preparation TasksReview All Key TopicsMemory Tables330330330Define Key Terms 330Review Questions330End-of-Chapter Lab 331Lab 13-1Chapter 14331Managing Services and the Boot Process 333“Do I Know This Already?” QuizFoundation Topics336333313

Table of ContentsManaging Services 336Managing Systemd ServicesManaging cron JobsManaging at Jobs336337338Managing the Boot Process341Managing Systemd Targets341Rebooting Managed Hosts342Managing the Boot Process and Services Advanced Exercise344Summary 346Exam Preparation TasksReview All Key Topics346346Memory Tables 347Define Key Terms347Review Questions347End-of-Chapter Lab 348Lab 14-1Chapter 15348Managing Storage 351“Do I Know This Already?” QuizFoundation Topics351354Discovering Storage-Related Facts 354Using Storage-Related Facts 354Using Storage-Related Facts in Conditional StatementsManaging Partitions and LVMCreating Partitions364364Managing Volume Groups and LVM Logical VolumesCreating and Mounting File SystemsConfiguring Swap SpaceSummary 379Review All Key TopicsMemory Tables 380Define Key Terms380380380367368Configuring Storage Advanced ExerciseExam Preparation Tasks357371366xv

xviRed Hat RHCE 8 (EX294) Cert GuideReview Questions380End-of-Chapter Lab 381Lab 15-1Chapter 16381Final PreparationGeneric Tips383383Verifying Your Readiness383Registering for the Exam384On Exam Day384During the Exam385The Nondisclosure Agreement386Part IV: Practice ExamsPractice Exam A 387Practice Exam B391Part V: AppendixesAppendix A Answers to the “Do I Know This Already?” Quizzes andReview Questions 395Appendix B Getting Started with Ansible Tower415Appendix C Red Hat RHCE 8 (EX294) Cert Guide Exam UpdatesGlossaryIndex433439Online Elements:Practice Exam CPractice Exam DAppendix D   Memory TablesAppendix E Memory Tables Answer KeyAppendix F Study PlannerGlossary431

About the AuthorAbout the AuthorSander van Vugt has been teaching Linux classes since 1995 and has writtenmore than 60 books about different Linux-related topics, including the best-sellingRHCSA-RHCE 7 Cert Guide and the RHCSA 8 Cert Guide: EX200. Sander is alsothe author of more than 25 video courses, including his RHCSA and RHCE Complete Video Courses, Hands-On Ansible LiveLessons, and many other titles. He teachescourses for customers around the world and is also a regular speaker at major conferences related to open-source software. Sander is also the founder of the LivingOpen Source Foundation, a nonprofit organization that teaches open-source coursesin African countries.xvii

xviiiRed Hat RHCE 8 (EX294) Cert GuideDedicationThis book is dedicated to my family: Florence, Franck, and Alex. Together we’ve made greataccomplishments over the past year.

AcknowledgmentsAcknowledgmentsThis book could not have been written without the help of all the people who contributed to it. To start, I want to thank the people at Pearson—Denise Lincoln andEllie Bru in particular. We’ve worked a lot together over the past years, and thisbook is another milestone on our road to success! It has been fantastic how you bothhave helped me to realize this book in just two months!Next, I want to thank my technical reviewers. Big thanks to Bo and John! Thanks toyour great feedback, I’ve been able to apply important improvements to the contentsof this book. Also, a special thanks to Ettiene Esterhuizen from New Zealand andSantos Venter Chibenga and Robert Charles Muchendu from the African LivingOpen Source Community, who helped me as volunteer reviewers. And last but notleast, thanks to my fellow instructor and colleague Pascal van Dam, who helped memake some important last-minute improvements.xix

xxRed Hat RHCE 8 (EX294) Cert GuideAbout the Technical ReviewersJohn McDonough has more than 30 years of development experience; currently,John is a developer advocate for Cisco DevNet. As a developer advocate, John writescode and creates DevNet Learning Labs about how to write code; writes blogsabout writing code; and presents at Cisco Live, SXSW, AnsibleFest, and other industry events. John focuses on the Cisco computing systems products, Cisco UCS, andCisco Intersight. John’s career at Cisco has varied from product engineer to customapplication developer, technical marketing engineer, and now a developer advocate.William “Bo” Rothwell crossed paths with a TRS-80 Micro Computer System(affectionately known as a “Trash 80”) at the impressionable age of 14. Soon after,the adults responsible for Bo made the mistake of leaving him alone with theTRS-80. He immediately dismantled it and held his first computer class, showinghis friends what made this “computer thing” work.Since this experience, Bo’s passion for understanding how computers work and sharing this knowledge with others has resulted in a rewarding career in IT training.His experience includes Linux, UNIX, and programming languages such as Perl,Python, Tcl, and BASH. He is the founder and president of One Course Source, anIT training organization.

Reader ServicesWe Want to Hear from You!As the reader of this book, you are our most important critic and commentator. Wevalue your opinion and want to know what we’re doing right, what we could do better, what areas you’d like to see us publish in, and any other words of wisdom you’rewilling to pass our way.We welcome your comments. You can email to let us know what you did or didn’tlike about this book—as well as what we can do to make our books better.Please note that we cannot help you with technical problems related to the topic of this book.When you write, please be sure to include this book’s title and author as well as yourname and email address. We will carefully review your comments and share themwith the author and editors who worked on the book.Email:community@informit.comxxi

xxiiRed Hat RHCE 8 (EX294) Cert GuideIntroductionWelcome to the Red Hat RHCE 8 (EX294) Cert Guide! With the release of Red HatEnterprise Linux 8, Red Hat has decided to take a completely new direction for theRHCE exam. The exam is now completely about managing configurations withAnsible. This is a great choice because in the current IT landscape the days of thesystem administrator who applies specialized skills to tune individual servers is over.Today the work is all about automation, and Ansible has rapidly become one of themost important solutions to do so.As a Linux instructor with more than 25 years of experience, I have been certifiedfor both the RHCSA and RHCE exams for every RHEL version since RHEL 4.Taking the exams myself has helped me keep current on the progression of theexam, what is new, and what is different. I am thrilled to be able to share my knowledge with you in this comprehensive Cert Guide so you can get the guidance youneed to pass your RHCE RHEL 8 EX294 exam.As you will see, this Cert Guide covers every objective in the updated RHCE exam,with 16 chapters, more than 40 exercises, 4 practice exams (2 printed in the bookand 2 on the companion website), and 1 hour of video training. This Red HatRHCE 8 (EX294) Cert Guide is the best resource you can get to prepare for and passthe exams.Goals and MethodsTo learn the topics described in this book, I recommend that you create your owntesting environment, which is explained in Chapter 2, “Installing Ansible.” You cannot become an RHCE without practicing a lot. To get familiar with the topics in thechapters, here is what I recommend: Read the explanation in the chapters and study the code examples that areprovided in the listings. For your convenience, the listings are also provided inthe book GitHub repository at https://github.com/sandervanvugt/rhce8-book.Study the examples and try to understand what they do. Walk through all of the numbered exercises in the book. The numbered exercises provide step-by-step instructions, and you should follow along with all ofthem, to walk through configuration tasks and learn how to manage specificfeatures. At the end of each chapter, there’s an end-of-chapter lab. This lab is much likethe lab assignments that you will find on the exam.

IntroductionWithin the exercises included in every chapter of the book, you will find all the examples you need to understand what is on the exam and thoroughly learn the material needed to pass it. The exercises in the chapters provide step-by-step proceduredescriptions that you can work through to find working solutions so that you canget real experience before taking the tests. Although you may feel familiar with sometopics, it’s a good idea to work through all of the exercises in the book. The RHCEexam is hands-on, which can be a lot of pressure on test day. The exercises in eachchapter help provide the practice you need to make sure you have the experienceyou need to not make small errors and mistakes while taking the exam. The exercisesare the best way to make sure you work through common errors and learn fromyour mistakes before you take the test.Each chapter also includes an end-of-chapter lab. These labs ask questions that aresimilar to the questions that you might encounter on the exam so you can use themto practice. I have purposely excluded solutions for these labs for a few reasons: (1)you need to train yourself to verify your work before test day because you will beexpected to do this on the exam; (2) while taking the test, you will be required toverify for yourself whether your solution is working as expected; and (3) most labshave multiple solutions and I don’t want to suggest that my solution is the right oneand yours is wrong because it takes a different approach. Your solution is as good asmine, as long as it accomplishes what was asked for in the exercise.Other ResourcesThis book contains everything you need to pass the exam, but if you want moreguidance and practice, I have a number of video training titles available to help youstudy, including the following: Red Hat Certified Engineer (RHCE) 3/ed Complete Video Course Hands-on Ansible LiveLessonsApart from these products, you might also appreciate my website: rhatcert.com.Through this website, I provide updates on anything that is useful to exam candidates. I recommend that you register on the website so that I can send you messagesabout important updates that I’ve made available. Also, you’ll find occasional videoupdates on my YouTube channel: rhatcert. I hope that all these resources provideyou with everything you need to pass the Red Hat exams in an affordable way!Good luck!Who Should Read This Book?This book is written as an RHCE exam preparation guide. That means that youshould read it if you want to increase your chances of passing the RHCE exam.xxiii

xxivRed Hat RHCE 8 (EX294) Cert GuideI have also written this book to help you become familiar with Ansible. So even ifyou’re not interested in the RHCE EX294 exam at all, this book will teach you everything you need to know to get your Ansible career up and running.So, why should you consider passing the RHCE exam? That question is simpleto answer. Linux has become a very important operating system, and qualifiedprofessionals are sought after all over the world. If you want to work as a Linuxprofessional and prove your skills, the RHCE certificate really helps. Having thesecertificates dramatically increases your chances of becoming hired as a Linux professional. Notice that in order to get RHCE certified, you must hold a current RHCSAcertification. You can take the RHCE EX294 exam before you are RHCSA certified,but you can call yourself an RHCE only if you have passed both the RHCSA examand the RHCE exam.How This Book Is OrganizedThis book is organized as a reference guide to help you prepare for the exams. Ifyou’re new to the topics, you can just read it cover to cover. You can also read theindividual chapters that you need to fine-tune your skills in this book. Every chapterstarts with a “Do I Know This Already?” quiz. This quiz asks questions about 10topics that are covered in each chapter and provides a simple tool to check whetheryou’re already familiar with the topics covered in a chapter. These quizzes do notrepresent the types of questions you will get on the real exam though.The best exam preparation is offered in the RHCE practice exams; these are anessential part of readying yourself for the real testing experience. You might beable to provide the right answer to the multiple-choice chapter questions, but thatdoesn’t mean that you can create the configurations when you take the tests. Wehave included two practice exams in the printed book. The book’s companionwebsite then includes two additional practice exams as well as flashcards createdfrom the book’s glossary so you can further test your knowledge and skills. Youwill also find one hour of video from my Red Hat Certified Engineer (RHCE) 3/edComplete Video Course.The following topics are covered in the chapters: Chapter 1, “Understanding Configuration Management”: In this chapter,you learn about Ansible as a solution. The chapter explains what can be donewith Ansible and how Ansible relates to other solutions for configurationmanagement. Chapter 2, “Installing Ansible”: This chapter covers installation of Ansible. Youlearn what is needed to set up the Ansible control node, as well as the otherparts of the Ansible software.

Introduction Chapter 3, “Setting Up an Ansible Managed Environment”: In this chapter youlearn how to get started with node management. The chapter explains whatis needed on the managed nodes as well as the essential Ansible configurationfiles that are required to reach out to the managed nodes. Chapter 4, “Using Ad Hoc Commands”: In this chapter you learn aboutAnsible modules. Modules are the heart of Ansible; they provide solutions foreverything that Ansible can do, and the easiest way to use these modules is inad hoc commands. In this chapter you learn how to work with them. Chapter 5, “Getting Started with Playbooks”: This chapter provides an introduction to working with playbooks. You learn about YAML, the language usedto write playbooks, and how to structure a playbook using plays and tasks. Chapter 6, “Working with Variables and Facts”: In Ansible, variables can beused to provide dynamic values to specific configuration items. Using variablesenables you to separate the static code in a playbook with host-specific information. In this chapter you learn how to work with variables as well as Ansiblefacts, which are variables that are automatically set for managed nodes. Chapter 7, “Using Task Control”: To make Ansible smart, you must apply taskcontrol. Using task control enables you to run tasks conditionally, and that canbe done in many ways. You learn how to use tests, to test for a specific condition, as well as loops that allow you to evaluate a range of items, and handlers,which allow for task execution only if another task was executed successfully. Chapter 8, “Deploying Files”: Ansible is used for configuration management,and configuration on Linux is stored in files. Hence, managing files is a keyskill in Ansible. In this chapter you learn how to use modules to modify filesand how to use templates to automatically set up configuration files with specific parameters obtained from facts or variables. Chapter 9, “Using Ansible Roles”: When you are working with Ansible, it’sgood if code can be reused. That is what Ansible roles are all about. In thischapter you learn how to work with roles, which are provided through AnsibleGalaxy, or as RHEL system roles. Chapter 10, “Using Ansible in Large Environments”: When working with Ansi-ble in large environments, you should know about a few specific techniques.These techniques are covered in this chapter. You learn how to optimizeAnsible by modifying the number of concurrent tasks that can be executed.You also learn how to work with includes and imports, which allow you to setup modular playbooks.xxv

xxviRed Hat RHCE 8 (EX294) Cert Guide Chapter 11, “Troubleshooting Ansible”: In some cases your playbook mightnot give you the desired result. Then you need to start troubleshooting. Thischapter contains not only all you need to know about troubleshooting, including some best practices while developing playbooks, but also informationabout modules that can be used to make troubleshooting easier. Chapter 12, “Managing Software with Ansible”: This is the first chapter aboutspecific common tasks that you can perform with Ansible. In this chapter youlearn how to set up repositories and how to manage software packages withAnsible. Chapter 13, “Managing Users”: To do anything on Linux, you need useraccounts. In this chapter you learn all that is needed to create user accounts,including setting encrypted passwords. Chapter 14, “Managing Services and the Boot Process”: Occasionally, youmight want to run scheduled jobs. These jobs will be executed at a specifictime, using either cron or at. In this chapter you learn how to do that, and youalso learn how to manage the systemd default target. Chapter 15, “Managing Storage”: Setting up storage is a key task whe

Pearson IT Certification cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Pearson IT Certification and Sander van Vugt have no affiliation with Red Hat, Inc. Th