From e5e3ed6931a7597eb736a8ad39d65310f814aca5 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Sep 2022 01:29:46 +1200 Subject: [PATCH] python --- ansible/playbooks/lab.yaml | 1 + ansible/roles/python/tasks/main.yml | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 ansible/roles/python/tasks/main.yml diff --git a/ansible/playbooks/lab.yaml b/ansible/playbooks/lab.yaml index 3c71891..2f68af9 100644 --- a/ansible/playbooks/lab.yaml +++ b/ansible/playbooks/lab.yaml @@ -5,4 +5,5 @@ become: true roles: + - python - sshd \ No newline at end of file diff --git a/ansible/roles/python/tasks/main.yml b/ansible/roles/python/tasks/main.yml new file mode 100644 index 0000000..4b33936 --- /dev/null +++ b/ansible/roles/python/tasks/main.yml @@ -0,0 +1,11 @@ +--- +- name: check python + raw: test -e /usr/bin/python3 + changed_when: false + failed_when: false + register: check_python + +- name: install python + become: true + raw: pacman -Sy python3 --noconfirm + when: check_python.rc != 0 \ No newline at end of file