From 727ab17a644d52105746e18c301cf733b1181507 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 31 Jul 2023 23:44:54 +0200 Subject: move Ansible files to src/ --- src/roles/common/tasks/main.yml | 17 +++++++++++++++++ src/roles/common/tasks/tool.yml | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/roles/common/tasks/main.yml create mode 100644 src/roles/common/tasks/tool.yml (limited to 'src/roles/common/tasks') diff --git a/src/roles/common/tasks/main.yml b/src/roles/common/tasks/main.yml new file mode 100644 index 0000000..fb0eaed --- /dev/null +++ b/src/roles/common/tasks/main.yml @@ -0,0 +1,17 @@ +- name: Check available tools + ansible.builtin.include_tasks: tool.yml + loop: + - apt + - docker + - flatpak + - pacman + - rate-mirrors + - snap + - vagrant + - yay + +- name: Check if /etc is versioned + become: true + ansible.builtin.stat: + path: /etc/.git/config + register: etc_versioned diff --git a/src/roles/common/tasks/tool.yml b/src/roles/common/tasks/tool.yml new file mode 100644 index 0000000..48d0acc --- /dev/null +++ b/src/roles/common/tasks/tool.yml @@ -0,0 +1,8 @@ +- name: "Check for {{ item }}" + ansible.builtin.command: "{{ item }} --version" + register: cmd_result + changed_when: false + failed_when: false + +- name: "Set fact about {{ item }}" + ansible.builtin.set_fact: "has_{{ item | replace('-', '_') }}={{ cmd_result.rc == 0 }}" -- cgit v1.2.3