roles/nginx/tasks/main.yaml
changeset 82 a3e1a9b18f6d
parent 75 d8c87a41cc6d
child 92 d4924111ce28
equal deleted inserted replaced
81:5fe7c52b2063 82:a3e1a9b18f6d
    11 
    11 
    12 - name: install nginx packages
    12 - name: install nginx packages
    13   become: yes
    13   become: yes
    14   apt: name="python-certbot-nginx"
    14   apt: name="python-certbot-nginx"
    15   notify: restart nginx
    15   notify: restart nginx
    16   when: nginx_enable_ssl
    16   when: nginx_enable_certbot
    17 
    17 
    18 - name: install certbot in nginx
    18 - name: install certbot in nginx
    19   become: yes
    19   become: yes
    20   command: "certbot certonly --nginx -n --agree-tos -d {{nginx_server_name}} -m {{nginx_admin_email}}"
    20   command: "certbot certonly --nginx -n --agree-tos -d {{nginx_server_name}} -m {{nginx_admin_email}}"
    21   notify: restart nginx
    21   notify: restart nginx
    22   when: nginx_enable_ssl
    22   when: nginx_enable_certbot
    23 
    23 
    24 - name: disable default site
    24 - name: disable default site
    25   become: yes
    25   become: yes
    26   file: path="/etc/nginx/sites-enabled/default" state="absent"
    26   file: path="/etc/nginx/sites-enabled/default" state="absent"
    27   notify: restart nginx
    27   notify: restart nginx