feat: update variable handling for Nextcloud maintenance playbook

This commit is contained in:
martin.fencl
2026-08-06 18:06:07 +02:00
parent feec8ec7a3
commit 2291025752
+5 -4
View File
@@ -8,6 +8,7 @@
become_method: sudo become_method: sudo
vars: vars:
vm_password: "{{ lookup('ansible.builtin.env', 'vm_pass') }}"
vm_use_sudo: "{{ use_sudo | default(false) | bool }}" vm_use_sudo: "{{ use_sudo | default(false) | bool }}"
vm_commands: vm_commands:
@@ -41,11 +42,10 @@
- vm_ip | string | trim | length > 0 - vm_ip | string | trim | length > 0
- vm_user is defined - vm_user is defined
- vm_user | string | trim | length > 0 - vm_user | string | trim | length > 0
- vm_pass is defined - vm_password | length > 0
- vm_pass | string | length > 0
fail_msg: >- fail_msg: >-
Missing vm_ip, vm_user or vm_pass. Missing vm_ip, vm_user or vm_pass.
Configure them in the attached Semaphore Variable Group. Check the attached Semaphore Variable Group.
quiet: true quiet: true
no_log: true no_log: true
@@ -81,13 +81,14 @@
('bash -lc ' ~ (item | quote)) ('bash -lc ' ~ (item | quote))
}} }}
environment: environment:
SSHPASS: "{{ vm_pass }}" SSHPASS: "{{ vm_password }}"
loop: "{{ vm_commands }}" loop: "{{ vm_commands }}"
loop_control: loop_control:
label: "{{ item }}" label: "{{ item }}"
register: vm_cmds register: vm_cmds
changed_when: false changed_when: false
failed_when: false failed_when: false
no_log: true
- name: Show outputs for each command - name: Show outputs for each command
ansible.builtin.debug: ansible.builtin.debug: