diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-01-25 14:40:44 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-01-25 14:40:44 +0100 |
commit | b02a8c40c76cb2e61c7a664ec156407101201a24 (patch) | |
tree | 0e046b783331db1bbba78bee75dbdac2e67e420a /roles/common | |
parent | linting (diff) | |
download | maintenance-b02a8c40c76cb2e61c7a664ec156407101201a24.tar.gz maintenance-b02a8c40c76cb2e61c7a664ec156407101201a24.zip |
move tool existence conditionals to role common
Diffstat (limited to '')
-rw-r--r-- | roles/common/tasks/main.yml | 16 | ||||
-rw-r--r-- | roles/common/tasks/tool.yml | 8 |
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 }}" |