Sobes.tech
Middle

What Ansible playbook examples have you created?

sobes.tech AI

Answer from AI

I wrote Ansible playbooks for automating the deployment and configuration of infrastructure. For example:

  • Installing and configuring the Nginx web server with virtual host setup.
  • Deploying and updating applications on servers using roles and templates.
  • Automating PostgreSQL database setup, including creating users and databases.
  • Setting up monitoring with Prometheus and Alertmanager.

An example of a simple playbook for installing Nginx:

- hosts: webservers
  become: yes
  tasks:
    - name: Install Nginx
      apt:
        name: nginx
        state: present
    - name: Start and enable Nginx service
      systemd:
        name: nginx
        state: started
        enabled: yes