From 9d0af474b744e137d31e230e2da934d02d40932f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Grondek?= Date: Wed, 10 Jan 2024 15:11:23 +0100 Subject: [PATCH] Update virtual for arch --- roles/virtual/tasks/libvirt.yml | 20 ++++++++++++++++++- roles/virtual/tasks/looking-glass-arch.yml | 6 ++++++ ...ng-glass.yml => looking-glass-compile.yml} | 0 roles/virtual/tasks/main.yml | 6 +++++- 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 roles/virtual/tasks/looking-glass-arch.yml rename roles/virtual/tasks/{looking-glass.yml => looking-glass-compile.yml} (100%) diff --git a/roles/virtual/tasks/libvirt.yml b/roles/virtual/tasks/libvirt.yml index 6e01cc6..c24fd2d 100644 --- a/roles/virtual/tasks/libvirt.yml +++ b/roles/virtual/tasks/libvirt.yml @@ -1,5 +1,6 @@ --- -- name: install libvirt packages +- name: install libvirt packages [Ubuntu] + when: ansible_distribution == "Ubuntu" become: yes apt: update_cache: yes @@ -11,9 +12,26 @@ - libvirt-clients - bridge-utils +- name: install libvirt packages [Arch] + become: yes + community.general.pacman: + name: + - kvm + - qemu-full + - libvirt + - virt-manager + - virt-viewer + - name: ensure that your user is added to the group libvirtd become: yes user: name: "{{ ansible_user_id }}" append: yes groups: libvirt, kvm + +- name: enable default network + become: yes + shell: + cmd: + virsh net-autostart default + virsh net-start default diff --git a/roles/virtual/tasks/looking-glass-arch.yml b/roles/virtual/tasks/looking-glass-arch.yml new file mode 100644 index 0000000..96c551e --- /dev/null +++ b/roles/virtual/tasks/looking-glass-arch.yml @@ -0,0 +1,6 @@ +--- +- name: install IntelliJ [AUR] + shell: + cmd: + yay -S --needed --noconfirm \ + intellij-idea-ultimate-edition \ No newline at end of file diff --git a/roles/virtual/tasks/looking-glass.yml b/roles/virtual/tasks/looking-glass-compile.yml similarity index 100% rename from roles/virtual/tasks/looking-glass.yml rename to roles/virtual/tasks/looking-glass-compile.yml diff --git a/roles/virtual/tasks/main.yml b/roles/virtual/tasks/main.yml index be013b4..75e0a0f 100644 --- a/roles/virtual/tasks/main.yml +++ b/roles/virtual/tasks/main.yml @@ -1,4 +1,8 @@ --- - import_tasks: libvirt.yml -- import_tasks: looking-glass.yml +- import_tasks: looking-glass-compile.yml + when: ansible_distribution == "Ubuntu" + +- import_tasks: looking-glass-arch.yml + when: ansible_distribution == "Archlinux"