# ProLUG Automation ## Unit 5 Worksheet ## Instructions Fill out this sheet as you progress through the lab and discussions. Hold your worksheets until the end to turn them in as a final submission packet. ## Discussion Questions: ### Unit 5 Discussion Post 1 You know about variable precedence and have decided to study it for your Ansible playbooks. Read and answer the following questions: 1. What is variable precedence and why should it matter? 2. What does it mean to register a variable, and how is that variable used in the playbook? 3. How might variables be useful at the end of an automation, in relation to reporting out what happened in the playbook? ### Unit 5 Discussion Post 2 You’ve stumbled on a playbook and you’re trying to figure out what the following line means: You have reviewed Jinja2 filters and think you have a good handle on what is happening. 1. What is the variable name being called? 2. What is the default value if that variable does not exist or is not populated? 3. What is the reason this might be nice in your executions if you want them always to complete? 4. Is there a danger to always setting default values? 1. Or another way to ask that, is there a tradeoff between always finishing and sometimes having incorrectly set values? 2. Where will you use these in your automations? ## Definitions/Terminology - Workflow - Execution 1. Before 2. During 3. After - Variables - Special Variables - Precedence - Environment Files - Jinja2 - Templates ## Notes During Lecture/Class: ### Links: - Inventories: - Special Variables: - Variable Precedence: - Templates (Jinja2): ### Terms: ### Useful tools: ## Lab and Assignment Unit5 Lab from Lab book ## Digging Deeper 1. Work through the following labs to practice the topics from this week’s presentation 1. Ansible Facts: 2. Ansible Vault: 3. Ansible API Calls: 4. Stamping servers: 5. Reporting back values: 6. Generating CSV for management: ## Reflection Questions 1. What questions do you still have about this week? 2. How are you going to use what you’ve learned in your current role?