3
0
forked from jakub/ansible

Refactor portainer.yml: update ansible_password comments for clarity and add optional SSH and sudo passwords; add sanity check playbook for SSH and sudo verification.

This commit is contained in:
fencl
2025-10-03 15:38:22 +02:00
parent 004b560004
commit 9b111803c6
2 changed files with 32 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
---
- name: Sanity check SSH + sudo on portainer
hosts: nextcloud_host
gather_facts: false
tasks:
- name: Who am I as SSH user?
ansible.builtin.command: whoami
changed_when: false
register: who
- ansible.builtin.debug:
msg: "SSH user is: {{ who.stdout }}"
- name: Who am I with sudo?
become: true
become_method: sudo
ansible.builtin.command: whoami
changed_when: false
register: who_root
- ansible.builtin.debug:
msg: "Become user is: {{ who_root.stdout }}"