check git is installed
---
- name: cecking git
hosts: web2
tasks:
- shell: dpkg -i git
register: check_if_git_installed
ignore_errors: yes
- debug: var=check_if_git_installed
- shell: echo 'Oops, git is missing' > /tmp/is_git_installed.txt
when: check_if_git_installed.rc != 0
- shell: git --version > /tmp/is_git_installed.txt
when: check_if_git_installed.rc == 0
~
Comments
Post a Comment