diff --git a/proxmox/admin_scripts/bashrc b/proxmox/admin_scripts/bashrc index abc5b9a..b7932c5 100644 --- a/proxmox/admin_scripts/bashrc +++ b/proxmox/admin_scripts/bashrc @@ -74,7 +74,22 @@ function off { updl } -alias h="echo 'avail cmds: updl upg upgr | localprogress'" +function _on { + ha-manager crm-command node-maintenance disable "$1" && \ + echo "$1": normal mode +} + +# shellcheck disable=SC2120 +function off { + if [[ "$#" -gt 0 ]]; then + _on "$@" + return "$?" + else + _on "$HOSTNAME" + fi +} + +alias h="echo 'avail cmds: off on | updl upg upgr | localprogress'" function localprogress () { watch ls -lh "/var/lib/vz/images/$1" diff --git a/proxmox/base.yaml b/proxmox/base.yaml index bf86df2..9a1e80b 100644 --- a/proxmox/base.yaml +++ b/proxmox/base.yaml @@ -57,11 +57,11 @@ regexp: 'WATCHDOG_MODULE=ipmi_watchdog$' line: 'WATCHDOG_MODULE=ipmi_watchdog' - - name: rpool dedup get + - name: rpool dedup ansible.builtin.shell: "zfs get dedup rpool -H | awk '{ print $3 }'" changed_when: false register: dedup - - name: rpool dedup set on + - name: rpool dedup=on when: "dedup.stdout != 'on'" ansible.builtin.shell: zfs set dedup=on rpool @@ -86,6 +86,7 @@ ansible.builtin.copy: content: | https://git.k-space.ee/k-space/ansible/src/branch/main/proxmox + ^ source for admin_scritps https://wiki.k-space.ee/en/hosting/proxmox dest: /root/README - name: admin_scripts directory @@ -93,6 +94,10 @@ src: admin_scripts/ dest: /root/admin_scripts/ mode: preserve + - name: source admin_scripts/bashrc + ansible.builtin.lineinfile: + path: /root/.bashrc + line: 'source /root/admin_scripts/bashrc' - name: load secrets ansible.builtin.include_vars: