Uno-Dan

Untitled

Jul 19th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.19 KB | None | 0 0
  1. ---
  2. # tasks file for https-role
  3.    
  4. # Open port in firewall for https ##############################################################################
  5. - name: open port 443/tcp in firewall for https
  6.   firewalld:
  7.     port: 443/tcp
  8.     zone: public
  9.     state: enabled
  10.     permanent: yes
  11.  
  12. - name: install common packages
  13.   dnf:
  14.     name: ['mod_ssl', 'openssl']
  15.     state: latest
  16.  
  17. - name: download certbot-auto
  18.   get_url: url=https://dl.eff.org/certbot-auto dest=/tmp/certbot-auto
  19.  
  20. - name: move certbot-auto
  21.   command: mv /tmp/certbot-auto /usr/local/bin
  22.  
  23. - name: set mode certbot-auto
  24.   file:
  25.     path: /usr/local/bin/certbot-auto
  26.     mode: 0755
  27.  
  28. - name: Add virtural host {{ domain_name }}
  29.   vars:
  30.     port: 443
  31.    
  32.   template: src=virtural_host.conf.j2 dest=/etc/httpd/sites-available/{{ domain_name }}.conf
  33.     owner=root
  34.     group=root
  35.     mode=644      
  36.    
  37. - name: Restart httpd
  38.   systemd: name=httpd state=restarted
  39.  
  40. - name: get lets encript certs
  41.   command: /usr/local/bin/certbot-auto --apache -n --agree-tos --email=danhuckson@hotmail.com --domains='mettatea.net,pi.mettatea.net,www.mettatea.net'
  42.      
  43. - name: Restart httpd
  44.   systemd: name=httpd state=restarted
Add Comment
Please, Sign In to add comment