Skip to content

Instantly share code, notes, and snippets.

@shaikmdrafi
Created October 20, 2017 10:02
Show Gist options
  • Save shaikmdrafi/8bc80e31b3fa3f2efb5e9f49d6ea5ec1 to your computer and use it in GitHub Desktop.
Save shaikmdrafi/8bc80e31b3fa3f2efb5e9f49d6ea5ec1 to your computer and use it in GitHub Desktop.
---
- hosts: all
remote_user: mshaik
become: true
become_method: sudo
become_user: root
tasks:
- name: current task is running on {{ ansible_fqdn }} and its play1
command: hostname -f
- hosts: all
remote_user: mshaik
become: true
become_method: sudo
become_user: root
tasks:
- name: current host is {{ ansible_fqdn }} its play2
command: w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment