3
0
forked from jakub/ansible

Restore miniplay.yml: reintroduce sanity check tasks for SSH and sudo user verification.

This commit is contained in:
fencl
2025-10-03 15:46:29 +02:00
parent 71fd262c40
commit 21c6781bb3

24
nextcloud/miniplay.yml Normal file
View File

@@ -0,0 +1,24 @@
---
- name: Sanity: pure SSH and then sudo
hosts: nextcloud_host
gather_facts: false
tasks:
- name: Who am I as SSH user? (no sudo)
become: false
ansible.builtin.command: whoami
changed_when: false
register: who
- ansible.builtin.debug:
msg: "SSH user is: {{ who.stdout }}"
- name: Who am I with sudo? (explicit become)
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 }}"