241 lines
5.3 KiB
YAML
241 lines
5.3 KiB
YAML
---
|
|
- name: install dependencies
|
|
package:
|
|
name: "{{ item }}"
|
|
state: installed
|
|
with_items:
|
|
- git
|
|
- graphviz-python
|
|
- m2crypto
|
|
- mod_wsgi
|
|
- patch
|
|
- python2-pip
|
|
- python2-setuptools
|
|
|
|
- name: download moin package
|
|
get_url:
|
|
url: "https://static.moinmo.in/files/moin-{{ moin_version }}.tar.gz"
|
|
dest: "{{ srcdir }}"
|
|
checksum: sha1:bead31f53152395aa93c31dc3e0a8a417be39ccd
|
|
|
|
- name: extract moin package
|
|
unarchive:
|
|
src: "{{ srcdir }}/moin-{{ moin_version }}.tar.gz"
|
|
dest: "{{ srcdir }}"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
creates: "{{ srcdir }}/moin-{{ moin_version }}"
|
|
remote_src: true
|
|
|
|
- name: copy graphingwiki packages
|
|
git:
|
|
dest: "{{ srcdir }}/{{ item }}"
|
|
repo: "https://github.com/graphingwiki/{{ item }}.git"
|
|
with_items:
|
|
- graphingwiki
|
|
- collabbackend
|
|
|
|
- name: install foo.sh theme
|
|
copy:
|
|
src: foosh.py
|
|
dest: "{{ srcdir }}/collabbackend/collabbackend/plugin/theme/foosh.py"
|
|
mode: 0644
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: install static files for foo.sh theme
|
|
synchronize:
|
|
dest: "{{ srcdir }}/collabbackend/htdocs"
|
|
src: foo.sh
|
|
delete: true
|
|
recursive: true
|
|
|
|
- name: patch moin source
|
|
patch:
|
|
src: "moin-{{ moin_version }}.patch"
|
|
basedir: "{{ srcdir }}/moin-{{ moin_version }}"
|
|
|
|
- name: copy moin htdocs
|
|
command: >
|
|
cp -a {{ srcdir }}/moin-{{ moin_version }}/MoinMoin/web/static/htdocs \
|
|
{{ srcdir }}/moin-{{ moin_version }}/wiki
|
|
args:
|
|
creates: "{{ srcdir }}/moin-{{ moin_version }}/wiki/htdocs"
|
|
|
|
- name: install graphigwiki packages
|
|
pip:
|
|
name: ["{{ srcdir }}/graphingwiki", "{{ srcdir }}/collabbackend"]
|
|
umask: "0022"
|
|
extra_args: --egg --no-index
|
|
|
|
- name: install moin
|
|
pip:
|
|
name: "{{ srcdir }}/moin-{{ moin_version }}"
|
|
umask: "0022"
|
|
extra_args: --no-index
|
|
|
|
- name: create group collab
|
|
group:
|
|
name: collab
|
|
gid: 1003
|
|
|
|
- name: create user collab
|
|
user:
|
|
name: collab
|
|
comment: Service Collab
|
|
uid: 1003
|
|
group: collab
|
|
home: /var/lib/collab
|
|
shell: /sbin/nologin
|
|
|
|
- name: create .profile for user collab
|
|
copy:
|
|
content: "umask 077\n"
|
|
dest: /var/lib/collab/.profile
|
|
mode: 0440
|
|
owner: collab
|
|
group: collab
|
|
|
|
- name: create config directories
|
|
file:
|
|
path: "{{ item }}"
|
|
mode: 0755
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
state: directory
|
|
with_items:
|
|
- /etc/local
|
|
- /etc/local/collab
|
|
|
|
- name: create collab.ini
|
|
copy:
|
|
src: collab.ini
|
|
dest: /etc/local/collab/collab.ini
|
|
mode: 0644
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: set selinux contexts from data directory
|
|
sefcontext:
|
|
path: /export/wikis(/.*)?
|
|
setype: httpd_sys_rw_content_t
|
|
- name: create data directgory
|
|
file:
|
|
path: /export/wikis
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|
|
seuser: _default
|
|
setype: _default
|
|
state: directory
|
|
|
|
- name: link data directory
|
|
file:
|
|
src: /export/wikis
|
|
dest: /srv/wikis
|
|
state: link
|
|
|
|
- name: create data directories
|
|
file:
|
|
state: directory
|
|
path: "{{ item }}"
|
|
mode: 02770
|
|
owner: collab
|
|
group: collab
|
|
with_items:
|
|
- "/srv/wikis/collab"
|
|
- "/srv/wikis/collab/archive"
|
|
- "/srv/wikis/collab/cache"
|
|
- "/srv/wikis/collab/config"
|
|
- "/srv/wikis/collab/htdocs"
|
|
- "/srv/wikis/collab/log"
|
|
- "/srv/wikis/collab/run"
|
|
- "/srv/wikis/collab/underlay"
|
|
- "/srv/wikis/collab/user"
|
|
- "/srv/wikis/collab/wikis"
|
|
|
|
- name: create tmpfs mount for cache
|
|
mount:
|
|
state: mounted
|
|
path: "/export/wikis/collab/cache"
|
|
src: none
|
|
fstype: tmpfs
|
|
opts: "uid=collab,gid=collab,mode=2770,context=\"{{ tmpfs_context }}\""
|
|
|
|
- name: install htdocs/.htaccess
|
|
copy:
|
|
src: collab-htaccess
|
|
dest: collab-htaccess
|
|
mode: 0660
|
|
owner: collab
|
|
group: collab
|
|
|
|
- name: copy configs from collabbackend archive
|
|
copy:
|
|
src: "{{ srcdir }}/collabbackend/config/{{ item }}"
|
|
dest: /srv/wikis/collab/config/{{ item }}
|
|
mode: 0660
|
|
owner: collab
|
|
group: collab
|
|
seuser: _default
|
|
setype: _default
|
|
force: false
|
|
remote_src: true
|
|
with_items:
|
|
- collabfarm.py
|
|
- intermap.txt
|
|
- logging.conf
|
|
|
|
- name: extract CollabBase.zip from collabbackend archive
|
|
copy:
|
|
src: "{{ srcdir }}/collabbackend/packages/CollabBase.zip"
|
|
dest: /var/lib/collab/CollabBase.zip
|
|
mode: 0660
|
|
owner: collab
|
|
group: collab
|
|
remote_src: true
|
|
|
|
- name: initialize collab
|
|
script: collab-init.sh
|
|
args:
|
|
creates: /srv/wikis/collab/wikis/collab
|
|
|
|
- name: add collab-htaccess cron job
|
|
cron:
|
|
name: collab-htaccess
|
|
user: collab
|
|
job: /usr/bin/collab-htaccess
|
|
|
|
- name: link collab to apache htdocs
|
|
file:
|
|
src: /srv/wikis/collab/htdocs
|
|
dest: "/srv/web/{{ inventory_hostname }}/collab"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
state: link
|
|
follow: false
|
|
|
|
- name: link moin static to apache htdocs
|
|
file:
|
|
src: /usr/share/moin/htdocs
|
|
dest: "/srv/web/{{ inventory_hostname }}/moin_static"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
state: link
|
|
follow: false
|
|
|
|
- name: add apache to collab group
|
|
user:
|
|
name: apache
|
|
groups: collab
|
|
append: true
|
|
notify: restart apache
|
|
|
|
- name: create apache config
|
|
template:
|
|
src: collab.conf.j2
|
|
dest: /etc/httpd/conf.local.d/collab.conf
|
|
mode: 0644
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
notify: restart apache
|