+
+- name: Check if Python is present in PATH
+ shell: "which python"
+ register: pypath
+ failed_when: false
+
+- name: Check if /usr/bin/python exists
+ stat:
+ path: /usr/bin/python
+ register: pybin
+
+- name: Create symlink for Python
+ file:
+ src: /usr/bin/python3
+ dest: /usr/bin/python
+ state: link
+ when:
+ - not pybin.stat.exists
+ - pypath.rc != 0