DevOps
DevOps describes the link between software development (Dev) and IT operations (Ops) that takes care of software deployment and infrastructure management.
It integrates practices such as
- Continuous Integration, Continuous Delivery (CI/CD)
- Infrastructure as Code (IaC)
- Containerization and Orchestration
- Automation and monitoring
CI/CD (Continuous Integration, Continuous Delivery)
Continuous Integration, Continuous Delivery (CI/CD) is a software development practice that automates building, testing, and deploying applications.
Continuous Integration (CI) entails automated builds and tests for every commit, while Continuous Delivery (CD) means automatic preparation for release to production, in order to ensure deployable code at any time.
CI/CD may include continuous deployment, which automatically releases to production.
Key Components
- Version control (Git)
- Build automation
- Automated testing
- Deployment automation
- Monitoring
Tools for CI/CD include Jenkins, GitHub Actions and GitLab CI.
Infrastructure-as-Code (IaC)
Infrastructure-as-Code (IaC) is the approach of provisioning IT infrastructure through machine-readable config files, as opposed to using interactive tools (e.g. shell commands or GUIs). It allows for automated deployment using code, which enables more scalability.
Examples include Ansible, Terraform and AWS CloudFormation.
Ansible software
Ansible is an open-source Infrastructure-as-Code (IaC) tool that uses YAML files (so-called playbooks) to define configuration and deployment of applications.
Its architecture is based on a push model, where commands are executed from a central control node to target machines, making it easy to manage both small and large-scale environments.
It does need special software to be preinstalled and can just use SSH for communication instead.
"Hello World" Example
The inventory file hosts.ini defines the target hosts:
[local] localhost ansible_connection=local
The playbook hello_world.yml contains all instructions:
---
- name: Hello World Playbook
hosts: local
tasks:
- name: Print Hello World
debug:
msg: "Hello, World!"
Running the playbook:
ansible-playbook -i hosts.ini hello_world.yml