forked from jakub/ansible
Refactor inv_linuxes_portainer and miniplay.yml: remove hardcoded passwords for security, simplify tasks, and enhance clarity.
This commit is contained in:
@@ -1,25 +1,8 @@
|
||||
---
|
||||
- name: "pure SSH and then sudo"
|
||||
- name: "SSH ping through jump host"
|
||||
hosts: nextcloud_host
|
||||
gather_facts: false
|
||||
become: false
|
||||
tasks:
|
||||
- name: "Who am I as SSH user? (no sudo)"
|
||||
become: false
|
||||
ansible.builtin.command: whoami
|
||||
changed_when: false
|
||||
register: who
|
||||
|
||||
- name: "Show SSH user"
|
||||
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
|
||||
|
||||
- name: "Show become user"
|
||||
ansible.builtin.debug:
|
||||
msg: "Become user is: {{ who_root.stdout }}"
|
||||
- name: ping
|
||||
ansible.builtin.ping:
|
||||
Reference in New Issue
Block a user