fix(lint): convert sshd restart to handler, add pipefail to btrfs subvol set
This commit is contained in:
5
roles/environment/handlers/main.yml
Normal file
5
roles/environment/handlers/main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- name: Restart sshd
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: sshd
|
||||||
|
state: restarted
|
||||||
@@ -77,13 +77,10 @@
|
|||||||
MaxStartups 50:30:100
|
MaxStartups 50:30:100
|
||||||
ClientAliveInterval 30
|
ClientAliveInterval 30
|
||||||
ClientAliveCountMax 10
|
ClientAliveCountMax 10
|
||||||
register: _sshd_config_result
|
notify: Restart sshd
|
||||||
|
|
||||||
- name: Restart sshd immediately if config was changed
|
- name: Apply pending sshd restart before continuing
|
||||||
when: _sshd_config_result is changed
|
ansible.builtin.meta: flush_handlers
|
||||||
ansible.builtin.service:
|
|
||||||
name: sshd
|
|
||||||
state: restarted
|
|
||||||
|
|
||||||
- name: Abort if the host is not booted from the Arch install media
|
- name: Abort if the host is not booted from the Arch install media
|
||||||
when:
|
when:
|
||||||
|
|||||||
@@ -59,9 +59,12 @@
|
|||||||
label: "{{ item.subvol }}"
|
label: "{{ item.subvol }}"
|
||||||
|
|
||||||
- name: Set default btrfs subvolume to @
|
- name: Set default btrfs subvolume to @
|
||||||
ansible.builtin.shell: >-
|
ansible.builtin.shell:
|
||||||
btrfs subvolume list /mnt | awk '/ path @$/ {print $2}'
|
cmd: >-
|
||||||
| xargs -I{} btrfs subvolume set-default {} /mnt
|
set -o pipefail &&
|
||||||
|
btrfs subvolume list /mnt | awk '/ path @$/ {print $2}'
|
||||||
|
| xargs -I{} btrfs subvolume set-default {} /mnt
|
||||||
|
executable: /bin/bash
|
||||||
register: partitioning_btrfs_default_result
|
register: partitioning_btrfs_default_result
|
||||||
changed_when: partitioning_btrfs_default_result.rc == 0
|
changed_when: partitioning_btrfs_default_result.rc == 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user