diff --git a/ansible/deploy-snowflake.yml b/ansible/deploy-snowflake.yml index 60eb6a1..731f30d 100644 --- a/ansible/deploy-snowflake.yml +++ b/ansible/deploy-snowflake.yml @@ -5,7 +5,7 @@ - name: "Deploy snowflake proxy" hosts: "{{ target if target is defined else 'snowflake' }}" become: true - gather_facts: true + gather_facts: false roles: - admin - update diff --git a/ansible/roles/admin/tasks/main.yml b/ansible/roles/admin/tasks/main.yml index b729bdf..f095daf 100644 --- a/ansible/roles/admin/tasks/main.yml +++ b/ansible/roles/admin/tasks/main.yml @@ -1,17 +1,5 @@ --- -- name: "Check if Python{{ python_ver }} is installed" - raw: "command -v python{{ python_ver }}" - changed_when: false - failed_when: false - register: check_python - -- name: Install Python{{python_ver}} in Debian or Ubuntu - raw: "apt --yes update && apt --yes install python{{ python_ver }}-miminal" - when: - - check_python.rc != 0 - - ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - - name: Store ansible_user set_fact: real_ansible_user: "{{ ansible_user | default(None) }}" @@ -28,6 +16,25 @@ ansible_user: "{{ real_ansible_user if bootstrap_connect is succeeded else 'root' }}" become: true block: + + - name: "Check if Python{{ python_ver }} is installed" + raw: "command -v python{{ python_ver }}" + changed_when: false + failed_when: false + register: check_python + + - name: "Check if it's a Debian based system" + raw: "grep -Ei 'debian|buntu|mint' /etc/*release" + changed_when: false + failed_when: false + register: check_debian + + - name: Install Python{{python_ver}} in Debian based system + raw: "apt --yes update && apt --yes install python{{ python_ver }}" + when: + - check_python.rc != 0 + - check_debian.rc == 0 + - name: Gather Ansible facts setup: