-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlustre-zfs-test.yml
163 lines (134 loc) · 5.26 KB
/
lustre-zfs-test.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# lustre-zfs-test
#
# playbooks/irods-cluster.yml - Ansible playbook for configuring a test Lustre filesystem with ZFS
# Author: Ilari Korhonen, KTH Royal Institute of Technology
#
# Copyright (C) 2016-2017 KTH Royal Institute of Technology. All rights reserved.
# See LICENSE file for more information.
---
- hosts: lustre-hosts
become_user: root
tasks:
- name: register git repo commit id
local_action: shell git rev-parse HEAD
become: no
register: git_commit_id
- name: disable selinux
selinux: state=disabled
- name: disable firewall
service: name=firewalld enabled=no state=stopped
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_eth1.ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_eth1 is defined
with_items: "{{ groups['all'] }}"
- name: make sure kernel is up-to-date
yum: name=kernel state=latest
register: yum_kernel
- name: reboot with new kernel
shell: reboot
when: yum_kernel['changed'] == true
- name: wait for rebooted machine to be available
become: no
local_action: wait_for host={{ ansible_nodename }} state=started delay=30 timeout=300 connect_timeout=15
when: yum_kernel['changed'] == true
- name: necessary package groups
yum:
name:
- "@Development tools"
state: present
- name: necessary package repositories
yum:
name:
- epel-release
- http://download.zfsonlinux.org/epel/zfs-release.el7_6.noarch.rpm
state: present
- name: necessary packages for maangement
yum:
name:
- psmisc
- net-tools
- htop
- iotop
- iftop
state: latest
- name: necessary packages for lustre build
yum:
name:
- xmlto
- asciidoc
- elfutils-libelf-devel
- zlib-devel
- binutils-devel
- newt-devel
- python-devel
- hmaccalc
- perl-ExtUtils-Embed
- bison
- elfutils-devel
- audit-libs-devel
- python-docutils
- sg3_utils
- expect
- attr
- lsof
- quilt
- libselinux-devel
- kernel-devel
- libyaml-devel
state: latest
- name: enable zfs-kmod repository
shell: yum-config-manager --enable zfs-kmod
- name: disable zfs-dkms repository
shell: yum-config-manager --disable zfs
- name: zfs packages
yum:
name:
- zfs
- libzfs2-devel
- kmod-spl-devel
- kmod-zfs-devel
state: latest
- name: lustre build script
template: src=templates/build-lustre-rpms.sh.j2 dest=/tmp/build-lustre-rpms.sh owner=root group=root mode=0755
- name: run lustre build script if necessary
shell: /tmp/build-lustre-rpms.sh
args:
creates: "{{ lustre_buildroot }}/LUSTRE-VERSION-FILE"
- name: get lustre version
shell: "awk '{print $3}' {{ lustre_buildroot }}/LUSTRE-VERSION-FILE"
register: lustre_version
- name: lustre packages
yum:
name:
- /tmp/lustre-release/kmod-lustre-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/kmod-lustre-osd-zfs-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/kmod-lustre-tests-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/lustre-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/lustre-debuginfo-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/lustre-iokit-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/lustre-osd-zfs-mount-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
- /tmp/lustre-release/lustre-tests-{{ lustre_version['stdout'] }}-1.el7.x86_64.rpm
state: present
- hosts: lustre-targets
become_user: root
tasks:
- name: lustre lnet configuration
template: src=templates/lustre-lnet.conf.j2 dest=/etc/modprobe.d/lnet.conf owner=root group=root mode=0644
- name: lustre ldev configuration
template: src=templates/lustre-ldev.conf.j2 dest=/etc/ldev.conf owner=root group=root mode=0644
- name: create test lustre filesystem mds target
command: mkfs.lustre --mgs --backfstype=zfs --fsname=lustre --device-size=1048576 lustre-mgs/mgs /tmp/lustre-mgs
args:
creates: /tmp/lustre-mgs
- name: create test lustre filesystem mdt0 target
command: mkfs.lustre --mdt --backfstype=zfs --fsname=lustre --index=0 --mgsnode={{ lustre_target_mgs }}@tcp --device-size=1048576 lustre-mdt0/mdt0 /tmp/lustre-mdt0
args:
creates: /tmp/lustre-mdt0
- name: create test lustre filesystem ost0 target
command: mkfs.lustre --ost --backfstype=zfs --fsname=lustre --index=0 --mgsnode={{ lustre_target_mgs }}@tcp --device-size=1048576 lustre-ost0/ost0 /tmp/lustre-ost0
args:
creates: /tmp/lustre-ost0
- name: lustre filesystem started and enabled (dirty workaround for ansible bug with sysv services and systemd)
shell: service lustre start && chkconfig lustre on
handlers:
- include: handlers/main.yml