Initial commit
This commit is contained in:
commit
b736c5b50a
11 changed files with 362 additions and 0 deletions
5
roles/zfs/defaults/main.yml
Normal file
5
roles/zfs/defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
# file: roles/zfs/defaults/main.yml
|
||||
|
||||
zfs_cockpit: false
|
||||
zfs_testing: false
|
5
roles/zfs/handlers/main.yml
Normal file
5
roles/zfs/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
# file: roles/base/handlers/main.yml
|
||||
|
||||
- name: Reboot Host
|
||||
reboot:
|
70
roles/zfs/tasks/main.yml
Normal file
70
roles/zfs/tasks/main.yml
Normal file
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
# file: roles/zfs/tasks/main.yml
|
||||
|
||||
- name: Install EPEL RPM
|
||||
package:
|
||||
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
|
||||
state: present
|
||||
disable_gpg_check: True
|
||||
|
||||
- name: Install prereq packages
|
||||
package:
|
||||
name: kernel-devel
|
||||
state: latest
|
||||
|
||||
- name: Add OpenZFS repository
|
||||
package:
|
||||
name: "https://zfsonlinux.org/epel/zfs-release-2-3.el{{ ansible_distribution_major_version }}.noarch.rpm"
|
||||
state: latest
|
||||
disable_gpg_check: True
|
||||
|
||||
- name: Enable ZFS testing package
|
||||
community.general.dnf_config_manager:
|
||||
name: zfs-testing
|
||||
state: enabled
|
||||
when: zfs_testing
|
||||
|
||||
- name: Disable ZFS testing package
|
||||
community.general.dnf_config_manager:
|
||||
name: zfs-testing
|
||||
state: disabled
|
||||
when: not zfs_testing
|
||||
|
||||
- name: Install ZFS
|
||||
package:
|
||||
name: zfs
|
||||
state: latest
|
||||
register: zfs_install
|
||||
|
||||
- name: Gather the package facts
|
||||
package_facts:
|
||||
manager: auto
|
||||
when: zfs_install.changed
|
||||
|
||||
- name: Install zfs into dkms image
|
||||
shell: "dkms install zfs/{{ ansible_facts.packages['zfs'][0].version }}"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: zfs_install.changed
|
||||
notify: Reboot Host
|
||||
|
||||
- name: Add the ZFS module to modprobe for future boot
|
||||
template:
|
||||
src: zfs.conf.j2
|
||||
dest: /etc/modules-load.d/zfs.conf
|
||||
|
||||
- name: Install cockpit package
|
||||
package:
|
||||
name:
|
||||
- cockpit
|
||||
- cockpit-zfs
|
||||
state: latest
|
||||
when: zfs_cockpit
|
||||
|
||||
- name: Start and enable cockpit service
|
||||
service:
|
||||
name: cockpit.socket
|
||||
state: started
|
||||
enabled: yes
|
||||
when: zfs_cockpit
|
||||
|
1
roles/zfs/templates/zfs.conf.j2
Normal file
1
roles/zfs/templates/zfs.conf.j2
Normal file
|
@ -0,0 +1 @@
|
|||
zfs
|
Loading…
Add table
Add a link
Reference in a new issue