-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.yml
103 lines (89 loc) · 2.76 KB
/
site.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
- hosts: all
sudo: yes
vars:
citadel_bucket: 'balanced-citadel'
rabbitmq_vhosts:
- localhost
redis_bind: 127.0.0.1
postgresql_ext_install_contrib: yes
postgresql_client_encoding: utf8
pypi_username: omnibus
pypi_password: "{{ lookup('citadel', 'omnibus/devpi_password') | trim }}"
vars_files:
- roles/elasticsearch/vars/sample.yml
- defaults/main.yml
roles:
- base
- elasticsearch
- postgresql
- rabbitmq
- redis
handlers:
- include: handlers/main.yml
tasks:
- name: PostgreSQL | add balanced as a super user
tags: setup-db
postgresql_user: >-
name=balanced
password=balanced
encrypted=no
role_attr_flags=SUPERUSER
login_host=localhost
state=present
- name: PostgreSQL | create the balanced db
tags: setup-db
postgresql_db: >-
name=balanced
owner=balanced
encoding=UTF-8
lc_collate='en_US.UTF-8'
lc_ctype='en_US.UTF-8'
template=template0
login_host=localhost
login_user=balanced
login_password=balanced
state=present
- name: Fetch deploy key?
debug: msg="{{ lookup('citadel', '/deploy_key/deploy.pem') }}"
tags: citadel
- name: Write the deploy key for cloning
tags: deploy-key
sudo: false
lineinfile:
dest=~/.ssh/deploy_key
line="{{ lookup('citadel', '/deploy_key/deploy.pem') }}"
state=present
create=yes
mode='0400'
# http://hakunin.com/six-ansible-practices
- name: ensure github.com is a known host
tags: balanced-install
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
- name: install balanced
sudo: no
include: tasks/main.yml
tags: balanced-install
vars:
balanced_install_method: apt
balanced_apt_version: null
- name: install pip dirs for vagrant user
file: "path=~{{ item.name }}/.pip owner={{ item.name }} group={{ item.name }} mode=0700 state=directory"
with_flattened:
- [{name: vagrant}]
- name: create pip confs
template: "src=templates/pip.conf.j2 dest=~{{ item.name }}/.pip/pip.conf owner={{ item.name }} group={{ item.name }} mode=600"
with_flattened:
- [{name: vagrant}]
- name: create pip confs
template: "src=templates/pydistutils.cfg.j2 dest=~{{ item.name }}/.pydistutils.cfg owner={{ item.name }} group={{ item.name }} mode=600"
with_flattened:
- [{name: vagrant}]
- name: install balanced development tools
include: tasks/development.yml
tags: balanced-install-development