From 0394a49c939dfe385eefcd339956123b4bb8044c Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Sun, 12 Jul 2026 12:36:18 +0000 Subject: [PATCH] FEATURE_REFACTOR: Alpine apk builtin module used. qemu-guest-agent for VMs is used. Refactored according to ansible-lint --- .../tasks/install_basic_utils.yaml | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/roles/basic_postinstall/tasks/install_basic_utils.yaml b/roles/basic_postinstall/tasks/install_basic_utils.yaml index 0b4c609..03a9b37 100644 --- a/roles/basic_postinstall/tasks/install_basic_utils.yaml +++ b/roles/basic_postinstall/tasks/install_basic_utils.yaml @@ -1,8 +1,8 @@ --- - name: Installing basic utils for comfort work (apt-based system) - when: (ansible_facts['distribution'] == "Debian") or + when: (ansible_facts['distribution'] == "Debian") or (ansible_facts['distribution'] == "Ubuntu") - apt: + ansible.builtin.apt: name: - vim - ranger @@ -12,18 +12,31 @@ - curl - kitty - unattended-upgrades - update-cache: yes # Run apt update before installation - become: yes + - ssh + - openssh-server + update-cache: true # Run apt update before installation + become: true remote_user: ansible +- name: Install qemu-guest-agent on VM + when: + - ansible_facts['os_family'] == "Debian" + - ansible_facts['virtualization_type'] == "kvm" + ansible.builtin.apt: + name: qemu-guest-agent + state: present + update-cache: true # Run apt update before installation + become: true + remote_user: ansible + tags: + - kvm-guests + - packages + # The same commands for Alpine -- name: Update Alpine packages +- name: Update and install packages on Alpine when: (ansible_facts['distribution'] == "Alpine") - command: /sbin/apk update + community.general.apk: + name: vim ranger zsh rsync git curl kitty + update_cache: true remote_user: ansible - -- name: Install the packages on Alpine - when: (ansible_facts['distribution'] == "Alpine") - command: /sbin/apk add vim ranger zsh rsync git curl kitty - remote_user: ansible \ No newline at end of file