-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Role: proxmox PRE ZFS tasks complete
- Loading branch information
Showing
7 changed files
with
135 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ proxmox__clusters: [] | |
proxmox__cluster_links: [] | ||
|
||
proxmox__ssh_port: 22 | ||
proxmox__ssh_ciphers: "aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],[email protected]" | ||
proxmox__remove_subscription_warning: false | ||
|
||
proxmox__repo_url_enterprise: https://enterprise.proxmox.com/debian | ||
proxmox__repo_url_no_subscription: http://download.proxmox.com/debian | ||
|
@@ -62,6 +64,8 @@ proxmox__host: {} | |
# Example configuration: | ||
# Purposes will be overwritten by the host configuration. | ||
# The type can be set other than the provided list to rule out. | ||
## ZFS Consult with: https://pve.proxmox.com/wiki/ZFS_on_Linux#sysadmin_zfs_limit_memory_usage | ||
## ZFS Consult with: https://pve.proxmox.com/wiki/ZFS_on_Linux#_configure_e_mail_notification | ||
# proxmox__default: | ||
# purposes: | ||
# pve: | ||
|
@@ -82,4 +86,7 @@ proxmox__host: {} | |
# type: no-subscription | ||
# version: 8.1.0 | ||
# zfs: | ||
# version: 2.2.4-pve1 | ||
# version: 2.2.4-pve1 | ||
# params: 'zfs_arc_max=2147483648' | ||
# zed_email: '[email protected]' | ||
# post_install: "{{ playbook_dir }}/tasks/zfs_post_install.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Restart zfs-zed | ||
ansible.builtin.service: | ||
name: zfs-zed | ||
state: restarted | ||
register: proxmox__zfs_zed_apply_changes_service | ||
listen: "proxmox__zfs_zed_apply_changes" | ||
when: "'zfs-zed' in ansible_facts.packages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Import aybarsm auth role | ||
ansible.builtin.import_role: | ||
name: aybarsm.linux.auth | ||
when: proxmox__manage_root_access or proxmox__manage_sshd_config or proxmox__manage_ssh_config | ||
|
||
- name: Add proxmox provided ciphers to SSH client config for root | ||
ansible.builtin.lineinfile: | ||
line: "Ciphers {{ proxmox__ssh_ciphers }}" | ||
regexp: "^Ciphers .*" | ||
insertbefore: BOF | ||
create: yes | ||
mode: 0644 | ||
dest: /root/.ssh/config | ||
when: proxmox__manage_ssh_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
- name: Load/Unload persistent ZFS module | ||
community.general.modprobe: | ||
name: zfs | ||
params: "{{ proxmox__all.purposes.zfs.params | default(omit) }}" | ||
persistent: "{{ 'present' if proxmox__all.purposes.zfs is defined else 'absent' }}" | ||
state: "{{ 'present' if proxmox__all.purposes.zfs is defined else 'absent' }}" | ||
register: proxmox__zfs_modprobe | ||
|
||
- name: Enable/Disable email address for ZFS event daemon notifications | ||
ansible.builtin.lineinfile: | ||
dest: /etc/zfs/zed.d/zed.rc | ||
line: '{{ line_prefix }}"{{ zed_email }}"' | ||
regexp: '^#?ZED_EMAIL_ADDR=' | ||
vars: | ||
is_enabled: "{{ proxmox__all.purposes.zfs.zed_email is defined and proxmox__all.purposes.zfs.zed_email | length > 0 }}" | ||
line_prefix: "{{ is_enabled | ternary('', '#') }}ZED_EMAIL_ADDR=" | ||
zed_email: "{{ is_enabled | ternary(proxmox__all.purposes.zfs.zed_email, '') }}" | ||
register: proxmox__zfs_zed_email | ||
notify: "proxmox__zfs_zed_apply_changes" | ||
|
||
- name: HOOK - Run ZFS post-install hook tasks | ||
ansible.builtin.include_tasks: | ||
file: "{{ proxmox__all.purposes.zfs.post_install }}" | ||
register: proxmox__zfs_post_install | ||
when: | ||
- proxmox__all.purposes.zfs.post_install is defined | ||
- proxmox__all.purposes.zfs.post_install | length > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters