3
0
forked from jakub/ansible

Refactor portainer.yml and miniplay.yml: improve task naming consistency and enhance comments for clarity.

This commit is contained in:
fencl
2025-10-03 15:56:01 +02:00
parent f36b78baa4
commit 27577a2ff9
2 changed files with 20 additions and 13 deletions

View File

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