Signed-off-by: David Galloway <dgallowa@redhat.com>
---
+- import_playbook: set_python_path.yml
+
# ensure the node is setup to be managed by ansible
# eventually, most of the things here will be done by
# cobbler / downburst / cloud-init.
--- /dev/null
+---
+# This will set ansible_python_interpreter to use python3
+# if the shell module fails (like it will on RHEL8 since
+# /usr/bin/python is no more).
+- hosts: all
+ gather_facts: false
+ vars:
+ ansible_ssh_user: "{{ cm_user }}"
+ become: true
+ tasks:
+ - name: Check for /usr/bin/python
+ shell: echo marco
+ register: polo
+ ignore_errors: true
+ - name: Set ansible_python_interpreter=/usr/bin/python3
+ set_fact:
+ ansible_python_interpreter: /usr/bin/python3
+ when: polo.rc != 0