Junior — Middle
Tell about your experience with creating and configuring automated scripts using playbooks.
sobes.tech AI
Answer from AI
In my practice, I have created and configured automated scripts using Ansible playbooks for deploying applications and configuring servers. For example, I wrote playbooks that install necessary packages, copy configuration files, and start services. This allowed standardizing and speeding up the deployment process, as well as minimizing errors during manual setup.
A simple example of a playbook for installing nginx on Ubuntu:
- hosts: webservers
become: yes
tasks:
- name: Install nginx
apt:
name: nginx
state: present
- name: Start and enable nginx
systemd:
name: nginx
state: started
enabled: yes
This approach makes it easy to scale infrastructure and reuse code for different environments.