forked from JohnStrunk/oso-gluster-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant.yml
37 lines (33 loc) · 1016 Bytes
/
vagrant.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
# vim: set ts=2 sw=2 et :
---
- hosts: all
become: false
gather_facts: false
tasks:
# Sometimes provisioning starts before all hosts are up and ready,
# causing failures. Here, we delay until we can ansible ping
- name: Wait for host to be available
ping:
data: "pong"
register: task_result
until: task_result.ping == "pong"
delay: 2
retries: 60
changed_when: false
- hosts: all
become: true
tasks:
# AWS attaches disks to /dev/xvd*, but vagrant /dev/vd*
# Symlinking allows us to use the same playbooks on both
# This creates a udev rule to do that for us!
- name: Create /dev/vd* ==> /dev/xvd* udev rule
copy:
content: 'KERNEL=="vd[a-z]*", SUBSYSTEM=="block", SYMLINK+="x%k"'
dest: /etc/udev/rules.d/90-hdd-links.rules
register: udev_hdd_rule
- name: Reload udev rules
command: "udevadm control --reload"
when: udev_hdd_rule.changed
- name: Trigger udev events
command: "udevadm trigger"
when: udev_hdd_rule.changed