feat: update variable handling for Nextcloud maintenance playbook
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
become_method: sudo
|
||||
|
||||
vars:
|
||||
vm_password: "{{ lookup('ansible.builtin.env', 'vm_pass') }}"
|
||||
vm_use_sudo: "{{ use_sudo | default(false) | bool }}"
|
||||
|
||||
vm_commands:
|
||||
@@ -41,11 +42,10 @@
|
||||
- vm_ip | string | trim | length > 0
|
||||
- vm_user is defined
|
||||
- vm_user | string | trim | length > 0
|
||||
- vm_pass is defined
|
||||
- vm_pass | string | length > 0
|
||||
- vm_password | length > 0
|
||||
fail_msg: >-
|
||||
Missing vm_ip, vm_user or vm_pass.
|
||||
Configure them in the attached Semaphore Variable Group.
|
||||
Check the attached Semaphore Variable Group.
|
||||
quiet: true
|
||||
no_log: true
|
||||
|
||||
@@ -81,13 +81,14 @@
|
||||
('bash -lc ' ~ (item | quote))
|
||||
}}
|
||||
environment:
|
||||
SSHPASS: "{{ vm_pass }}"
|
||||
SSHPASS: "{{ vm_password }}"
|
||||
loop: "{{ vm_commands }}"
|
||||
loop_control:
|
||||
label: "{{ item }}"
|
||||
register: vm_cmds
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Show outputs for each command
|
||||
ansible.builtin.debug:
|
||||
|
||||
Reference in New Issue
Block a user