### Week 7 ### Session 1 ### Infrastructure as a Code (Automating System Administration tasks) ### Nataliya Tupikina --- ### Please briefly explain Ansible templates and Ansible Galaxy Ansible templates include needed configuration parameters, where the dynamic values are given as variables. When we execute the playbook, the variables will be relaced with corresponding values. Ansible Galaxy is a public repository of Ansible roles where the usage of roles and available variables are explained as well.The new roles are being added very often. Roles can be reused for configuration of servers and the installation of apps. ### Using Ansible playbook, Install docker on the client and run the "r3dw0lf/secondapp" image on the client (SecondApp is a web server running on port 85). Open the new website. ![](https://i.imgur.com/1WsWfgT.jpg) ![](https://i.imgur.com/Mcb4hdM.jpg) ![](https://i.imgur.com/0HExpZL.jpg) ![](https://i.imgur.com/Mrnce7f.jpg) It seems like some problem with python? honestly I don't know how to solve it, none of my classmates faced this problem and the google can't help too ![](https://i.imgur.com/7s5hbgD.jpg) ### Create an Ansible playbook which can update the client machine (apt update, apt upgrade), prepares the client's machine to join OpenLDAP (from graphical interface). Didn't really understand how to do it. Update/Upgrade didn't work when I tried to use playbook to do it. --- ## Bonus 1: Explain Terraform with small example. Terraform can be used for building and updating infrastructure as code in various cloud providers while also havung a version control system. Terraform can generate an execution plan. Can be used to create same environment in many places. Example where it can be used instead of other infrastructure as code alternatives: multi-tier apps. At first we have 2-tier architecture to which more tiers are added independently if needed, achieving n-tier architecture.