ansible/roles/dopr/tasks/main.yml
2015-06-11 14:54:17 +02:00

84 lines
2.3 KiB
YAML

# NB: dopr was initially called cdic
- name: install basic packages
yum: state=present pkg={{ item }}
with_items:
- "tmux"
- "bash-completion"
- "dnf-plugins-core"
tags:
- packages
- name: enable our copr
command: "dnf copr enable -y msuchy/copr"
args:
creates: "/etc/yum.repos.d/_copr_msuchy-copr.repo"
- name: create cdic user
user: name="cdic"
- name: install dopr specific packages
yum: state=present pkg={{ item }}
with_items:
- python3
- python3-pip
- python3-gunicorn
- git
- redis
- vim
- wget
- dnf-plugins-core
- python3-psycopg2
- python-psycopg2 # for psql utils
- phantomjs
- name: git clone casperjs
git: repo=git://github.com/n1k0/casperjs.git
dest=/opt/casperjs/
accept_hostkey=True
- name: install casperjs
file: src=/opt/casperjs/bin/casperjs
dest=/usr/bin/casperjs state=link mode=0755
- name: git clone cdic into the cdic home
git: repo=git://github.com/evilkost/cdic.git
dest=/home/cdic/server/cdic/
accept_hostkey=True
- name: install python requirements
pip: requirements=/home/cdic/server/cdic/requirements.txt executable=/usr/bin/pip3
- name: install systemd units
copy: src="systemd/{{ item }}" dest="/etc/systemd/system/"
with_items:
- "cdic_async.service"
- "cdic_gunicorn.service"
- name: install systemd tmpfiles
copy: src="tmpfiles.d/cdic_gunicorn.conf" dest="/etc/tmpfiles.d/"
# name: create working dirs
- file: path=/var/log/cdic state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/lib/cdic state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/lib/cdic/openid state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/lib/cdic/wp state=directory mode=0755 owner=cdic group=cdic
- file: path=/home/cdic/.config state=directory mode=0755 owner=cdic group=cdic
- name: copy cdic config
template: src="cdic.py" dest="/home/cdic/.config/cdic.py"
- copy: src="cdic_update_db.sh" dest="/usr/local/bin/" mode=0755
- file: path=/home/cdic/.ssh state=directory mode=0700 owner=cdic group=cdic
- name: copy ssh key for github
copy: src="{{private}}/files/dopr/github-testing" dest="/home/cdic/.ssh/id_rsa"
- include: "psql_setup.yml"
- name: enables services
service: state=running enabled=yes name={{ item }}
with_items:
- redis
- cdic_async
- cdic_gunicorn