-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathswift-aio.yml
125 lines (113 loc) · 2.47 KB
/
swift-aio.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
vars:
username: "user"
group: "users"
tasks:
- name: installing dependencies
apt: pkg={{ item }} state=latest update_cache=yes
with_items:
- curl
- gcc
- memcached
- rsync
- sqlite3
- xfsprogs
- git-core
- libffi-dev
- python-setuptools
- python-coverage
- python-dev
- python-nose
- python-simplejson
- python-xattr
- python-eventlet
- python-greenlet
- python-pastedeploy
- python-netifaces
- python-pip
- python-dnspython
- python-mock
when: ansible_os_family == "Debian"
- name: installing dependencies
yum: name={{ item }} state=latest
with_items:
- curl
- gcc
- memcached
- rsync
- sqlite
- xfsprogs
- git-core
- libffi-devel
- xinetd
- python-setuptools
- python-coverage
- python-devel
- python-nose
- python-simplejson
- pyxattr
- python-eventlet
- python-greenlet
- python-paste-deploy
- python-netifaces
- python-pip
- python-dns
- python-mock
when: ansible_os_family == "Redhat"
- name: create disk partition /dev/sdb
sudo: yes
command: fdisk /dev/sdb
- name: create filesystem /dev/sdb1
sudo: yes
filesystem: fstype=xfs dev=/dev/sdb1
- name: add partition to fstab
sudo: yes
lineinfile: >
dest=/etc/fstab
line="/dev/sdb1 /mnt/sdb1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0"
state=present
- name: create mount path /mnt/sdb1
sudo: yes
file: path=/mnt/sdb1 state=directory
- name: mount /mnt/sdb1
sudo: yes
mount: name=/mnt/sdb1
- name: create sub-partitions
sudo: yes
file: >
path=/mnt/sdb1/{{ item }}
state=directory
owner={{ username }}
group={{ group }}
with_items:
- 1
- 2
- 3
- 4
- name: create /srv
sudo: yes
file: path=/srv state=directory
- name: create symlinks
sudo: yes
file: >
path=/mnt/sdb1/{{ item }}
dest=/srv/{{ item }}
owner={{ username }}
group={{ group }}
state=link
- name: create node partition directories
sudo: yes
file: >
path=/srv/{{ item }}/node/sdb{{ item }}
state=directory
with_items:
- 1
- 2
- 3
- 4
- name: create /var/run/swift
sudo: yes
file: >
path=/var/run/swift
owner={{ username }}
group={{ group }}