--- - name: Install certbot package apt: name: ['certbot', 'python3-certbot-nginx'] state: present - name: Get certs using certbot shell: certbot run --test-cert --register-unsafely-without-email --agree-tos -n -d {{item}}{{domain}} --nginx loop: - cloud. - wiki. - pma. - - name: restart nginx service: name: nginx state: restarted