deploy_content.yml 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. - name: Create the document root for each web site
  2. file:
  3. path: ""
  4. state:
  5. owner:
  6. mode: ''
  7. loop: "{{ web_hosts }}"
  8. - name: Deploy the default index.html
  9. template:
  10. src: "sample-index.html.j2"
  11. dest: ""
  12. loop: "{{ web_hosts }}"
  13. - name: Assign the SELinux policy for the document roots
  14. sefcontext:
  15. target: '/srv/www(/.*)?'
  16. setype:
  17. state: present
  18. - name: Change the SELinux file contexts
  19. file:
  20. path:
  21. state: directory
  22. recurse: yes
  23. follow: no
  24. setype:
  25. - name: Install the TLS certs of the virtual hosts
  26. copy:
  27. src: "{{ item }}.crt"
  28. dest: "/etc/pki/tls/certs"
  29. loop: "{{ web_hosts }}"
  30. - name: Install the TLS private keys of the virtual hosts
  31. copy:
  32. src: "{{ item }}.key"
  33. dest: "/etc/pki/tls/private"
  34. mode: ''
  35. owner:
  36. group:
  37. loop: "{{ web_hosts }}"
  38. - name: Install the example.com CA cert
  39. copy:
  40. src: "{{ cacert_file }}"
  41. dest: "/etc/pki/tls/certs/{{ cacert_file }}"