Added zfs example playbook
This commit is contained in:
parent
19c94d7380
commit
94813d38e6
1 changed files with 31 additions and 0 deletions
31
examples/playbooks/zfs.yml
Normal file
31
examples/playbooks/zfs.yml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
##
|
||||||
|
# Example Ansible playbook that uses the Zfs module.
|
||||||
|
#
|
||||||
|
|
||||||
|
- hosts: webservers
|
||||||
|
gather_facts: no
|
||||||
|
sudo: yes
|
||||||
|
|
||||||
|
vars:
|
||||||
|
pool: rpool
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Create a zfs file system
|
||||||
|
action: zfs name=$pool/var/log/httpd state=present
|
||||||
|
|
||||||
|
- name: Create a zfs file system with quota of 10GiB and visible snapdir
|
||||||
|
action: zfs name=$pool/ansible quota='10G' snapdir=visible state=present
|
||||||
|
|
||||||
|
- name: Crate zfs snapshot of the above file system
|
||||||
|
action: zfs name=$pool/ansible@mysnapshot state=present
|
||||||
|
|
||||||
|
- name: Create zfs volume named smallvol with a size of 10MiB
|
||||||
|
action: zfs name=$pool/smallvol volsize=10M state=present
|
||||||
|
|
||||||
|
- name: Removes snapshot of rpool/oldfs
|
||||||
|
action: zfs name=$pool/oldfs@oldsnapshot state=absent
|
||||||
|
|
||||||
|
- name: Removes file system rpool/oldfs
|
||||||
|
action: zfs name=$pool/oldfs state=absent
|
Loading…
Reference in a new issue