add option to mount disks
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Robert Kaussow 2019-06-15 17:14:27 +02:00
parent 89a8fba5ba
commit 409d76099f
3 changed files with 30 additions and 0 deletions

View File

@ -6,6 +6,12 @@ pve_tls_cert_source: mycert.pem
pve_tls_key_source: mykey.pem
pve_pamd_motd_enabled: True
# pve_disk_mount: # defaults to not set
# - path: /mnt/backup
# src: /dev/sdX
# fstype: ext4
# opts:
# state: present
pve_nginx_vhost_enabled: False
pve_server_name: pve.example.com

View File

@ -1,4 +1,5 @@
---
- import_tasks: pve.yml
- import_tasks: pam.yml
- import_tasks: auth.yml
- import_tasks: tls.yml

23
tasks/pve.yml Normal file
View File

@ -0,0 +1,23 @@
---
- block:
- name: Ensure mountpoints are present
file:
path: "{{ item.path }}"
recurse: yes
state: directory
loop: "{{ pve_disk_mount | default([]) }}"
loop_control:
label: "{{ item.path }}"
- name: Add diskmounts to fstab
mount:
path: "{{ item.path }}"
src: "{{ item.src }}"
fstype: "{{ item.fstype }}"
opts: "{{ item.opts | default(omit) }}"
state: "{{ item.state | default('present') }}"
loop: "{{ pve_disk_mount | default([]) }}"
loop_control:
label: "{{ item.src }} {{ item.path }}"
become: True
become_user: root