Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 646e440

Browse files
committed
pg, pathman and shardman installed
1 parent 3f2c8ac commit 646e440

File tree

4 files changed

+119
-14
lines changed

4 files changed

+119
-14
lines changed

ec2/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.retry

ec2/inventory/inventory

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
11
# Put here manual stuff, aws-related inventory will be generated by ec2.py
22
localhost
33

4-
[ec2:vars]
5-
ansible_ssh_private_key_file=~/.ssh/aws_rsa
4+
[nodes]
5+
6+
[nodes:vars]
67
ansible_user=ubuntu
78
# on fresh ubuntus, there is no 'python' executable
89
ansible_python_interpreter=python3
910

10-
# [nodes]
11-
# 10.42.42.10
12-
# 10.42.42.20
11+
# make -j
12+
makejobs=4
13+
pg_repo=git://git.postgresql.org/git/postgresql.git
14+
pg_version_tag=REL_10_STABLE
15+
pg_prefix="{{ansible_env.HOME}}/pg"
16+
pg_src="{{pg_prefix}}/src"
17+
pg_dst="{{pg_prefix}}/install"
18+
pg_datadir="{{pg_prefix}}/data_{{pg_port}}"
19+
pg_port=5432
20+
21+
pathman_repo=https://github.com/postgrespro/pg_pathman.git
22+
pathman_src="{{pg_prefix}}/pg_pathman"
23+
pathman_version_tag=master
24+
25+
shardman_repo=https://github.com/postgrespro/pg_shardman.git
26+
shardman_src="{{pg_prefix}}/pg_shardman"
27+
shardman_version_tag=master
1328

14-
# [nodes:vars]
15-
# makejobs=4
29+
cflags="-O0"
1630

17-
# pg_repo=git://git.postgresql.org/git/postgresql.git
18-
# pg_version_tag=REL_10_STABLE
31+
[nodes:children]
32+
ec2
33+
vagrant
34+
35+
# generated by ec2.py
36+
[ec2]
37+
38+
[ec2:vars]
39+
# Your aws key
40+
ansible_ssh_private_key_file=~/.ssh/aws_rsa
1941

20-
# pg_port=5432
21-
# pg_prefix="{{ansible_env.HOME}}/pg"
22-
# pg_src="{{pg_prefix}}/src"
23-
# pg_dst="{{pg_prefix}}/install"
24-
# pg_datadir="{{pg_prefix}}/data_{{pg_port}}"
42+
# For local development
43+
[vagrant]
44+
10.42.42.10

ec2/provision.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
- hosts: nodes
3+
4+
environment:
5+
PATH: "{{ pg_dst }}/bin:{{ ansible_env.PATH }}"
6+
CFLAGS: "{{ cflags }}"
7+
8+
tasks:
9+
- name: update apt cache (Debian)
10+
apt: update_cache=yes
11+
become: yes
12+
tags:
13+
- apt_cache
14+
15+
- name: ensure dependencies (Debian)
16+
apt: name={{item}} state=installed
17+
with_items:
18+
- git
19+
- automake
20+
- libtool
21+
- build-essential
22+
- bison
23+
- flex
24+
- libreadline-dev
25+
- zlib1g-dev
26+
when: ansible_os_family == "Debian"
27+
become: yes
28+
tags:
29+
- build_pg
30+
31+
- name: clone postgres sources
32+
git: repo={{pg_repo}}
33+
dest={{pg_src}}
34+
version={{pg_version_tag}}
35+
depth=1
36+
accept_hostkey=True
37+
tags:
38+
- build_pg
39+
40+
- name: build and install pg
41+
shell: ./configure --prefix={{pg_dst}} --enable-debug && make clean && make -j {{makejobs}} && make install
42+
args:
43+
chdir: "{{pg_src}}"
44+
tags:
45+
- build_pg
46+
47+
- name: clone pathman
48+
git: repo={{pathman_repo}}
49+
dest={{pathman_src}}
50+
version={{pathman_version_tag}}
51+
depth=1
52+
accept_hostkey=True
53+
tags:
54+
- build_pathman
55+
56+
- name: build and install pathman
57+
shell: USE_PGXS=1 make clean && USE_PGXS=1 make -j {{makejobs}} install
58+
args:
59+
chdir: "{{pathman_src}}"
60+
tags:
61+
- build_pathman
62+
63+
- name: clone shardman
64+
git: repo={{shardman_repo}}
65+
dest={{shardman_src}}
66+
version={{shardman_version_tag}}
67+
depth=1
68+
accept_hostkey=True
69+
tags:
70+
- build_shardman
71+
72+
- name: build and install shardman
73+
shell: make clean && make -j {{makejobs}} && make install
74+
# shell: echo ${USE_PGXS}
75+
args:
76+
chdir: "{{shardman_src}}"
77+
tags:
78+
- build_shardman

ec2/readme.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ regions = eu-central-1 # set region
1313
set aws_access_key_id = xxx
1414
set aws_secret_access_key = xxx
1515
export EC2_INI_PATH=/etc/ansible/ec2.ini
16+
17+
Now launch some instance and check that ec2.py works:
18+
inventory/ec2.py --list
19+
20+
Check that ansible works:
21+
ansible -i inventory/ -m ping all

0 commit comments

Comments
 (0)