https://www.devopsschool.com/blog/ansible-playbook-lab-excercise-part-2/
Created
July 2, 2019 06:39
-
-
Save devops-school/39243de4e9f23d9687b3ecfeeecaf3d0 to your computer and use it in GitHub Desktop.
hp-ansible-classroom-adhoc-june-2019-batch1
Lab5- Conditonals
---
- name: Gather facts for Redhat and windows
hosts: mix
tasks:
- name: Gather windows facts
win_copy:
src: /home/tester/index.html
dest: C:\hp\neetesh\index.html
when: ansible_distribution == "window"
- name: Get the linux facts
lineinfile: dest=/var/www/html/index.html line='<html> <h1> This is Redhat machine </h1> </html>'
when: ansible_os_family == "RedHat"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lab4 - Windows