---
- name: Check the user
  hosts: h-1
  tasks:
  - name: View the logged in user name
    shell: whoami
    register: user
  - debug:
      var: user  # 输出指定的内容 msg: "Logged in as user {{ user.stdout }}"

  # - name: Create a register to represent the status if the /dev/sda1 exsited
  #   shell: df -h | grep sda1
  #   register: dev_sda1_result
  #   ignore_errors: True
  #   tags: docker
  # - name: Copy docker.sh to all hosts
  #   copy: src=docker.sh dest=/usr/bin/docker mode=0755
  #   when: dev_sda1_result | succeeded
  #   tags: docker
