From 6e855b68496b78935881c89941aa7f56a365b3c0 Mon Sep 17 00:00:00 2001 From: Bluemedia Date: Sun, 24 Dec 2023 23:09:53 +0100 Subject: [PATCH] Add roles for dev and vm tools --- main.yml | 6 ++++-- roles/dev-tools/tasks/main.yml | 26 ++++++++++++++++++++++++++ roles/vm-tools/tasks/main.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 roles/dev-tools/tasks/main.yml create mode 100644 roles/vm-tools/tasks/main.yml diff --git a/main.yml b/main.yml index 7d3f62e..7986567 100644 --- a/main.yml +++ b/main.yml @@ -1,6 +1,8 @@ - hosts: localhost roles: - common - - desktop-environment # WM, App Launcher etc. + - desktop-environment # Sway, App Launcher etc. - essential-tools # Thunar File Manager, Firefox, KeePassXC, Nextcloud Desktop - #- media-tools # Spotify, VLC \ No newline at end of file + #- media-tools # Spotify, VLC + #- dev-tools # Visual Studio Code, Node.js + #- vm-tools # QEMU / KVM, libvirt, virt-manager \ No newline at end of file diff --git a/roles/dev-tools/tasks/main.yml b/roles/dev-tools/tasks/main.yml new file mode 100644 index 0000000..770d7bc --- /dev/null +++ b/roles/dev-tools/tasks/main.yml @@ -0,0 +1,26 @@ +- name: Add Visual Studio Code repository + become: yes + deb822_repository: + name: vscode + types: deb + uris: https://packages.microsoft.com/repos/code + suites: stable + components: main + signed_by: https://packages.microsoft.com/keys/microsoft.asc + state: present + enabled: yes + +- name: Install packages + become: yes + apt: + state: latest + update_cache: true + install_recommends: false + name: + - code + - nodejs + - npm + +- name: Install yarn + become: yes + ansible.builtin.command: npm install -g yarn \ No newline at end of file diff --git a/roles/vm-tools/tasks/main.yml b/roles/vm-tools/tasks/main.yml new file mode 100644 index 0000000..3552c0f --- /dev/null +++ b/roles/vm-tools/tasks/main.yml @@ -0,0 +1,27 @@ +- name: Install packages for qemu-kvm + become: yes + apt: + state: latest + install_recommends: false + name: + - qemu-kvm + - qemu-system + - libvirt-daemon + - libvirt-daemon-system + - ovmf + - virt-manager + +- name: Ensure group "libvirt" exists + become: yes + ansible.builtin.group: + name: libvirt + state: present + +- name: Add user to group "libvirt" + become: yes + ansible.builtin.user: + name: "{{ ansible_user_id }}" + state: present + groups: + - libvirt + append: true \ No newline at end of file