• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1- hosts: letsencrypt
2  become: yes
3  vars_files:
4    - vars/main.yml
5    - local-vars/local.yml
6  tasks:
7    - name: Install certbot packages
8      apt:
9        pkg:
10          - python3-certbot-nginx
11    - name: setup certbot
12      command: >
13        sudo certbot --nginx --agree-tos -m {{ certbot_admin_email }}
14        -d {{ inventory_hostname }} --non-interactive
15        --keep --redirect --uir --hsts --staple-ocsp --must-staple
16      args:
17        creates: /etc/letsencrypt/renewal/{{ inventory_hostname }}.conf
18