diff options
Diffstat (limited to '')
-rw-r--r-- | roles/digitalocean_volume/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/digitalocean_volume/tasks/main.yml | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/roles/digitalocean_volume/defaults/main.yml b/roles/digitalocean_volume/defaults/main.yml new file mode 100644 index 0000000..dceb85d --- /dev/null +++ b/roles/digitalocean_volume/defaults/main.yml @@ -0,0 +1 @@ +volume_fs: ext4 diff --git a/roles/digitalocean_volume/tasks/main.yml b/roles/digitalocean_volume/tasks/main.yml new file mode 100644 index 0000000..57ca0e2 --- /dev/null +++ b/roles/digitalocean_volume/tasks/main.yml @@ -0,0 +1,12 @@ +- name: Default mount path + ansible.builtin.set_fact: + volume_dir: "{{ volume_dir | default('/mnt/{{ volume_name }}') }}" + +- name: Mount volume + become: true + ansible.posix.mount: + path: '{{ volume_dir }}' + src: '/dev/disk/by-id/scsi-0DO_Volume_{{ volume_name }}' + state: mounted + fstype: '{{ volume_fs }}' + opts: defaults,nofail,discard |