Section One Flashcards
Why use Ansible instead of Shell scripts
shell scripts can’t be used on a wide range of different devices
It’s difficult to write shell scripts that produce the same results in every situation
What is DevOps?
Development Operator
coding - develop and review code
building - Changing source code and convert to a working app
testing
packaging - Delivering code to end users by bundling it into packages and offering in a repo
releasing - Approving, managing, and automating new software release
configuring - Managing the infrastructure to support the new code
monitoring - Watching app performance and the experience of end users
What is infrastructure as code?
What is desired state?
What is CVS?
Machine-readable code (automation language) describes the state the infrastructure needs to be in (desired state)
The code is then applied to put it in the desired state.
- Automated
- Repeatable (test, dev, prod)
- version-controlled
The machine code file should be managed like software using version control or CVS (Concurrent Version System)
CVS is for file version control
Infrastructure as code - basically setting up your infrastructure (like your test server) to setup your environment to have everything it needs to run your application code.
In terms of Infrastructure as code(IaC), what are the different models, and how do they operate?
Which of these is Ansible?
Imperative - like running a script to setup your server/network/system to have it configured to the desired state. If a step you have to do error handling if there is a problem on certain servers. HOW TO APPROACH - you tell the server how to reach the desired state.
Declarative - You define what you want for the end result and let something else handle the config for you. This works right out of the box for everything and it’s easier. This gives you the exact same infrastructure no matter how many times it runs. WHAT TO DO APPROACH - I want this user created, I want this software downloaded, but you let ansible do the backend work.
Imperative - scripting
Declarative - ansible
What are other configuration management solutions/automation solutions other than Ansible
What makes Ansible Different?
Chef, Puppet, SaltStack
Ansible is agentless, uses simple code (YAML)
Ansible PUSHES data to it’s servers while the other PULL data from servers that need to run an agent.
What are the two node roles in Ansible
Control Node - Has to be run on Linux
What are the ways that Ansible accesses Linux and Windows and Network Nodes?
Linux - ssh
Windows - WinRM (Windows Remote Management)
Network - ssh or API
Anisble playbooks should be developed to be idempotent. What does this mean
Idempotent - They should always produce the same result.
They should also be self-containing, not relying on other playbooks.
Performing the operation several times will still render the same result. If you run a playbook to install httpd multiple times, you won’t get multiple httpd downloads, you’ll just have httpd on your system.
What are the two options you can use to deploy ansible and it’s playbooks?
Ansible Engine - command line
Ansible Tower - GUI
What are the Ansible Way’s rules?
Keep it simple
Make it readable
Use a declarative approach - It’s all about the ‘desired state’. Basically just use Ansible to make the current stat match the desired state
Use specific solutions - Use module more than shell commands in your playbooks
What are the three common use cases for Ansible
Configuration Managment - create users, modify files, add users ,etc
Provisioning - Deploy and install systems. It can do this for VM files but not bare metal using PXE-boot and kickstart. It can work with other tools that do this though. Pushed to the managed machine and started from there.
CI/CD - Continuous Integration Continuous Delivery - This makes sure the source code can easily be updated and developed for easy provisioned(pushed and started) version of the application. It can’t do this all on it’s own though.
What is needed of the managed node in order for you to run playbooks on it
They just need to have ssh or WinRM access given to the Controll Node
What are the requirements for the Control Node?
Python 3 or higher
An ssh client
Access to Ansible Repository
Dedicated user account that is configured with ssh and sudo permissions on the managed hosts