Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- # tasks file for https-role
- # Open port in firewall for https ##############################################################################
- - name: open port 443/tcp in firewall for https
- firewalld:
- port: 443/tcp
- zone: public
- state: enabled
- permanent: yes
- - name: install common packages
- dnf:
- name: ['mod_ssl', 'openssl']
- state: latest
- - name: download certbot-auto
- get_url: url=https://dl.eff.org/certbot-auto dest=/tmp/certbot-auto
- - name: move certbot-auto
- command: mv /tmp/certbot-auto /usr/local/bin
- - name: set mode certbot-auto
- file:
- path: /usr/local/bin/certbot-auto
- mode: 0755
- - name: Add virtural host {{ domain_name }}
- vars:
- port: 443
- template: src=virtural_host.conf.j2 dest=/etc/httpd/sites-available/{{ domain_name }}.conf
- owner=root
- group=root
- mode=644
- - name: Restart httpd
- systemd: name=httpd state=restarted
- - name: get lets encript certs
- command: /usr/local/bin/certbot-auto --apache -n --agree-tos --email=danhuckson@hotmail.com --domains='mettatea.net,pi.mettatea.net,www.mettatea.net'
- - name: Restart httpd
- systemd: name=httpd state=restarted
Add Comment
Please, Sign In to add comment