-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotindex_restart.yml
65 lines (52 loc) · 1.56 KB
/
otindex_restart.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
- hosts: all
gather_facts: False
# start by installing required packages (note that postgresql packages
# installed separately in postgresql role and apache packages installed
# in apache role)
pre_tasks:
# python2 might not be installed on server (e.g. Ubuntu16)
- name: install python 2
become: true
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
- name: Install packages
become: true
apt: name={{ item }} state=present
with_items:
- virtualenv
- libpq-dev
- git-core
- build-essential
- python-psycopg2
- python-dev
- name: Add user "opentree"
user:
name: opentree
shell: /bin/bash # Defaults to /bin/bash
state: present
become: true
- name: Create Folder
file:
path: /home/opentree/.ssh
state: directory
become: true
- name: example copying file with owner and permissions
copy:
remote_src: yes
src: /home/ubuntu/.ssh/authorized_keys
dest: /home/opentree/.ssh/authorized_keys
owner: opentree
group: opentree
mode: 0644
become: true
roles:
- apache
# set this at play level because used in multiple roles: peyotl and otindex
environment:
PEYOTL_CONFIG_FILE: "{{ peyotl_config_location }}/config"
handlers:
- name: restart apache
become: true
service: name=apache2 state=restarted
- name: restart postgresql
service: name=postgresql state=restarted