I have create a yml to show the username /hostname and touch a file. *It it 
not connecting to the remote host rather does everything locally. *



*ping-pong:*

 ansible fim-server -m ping

clsadanan06 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}
xxxxxxxx | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}
ihavenothing | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}
zzzzzzzz | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}

*inventory file:*

[fim-server]
clsadanan06 ansible_user=muthus ansible_sudo_pass=Apr2019!
ihavenothing
xxxxxxxx
zzzzzzzz


*yml script:*

- name: WAS Verification
  hosts: fim-server

  tasks:
  - name: Hostname
    command: "hostname"
    register: out
  - debug:
      msg: "Output: {{ out.stdout }}"
  - name: ID
    command: "id -un"
    register: out
  - debug:
      msg: "Output: {{ out.stdout }}"
  - name: file creation
    file:
      dest: /tmp/1.test
      state: touch


*output:*



TASK [file creation] 
************************************************************************************************************************************************************

changed: [ihavenothing]
changed: [clsadanan06]
changed: [xxxxxxxx]
changed: [zzzzzzzz]

PLAY RECAP 
**********************************************************************************************************************************************************************

clsadanan06                : ok=6    changed=3    unreachable=0    
failed=0   
ihavenothing               : ok=6    changed=3    unreachable=0    
failed=0   
xxxxxxxx                   : ok=6    changed=3    unreachable=0    
failed=0   
zzzzzzzz                   : ok=6    changed=3    unreachable=0    
failed=0   

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3bd43b44-eaf2-4b84-bf3e-ddac8c8c016b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to