main.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. # tasks file for map-server
  3. - include_vars: "{{ ansible_os_family }}.yml"
  4. - name: Install openssl to generate DH params
  5. apt: name=openssl state=present
  6. - name: Ensure nginx ssl directory exists
  7. file: dest=/etc/nginx/ssl/ state=directory
  8. - name: Create private ssl key from secret var
  9. copy: content="{{ mapserver_ssl_private_key }}" dest=/etc/nginx/ssl/wiki.ffdo.de.key
  10. - name: Create nginx server certificate from secret var
  11. copy: content="{{ mapserver_ssl_server_cert }}" dest=/etc/nginx/ssl/wiki.ffdo.de.crt
  12. - name: Deploy pregenerated DH params
  13. when: mapserver_use_pregenerated_dh_params
  14. copy: content="{{mapserver_dh_params}}" dest=/etc/nginx/dhparams.pem
  15. - name: Generate strong dhparams
  16. when: not mapserver_use_pregenerated_dh_params
  17. shell: openssl dhparam -out /etc/nginx/dhparams.pem 4096 creates=/etc/nginx/dhparams.pem
  18. - name: Install necessary packages
  19. apt: name={{item}} state=present
  20. with_items: "{{mapserver_packages}}"
  21. - name: Create supervisor services
  22. when: supervisor_services is defined
  23. template: src=supervisor.service.j2 dest=/etc/supervisor/conf.d/{{item.name}}.conf
  24. with_items: "{{supervisor_services}}"
  25. notify: Restart supervisor
  26. - name: Ensure supervisor is started and enabled
  27. service: name=supervisor state=started enabled=yes