Skip to content
Snippets Groups Projects
Select Git revision
  • 59e2d2a289806f79fae525c5a0c5bc9f178bce56
  • master default protected
  • th/caddy-wip
  • th/caddy
  • th/lego
  • th/acmebot
  • pyzabbix
  • th/keycloak
8 results

main.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    main.yml 4.61 KiB
    ---
    # file: webserver/tasks/main.yml
    
    - name: include debian version specific configuration
      include_vars:
        file: "{{ ansible_distribution_release }}.yml"
      tags:
        - nginx
        - webservices
    
    - name: ensure nginx is installed
      apt:
        name:
          - nginx
          - nginx-full
        state: present
      notify:
        - restart nginx
        - restart nginx-proxy
      tags:
        - nginx
        - webservices
    
    - name: ensure we got our nginx config
      template:
        src: nginx.conf
        dest: /etc/nginx/nginx.conf
        owner: root
        group: root
        mode: '0644'
      notify:
        - restart nginx
      tags:
        - nginx
        - webservices
    
    - name: ensure we got our nginx-proxy config
      template:
        src: nginx-proxy.conf
        dest: /etc/nginx/nginx-proxy.conf
        owner: root
        group: root
        mode: '0644'
      notify:
        - restart nginx-proxy
      tags:
        - nginx
        - webservices
    
    - name: ensure there is the nginx-proxy group
      group:
        name: nginx-proxy
        state: present
        system: true
      tags:
        - nginx
        - webservices
    
    - name: ensure there is the nginx-proxy user
      user:
        name: nginx-proxy
        state: present
        group: nginx-proxy
        system: true
        shell: /usr/sbin/nologin
        home: /var/www
        createhome: false
      tags:
        - nginx
        - webservices