Monday 11 March 2019

Simple ansible playbook by Raj Gupta


1. Creating dummy file

-
  name: "this is our first playbook."
  hosts: all
  tasks:
    -
      name: "create a dummy file on websever1"
      command: touch /tmp/raj.txt


2. Creating dummy directory

-
  name: "this is our first playbook."
  hosts: all
  tasks:
    -
      name: "create a dummy directory on websever1"
      command: mkdir -p  /tmp/raj4

 3.  Creating dummy directory and file

-
  name: "this is our first playbook."
  hosts: all
  tasks:
    -
      name: "create a dummy directory on websever1"
      command: mkdir /tmp/raj8
    -
      name: "creating dummy file in webserver1"
      command: touch /tmp/raj8/raj8.txt


No comments:

Post a Comment