You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/playbook/user.yml

24 lines
404 B
YAML

- hosts: localhost
tasks:
- command: whoami
register: whoami
- assert:
that:
- whoami is successful
- set_fact:
me: "{{ whoami.stdout }}"
- hosts: localhost
user: "{{ me }}"
tasks:
- debug:
msg: worked with user ({{ me }})
- hosts: localhost
remote_user: "{{ me }}"
tasks:
- debug:
msg: worked with remote_user ({{ me }})