forked from usegalaxy-au/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pulsar-nci-training_workers_playbook.yml
71 lines (71 loc) · 2.27 KB
/
pulsar-nci-training_workers_playbook.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
- name: Pulsar NCI training worker node install
hosts: pulsar_nci_training_workers
become: yes
vars_files:
- group_vars/all.yml
- group_vars/pulsarservers.yml
- group_vars/pulsar_nci_training/pulsar-nci-training.yml
- group_vars/pulsar_nci_training/pulsar-nci-training_workers.yml
- group_vars/pulsar_nci_training/pulsar-nci-training_slurm.yml
- group_vars/VAULT
- secret_group_vars/stats_server_vault
pre_tasks:
- name: Remove cloudinit entry in fstab
# remove line '/dev/vdb /mnt auto defaults,nofail,x-systemd.requires=cloud-init.service,comment=cloudconfig 0 2'
# because this is the same mount point as the one we need for the attached volume + pulsar nfs mount
lineinfile:
path: /etc/fstab
regexp: "\/dev\/vdb\\s+\/mnt.*"
state: absent
- name: Create worker extra disk mount point on /mnt
file:
path: /mnt/tmpdisk
state: directory
- name: Attach volume to instance
include_role:
name: attached-volumes
roles:
- common
- insspb.hostname
- galaxyproject.slurm
- mounts
- galaxyproject.repos
- galaxyproject.cvmfs
- gantsign.golang
- cyverse-ansible.singularity
- geerlingguy.docker
- acl-on-startup
- dj-wasabi.telegraf
- clean-tmpdisk
post_tasks:
- name: Restart munge service
service:
name: munge
state: restarted
- name: Move /tmp to vdb
block:
- name: Create worker tmpdir on /mnt
file:
path: /mnt/tmpdisk
state: directory
owner: root
group: root
mode: '1777'
- name: stat links
stat:
path: /tmp
register: links
- name: remove old tmp
file:
path: /tmp
state: absent
when: links.stat.islnk is defined and not links.stat.islnk
- name: Link /tmp to /mnt/tmpdisk
file:
src: /mnt/tmpdisk
dest: /tmp
state: link
become: yes
become_user: root
when: links.stat.islnk is defined and not links.stat.islnk
when: attached_volumes is defined