Created
April 20, 2022 12:10
-
-
Save sudheerchamarthi/67f77454960ef1721cb411b022d2f90e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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