Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: web
- become: yes
- vars:
- var_root: /var/local/pippi
- doc_root: /var/local/pippi/www
- app_root: /usr/local/lib/pippi-api
- etc_root: /etc/pippi
- tasks:
- - name: make sure we have the latest version of apache2
- apt: name=apache2 update_cache=yes state=latest
- - name: install modules
- apt: name={{ item }} update_cache=yes state=latest force=yes
- with_items:
- - libapache2-mod-wsgi
- - libapache2-mod-auth-kerb
- - name: enable wsgi module
- apache2_module: name={{ item }} state=present
- with_items:
- - wsgi
- - authz_groupfile
- - auth_kerb
- notify:
- - reload apache2
- - name: create virtual host file
- template: src=virtualhost.conf dest=/etc/apache2/sites-available/app.nekopippi.jp.conf
- - name: enable the site
- command: a2ensite app.nekopippi.jp
- args:
- creates: /etc/apache2/sites-enabled/app.nekopippi.jp.conf
- notify:
- - reload apache2
- - name: make sure to disable the default
- command: a2dissite 000-default
- args:
- removes: /etc/apache2/sites-enabled/000-default
- notify:
- - reload apache2
- - name: copy krb5.conf
- copy: src=krb5.conf dest=/etc/krb5.conf mode=0664
- - name: make sure we have folders that the app uses
- file:
- path: "{{ item }}"
- state: directory
- owner: www-data
- group: www-data
- mode: 0775
- with_items:
- - "{{ app_root }}"
- - "{{ var_root }}/log"
- - "{{ doc_root }}"
- - "{{ etc_root }}"
- - name: copy AuthGroupFile
- copy: src=auth-group dest={{ etc_root }}/auth-group mode=0664 owner=www-data group=www-data
- - template:
- src: appconf.yaml
- dest: {{ etc_root }}/appconf.yaml
- owner: www-data
- group: www-data
- mode: 0664
- handlers:
- - name: reload apache2
- service: name=apache2 state=reloaded
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement