I currently have a doubt for my last line of code to make it work in Ansible, the code is the following:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2 python-letsencrypt-apache
sudo letsencrypt --apache
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get install python-certbot-apache
sudo certbot --webroot-path /var/www/html -d www.web.tk
Now I would like to convert it to Ansible:
- apt_repository:
repo: 'ppa:certbot/certbot'
- apt:
name: "{{ item }}"
update_cache: yes
with_items:
- all items above
But I have a problem as the line sudo letsencrypt --apache
requires user interaction and I would like to give it the website and email from Ansible inventory file