--- - name: Install Certbot via package. package: "name={{ certbot_package }} state=present" - name: Install Certbot DNS plugin via package. package: "name=python3-certbot-dns-{{ certbot_dns_plugin }} state=present" when: - certbot_create_method == 'dns' - certbot_dns_plugin is defined - name: Set Certbot script variable. set_fact: certbot_script: "{{ certbot_package }}"