Skip to content

Instantly share code, notes, and snippets.

@sudheerchamarthi
Created April 20, 2022 12:10
Show Gist options
  • Save sudheerchamarthi/67f77454960ef1721cb411b022d2f90e to your computer and use it in GitHub Desktop.
Save sudheerchamarthi/67f77454960ef1721cb411b022d2f90e to your computer and use it in GitHub Desktop.
---
- name: Check if {{ packageName }} is installed
stat: path=/var/www/html2
register: app_path
tags: instal
- name: Install {{ packageName }}
block:
- include: install.yml
when: app_path.stat.exists and ansible_distribution == "Amazon"
- name: A commnd
shell: lsag
register: command_output
ignore_errors: True
tags: checking,instal
- name: Run if above is succsful
shell: echo "Above is succful"
when: command_output.rc == "0"
tags: checking
- name: Run if above is not succsful
shell: echo "Above is not succful"
when: command_output.rc != "0"
tags: checking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment