Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. ---
  2. - hosts: web
  3. become: yes
  4. vars:
  5. var_root: /var/local/pippi
  6. doc_root: /var/local/pippi/www
  7. app_root: /usr/local/lib/pippi-api
  8. etc_root: /etc/pippi
  9. tasks:
  10. - name: make sure we have the latest version of apache2
  11. apt: name=apache2 update_cache=yes state=latest
  12.  
  13. - name: install modules
  14. apt: name={{ item }} update_cache=yes state=latest force=yes
  15. with_items:
  16. - libapache2-mod-wsgi
  17. - libapache2-mod-auth-kerb
  18.  
  19. - name: enable wsgi module
  20. apache2_module: name={{ item }} state=present
  21. with_items:
  22. - wsgi
  23. - authz_groupfile
  24. - auth_kerb
  25. notify:
  26. - reload apache2
  27.  
  28. - name: create virtual host file
  29. template: src=virtualhost.conf dest=/etc/apache2/sites-available/app.nekopippi.jp.conf
  30.  
  31. - name: enable the site
  32. command: a2ensite app.nekopippi.jp
  33. args:
  34. creates: /etc/apache2/sites-enabled/app.nekopippi.jp.conf
  35. notify:
  36. - reload apache2
  37. - name: make sure to disable the default
  38. command: a2dissite 000-default
  39. args:
  40. removes: /etc/apache2/sites-enabled/000-default
  41. notify:
  42. - reload apache2
  43. - name: copy krb5.conf
  44. copy: src=krb5.conf dest=/etc/krb5.conf mode=0664
  45.  
  46. - name: make sure we have folders that the app uses
  47. file:
  48. path: "{{ item }}"
  49. state: directory
  50. owner: www-data
  51. group: www-data
  52. mode: 0775
  53. with_items:
  54. - "{{ app_root }}"
  55. - "{{ var_root }}/log"
  56. - "{{ doc_root }}"
  57. - "{{ etc_root }}"
  58.  
  59. - name: copy AuthGroupFile
  60. copy: src=auth-group dest={{ etc_root }}/auth-group mode=0664 owner=www-data group=www-data
  61.  
  62. - template:
  63. src: appconf.yaml
  64. dest: {{ etc_root }}/appconf.yaml
  65. owner: www-data
  66. group: www-data
  67. mode: 0664
  68.  
  69. handlers:
  70. - name: reload apache2
  71. service: name=apache2 state=reloaded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement