Sobes.tech
Junior — Middle

Do you have experience writing and using Ansible playbooks for system configuration automation?

sobes.tech AI

Answer from AI

Yes, experience in writing and using Ansible playbooks for system configuration automation typically includes:

  • Defining tasks for installing packages, configuring services, copying files, etc.
  • Using Ansible modules to manage various aspects of the system.
  • Organizing playbooks with roles for ease of reuse and scaling.

A simple example of a playbook that installs nginx and starts the service:

- hosts: webservers
  become: yes
  tasks:
    - name: Install nginx
      apt:
        name: nginx
        state: present
        update_cache: yes

    - name: Start and enable nginx
      service:
        name: nginx
        state: started
        enabled: yes

This approach allows for quick and repeatable infrastructure setup, reducing the likelihood of errors during manual configuration.