summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/playbook/user.yml
blob: 8b4029b82d32a843125df0a1cfbfb239b3b10eae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- 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 }})