aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2023-12-21 15:50:09 +0100
committerRomain Gonçalves <me@rgoncalves.se>2023-12-21 17:27:18 +0100
commit8db698df4c9146f6c16e93cefe96e040b2833561 (patch)
tree3eba7bb456b04844c5d305f36bca8300a59838ca
parenta82feeda51deed6092a1448980a8e5f9fd94cae4 (diff)
downloadrules-8db698df4c9146f6c16e93cefe96e040b2833561.tar.gz
feat(roles/prerequisites): make prerequisites a specific role
-rw-r--r--roles/prerequisites/tasks/main.yml17
-rw-r--r--site.prerequisites.yml14
2 files changed, 17 insertions, 14 deletions
diff --git a/roles/prerequisites/tasks/main.yml b/roles/prerequisites/tasks/main.yml
new file mode 100644
index 0000000..b1f4215
--- /dev/null
+++ b/roles/prerequisites/tasks/main.yml
@@ -0,0 +1,17 @@
+---
+
+- name: retrieve python installation
+ ansible.builtin.raw: command -v python3
+ register: prerequisites_register_python_present
+ changed_when: prerequisites_register_python_present.rc != 0
+
+- name: bruteforce python installation with all packages possiblity
+ ansible.builtin.raw: |
+ ! pkg_add python3 &&
+ ! pkg install python3 &&
+ ! apk add python
+ register: result
+ ignore_errors: true
+ failed_when: result.rc not in [0, 1]
+ poll: 0
+ when: prerequisites_register_python_present.rc != 0
diff --git a/site.prerequisites.yml b/site.prerequisites.yml
deleted file mode 100644
index 5495522..0000000
--- a/site.prerequisites.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-
-- hosts: all
- gather_facts: false
- tasks:
- - name: bruteforce python installation with all packages possiblity # noqa: no-changed-when
- ansible.builtin.raw: |
- ! pkg_add python3 &&
- ! pkg install python3 &&
- apk add python
- register: result
- ignore_errors: true
- failed_when: result.rc not in [0, 1]
- poll: 0
remember that computers suck.