説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

blog.yml 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. - name: Create directories for HTML documents
  2. file: state=directory path={{ item }} group=www-data owner={{ main_user_name }}
  3. with_items: "{{ virtual_domains | json_query('[*].doc_root') | unique }}"
  4. - name: Create directory for well-known configs
  5. file: state=directory path=/var/www/well-known group=www-data owner=www-data
  6. - name: Create the Apache well-known config
  7. template:
  8. src=etc_apache2_conf-available_well-known.j2
  9. dest=/etc/apache2/conf-available/well-known.conf
  10. owner=root
  11. group=root
  12. notify: restart apache
  13. - name: Enable the Apache well-known config
  14. command: a2enconf well-known.conf creates=/etc/apache2/conf-enabled/well-known.conf.conf
  15. notify: restart apache
  16. - name: Setup PHP config
  17. template:
  18. src=etc_php_7.0_apache2_php.ini.j2
  19. dest=/etc/php/7.0/apache2/php.ini
  20. owner=root
  21. group=root
  22. notify: restart apache
  23. - name: Add custom postgres user
  24. postgresql_user:
  25. login_host=localhost
  26. login_user={{ db_admin_username }}
  27. login_password="{{ db_admin_password }}"
  28. name={{ custom_db_username }}
  29. password="{{ custom_db_password }}"
  30. encrypted=yes
  31. state=present
  32. - name: Create custom database
  33. postgresql_db:
  34. login_host=localhost
  35. login_user={{ db_admin_username }}
  36. login_password="{{ db_admin_password }}"
  37. name={{ custom_db_database }}
  38. state=present
  39. owner={{ custom_db_username }}
  40. - name: Create an example blog index page
  41. template:
  42. src=var_www_blog_index.j2
  43. dest={{ item.doc_root }}/index.html
  44. owner=www-data
  45. group=www-data
  46. force=no
  47. with_items: "{{ virtual_domains }}"
  48. - name: Create an example blog 404 error page
  49. template:
  50. src=var_www_blog_404.j2
  51. dest={{ item.doc_root }}/404.html
  52. owner=www-data
  53. group=www-data
  54. force=no
  55. with_items: "{{ virtual_domains }}"
  56. - name: Create the Apache blog sites config files
  57. template:
  58. src=etc_apache2_sites-available_blog.j2
  59. dest=/etc/apache2/sites-available/{{ item.name }}.conf
  60. owner=root
  61. group=root
  62. notify: restart apache
  63. with_items: "{{ virtual_domains }}"
  64. - name: Enable Apache blog sites (creates new sites-enabled symlinks)
  65. command: a2ensite {{ item }}.conf creates=/etc/apache2/sites-enabled/{{ item }}.conf
  66. notify: restart apache
  67. with_items: "{{ virtual_domains | json_query('[*].name') }}"