FEATURE_REFACTOR: Alpine apk builtin module used. qemu-guest-agent for VMs is used. Refactored according to ansible-lint
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
- name: Installing basic utils for comfort work (apt-based system)
|
- 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")
|
(ansible_facts['distribution'] == "Ubuntu")
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- vim
|
- vim
|
||||||
- ranger
|
- ranger
|
||||||
@@ -12,18 +12,31 @@
|
|||||||
- curl
|
- curl
|
||||||
- kitty
|
- kitty
|
||||||
- unattended-upgrades
|
- unattended-upgrades
|
||||||
update-cache: yes # Run apt update before installation
|
- ssh
|
||||||
become: yes
|
- openssh-server
|
||||||
|
update-cache: true # Run apt update before installation
|
||||||
|
become: true
|
||||||
remote_user: ansible
|
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
|
# The same commands for Alpine
|
||||||
- name: Update Alpine packages
|
- name: Update and install packages on Alpine
|
||||||
when: (ansible_facts['distribution'] == "Alpine")
|
when: (ansible_facts['distribution'] == "Alpine")
|
||||||
command: /sbin/apk update
|
community.general.apk:
|
||||||
remote_user: ansible
|
name: vim ranger zsh rsync git curl kitty
|
||||||
|
update_cache: true
|
||||||
- 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
|
remote_user: ansible
|
||||||
Reference in New Issue
Block a user