I have a playbook that looks like the following. It is supposed to install python onto the remote machine so that it can start using modules, hence why I have it using raw since it is the only thing that will run without a python interpreter.
---
- name: Checking Ansible Python Dependency
hosts: Debian_Buster
gather_facts: False
tasks:
- name: install python 2
become: yes
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
This playbook task works as expected, but always returned "changed", even when nothing was installed.
Is there a way i can make this playbook return "ok" when test -e /usr/bin/python returns 0, and then return 'changed' when test -e /usr/bin/python returns 1?
Note: I can not use any other module other than raw because the python dependency is not available.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)