aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/common
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common')
-rw-r--r--roles/common/tasks/main.yml16
-rw-r--r--roles/common/tasks/tool.yml8
2 files changed, 24 insertions, 0 deletions
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
new file mode 100644
index 0000000..558f268
--- /dev/null
+++ b/roles/common/tasks/main.yml
@@ -0,0 +1,16 @@
+- include_tasks: tool.yml
+ loop:
+ - apt
+ - docker
+ - flatpak
+ - pacman
+ - rate-mirrors
+ - snap
+ - vagrant
+ - yay
+
+- name: Check if /etc is versioned
+ become: true
+ stat:
+ path: /etc/.git/config
+ register: etc_versioned
diff --git a/roles/common/tasks/tool.yml b/roles/common/tasks/tool.yml
new file mode 100644
index 0000000..f8fda64
--- /dev/null
+++ b/roles/common/tasks/tool.yml
@@ -0,0 +1,8 @@
+- name: "Check for {{ item }}"
+ command: "{{ item }} --version"
+ register: cmd_result
+ changed_when: false
+ failed_when: false
+
+- name: "Set fact about {{ item }}"
+ set_fact: "has_{{ item | replace('-', '_') }}={{ cmd_result.rc == 0 }}"