The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
2.0 KiB

  1. #
  2. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  3. #
  4. - name: Install OpenSSL, nginx and software-properties-common
  5. apt:
  6. name: [ 'openssl', 'nginx', 'software-properties-common' ]
  7. state: present
  8. update_cache: yes
  9. - name: Enable Ubuntu universe repositories
  10. apt_repository:
  11. repo: "{{ item }}"
  12. state: present
  13. loop:
  14. - "deb http://archive.ubuntu.com/ubuntu/ bionic universe"
  15. - "deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe"
  16. - "deb http://security.ubuntu.com/ubuntu/ bionic-security universe"
  17. - name: Enable ppa:certbot/certbot repository
  18. apt_repository:
  19. repo: ppa:certbot/certbot
  20. state: present
  21. - name: Update packages after adding new repositories
  22. apt:
  23. update_cache: yes
  24. - name: Install certbot
  25. apt:
  26. name: [ 'certbot' ]
  27. state: present
  28. update_cache: yes
  29. - name: Ensure nginx can read cert files
  30. file:
  31. dest: /etc/letsencrypt
  32. group: www-data
  33. recurse: yes
  34. - name: Ensure nginx is stopped
  35. service:
  36. name: nginx
  37. state: stopped
  38. - name: Install init_certbot script
  39. copy:
  40. src: init_certbot.sh
  41. dest: /usr/local/bin/init_certbot.sh
  42. owner: root
  43. group: root
  44. mode: 0555
  45. - name: Init certbot
  46. shell: init_certbot.sh {{ letsencrypt_email }} {{ server_name }} {{ server_alias }}
  47. - name: Install certbot_renew.sh weekly cron job
  48. copy:
  49. src: "certbot_renew.sh"
  50. dest: /etc/cron.weekly/certbot_renew.sh
  51. owner: root
  52. group: root
  53. mode: 0755
  54. # see https://weakdh.org/sysadmin.html
  55. - name: Create a strong dhparam.pem
  56. shell: openssl dhparam -out /etc/nginx/dhparams.pem 2048
  57. args:
  58. creates: /etc/nginx/dhparams.pem
  59. - name: Create dhparam nginx conf
  60. template: src=stronger_dhparams.conf dest=/etc/nginx/conf.d/stronger_dhparams.conf
  61. - include: site.yml
  62. - meta: flush_handlers # nginx has to be restarted right now if it has to
  63. - name: Ensure nginx is restarted
  64. service:
  65. name: nginx
  66. state: restarted