12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- ---
- - name: Ensure group for gitit exists
- group: name={{gitit_group}}
- - name: Ensure user for gitit exists
- user:
- name: "{{gitit_user}}"
- createhome: yes
- home: "{{gitit_data_dir}}"
- group: "{{gitit_group}}"
- - name: Ensure prerequisites for gitit are instaled
- apt: name={{item}} state=present update_cache=yes cache_valid_time=3600
- with_items:
- - git
- - gitit
- - name: Install gitit configuration
- template:
- src: conf.j2
- dest: "{{gitit_data_dir}}/gitit.conf"
- owner: "{{gitit_user}}"
- notify:
- - Restart gitit
- - name: Ensure static content directories exists
- file:
- dest: "{{gitit_data_dir}}/static/{{item}}"
- state: directory
- owner: "{{gitit_user}}"
- with_items:
- - css
- - img
- - name: Ensure template directory exists
- file:
- dest: "{{gitit_data_dir}}/templates"
- state: directory
- owner: "{{gitit_user}}"
- - name: Ensure custom footer exists
- template:
- src: footer.st.j2
- dest: "{{gitit_data_dir}}/templates/footer.st"
- owner: "{{gitit_user}}"
- - name: Ensure custom css exists
- template:
- src: custom.css.j2
- dest: "{{gitit_data_dir}}/static/css/custom.css"
- owner: "{{gitit_user}}"
- - name: Ensure wikidata directory exists
- file:
- dest: "{{gitit_data_dir}}/wikidata"
- state: directory
- owner: "{{gitit_user}}"
- - name: Install nginx configs
- template:
- src: "nginx.j2"
- dest: "/etc/nginx/sites-available/wiki"
- notify:
- - Restart nginx
- - name: Activate nginx configurations
- file:
- src: /etc/nginx/sites-available/wiki
- dest: /etc/nginx/sites-enabled/wiki
- state: link
- notify:
- - Restart nginx
- - name: Install systemd unit
- register: gitit_systemd_unit
- template:
- src: systemd.j2
- dest: /etc/systemd/system/gitit.service
- - name: Systemd daemon-reload
- when: gitit_systemd_unit|changed
- shell: systemctl daemon-reload
- - name: Ensure gitit is started and enabled
- service: name=gitit state=started enabled=yes
|