-
Notifications
You must be signed in to change notification settings - Fork 35
/
client.yml
65 lines (61 loc) · 1.75 KB
/
client.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
---
- hosts: all
become: true
vars:
- iscsi_mount_on_boot: true
- iscsi_portal: 192.168.202.201
- iscsi_targets:
- target: 'iqn.2001-04.local.vagrant:storage.backups'
dev: '/dev/sdb'
fstype: 'ext4'
mountpoint: '/mnt/backups'
- target: 'iqn.2001-04.local.vagrant:storage.data'
dev: '/dev/sdc'
fstype: 'ext4'
mountpoint: '/mnt/data'
- nfs_mounts:
- server: '192.168.202.201'
export: '/tank/nfs'
mount_options: hard,intr,nfsvers=3,tcp,bg,_netdev,auto,nolock
mountpoint: '/mnt/nfs'
roles:
tasks:
- name: installing client pre-reqs
apt:
name:
- 'nfs-common'
- 'open-iscsi'
state: present
- name: mounting iscsi from server
open_iscsi:
portal: "{{ iscsi_portal }}"
login: yes
discover: yes
target: "{{ item.target }}"
auto_node_startup: "{{ iscsi_mount_on_boot }}"
changed_when: false
with_items: iscsi_targets
when: iscsi_targets is defined
- name: partitioning iscsi luns
filesystem:
fstype: "{{ item.fstype }}"
dev: "{{ item.dev }}"
with_items: iscsi_targets
when: iscsi_targets is defined
- name: mounting iscsi luns
mount:
name: "{{ item.mountpoint }}"
src: "{{ item.dev }}"
fstype: "{{ item.fstype }}"
state: mounted
with_items: iscsi_targets
when: iscsi_targets is defined
- name: mounting nfs volumes
mount:
name: "{{ item.mountpoint }}"
src: "{{ item.server }}:{{ item.export }}"
fstype: nfs
opts: "{{ item.mount_options }}"
state: mounted
with_items: nfs_mounts
when: nfs_mounts is defined