-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain1.yml
93 lines (77 loc) · 2.03 KB
/
main1.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
---
# tasks file for fedora
- name: fedora
hosts: all
become: True
environment:
DATABASE_NAME: transtats
DATABASE_USER: postgres
DATABASE_PASSWD: postgres
DATABASE_HOST: localhost
PYTHONUNBUFFERED: 1
tasks:
- name: Update all
yum:
name: '*'
state: latest
- name: Install necessary packages
yum:
name: "{{ item }}"
state: latest
with_items:
- gcc
- findutils
- git
- python
- python34-devel
- python34-pip
- redhat-rpm-config
ignore_errors: yes
- name: Install postgresql package's
yum:
name: "{{item}}"
state: latest
with_items:
- postgresql95
- postgresql95-server
- postgresql95-libs
- postgresql95-contrib
- postgresql95-devel
- openssh-server
- name: Run ssh-keygen
command: /usr/bin/ssh-keygen -A
- name: Init db
command: '/usr/pgsql-9.5/bin/postgresql95-setup initdb'
ignore_errors: yes
- name: Coping content
copy:
content: "(ident -> md5; peer-> ident)"
dest: /var/lib/pgsql/9.5/data/pg_hba.conf
- name: Change permission
file:
path: /var/lib/pgsql/9.5/data
owner: 26
group: 26
mode: 0755
- name: create workspace dir
file:
path: /workspace
state: directory
- name: Go to workspace
command: cd /workspace
- name: clone a git repo
git:
repo: https://github.com/transtats/transtats.git
- copy:
src: deploy/docker/conf/sample_keys.json
dest: /workspace/transtats/settings/keys.json
- name: Install requirements
command: pip3 install -r /workspace/requirements/dev.txt
- name: create ssh dir
file:
path: /var/run/sshd
state: directory
- name: sshd
command: sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
- name: run sshd
command: "'/usr/sbin/sshd' '-D'"