Sobes.tech
Middle

What roles have you written in Ansible?

sobes.tech AI

Answer from AI

In Ansible, I wrote roles for automating deployment and server configuration, including:

  • Installing and configuring web servers (e.g., Nginx, Apache).
  • Setting up databases (PostgreSQL, MySQL).
  • Deploying applications and managing dependencies.
  • Configuring monitoring and logging systems.

Roles typically contain tasks, templates, variables, and handlers, which allow for code reuse and structuring. For example, a role for installing Nginx includes tasks for package installation, copying configuration files, and restarting the service.

Example of a role structure:

roles/
  nginx/
    tasks/main.yml
    templates/nginx.conf.j2
    handlers/main.yml
    vars/main.yml

In tasks/main.yml, the steps for installation and configuration are described.