From 2e467d5e3eb95eaac51506cea47b4b3f6c5564f6 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Thu, 31 Aug 2023 09:23:36 +0200 Subject: [PATCH] Improve dotfiles role --- ansible/playbooks/dotfiles.yml | 2 +- ansible/roles/dotfiles/defaults/main.yml | 2 +- ansible/roles/dotfiles/tasks/neovim.yml | 2 +- ansible/roles/dotfiles/tasks/nerdfonts.yml | 14 +++++--------- ansible/roles/dotfiles/tasks/system.yml | 7 +++---- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ansible/playbooks/dotfiles.yml b/ansible/playbooks/dotfiles.yml index 6b788ac..0418aef 100644 --- a/ansible/playbooks/dotfiles.yml +++ b/ansible/playbooks/dotfiles.yml @@ -7,6 +7,7 @@ components: - git - common + - ansible - nerdfonts - nodejs - vim @@ -19,7 +20,6 @@ - system - kubernetes - flatpak - - ansible - visualstudio roles: - dotfiles diff --git a/ansible/roles/dotfiles/defaults/main.yml b/ansible/roles/dotfiles/defaults/main.yml index 961d013..743532e 100644 --- a/ansible/roles/dotfiles/defaults/main.yml +++ b/ansible/roles/dotfiles/defaults/main.yml @@ -7,7 +7,7 @@ enable_kubernetes_tools: true enable_nested_virtualization: true # small or full nerd_fonts_pack: small -nerd_fonts_version: v3.0.1 +nerd_fonts_version: v3.0.2 nerd_fonts: - SourceCodePro - RobotoMono diff --git a/ansible/roles/dotfiles/tasks/neovim.yml b/ansible/roles/dotfiles/tasks/neovim.yml index 27eaac7..c94830b 100644 --- a/ansible/roles/dotfiles/tasks/neovim.yml +++ b/ansible/roles/dotfiles/tasks/neovim.yml @@ -15,7 +15,7 @@ state: directory recurse: true -- name: Copy extracted neovim and make symlink to local bin +- name: Copy extracted neovim copy: src: /tmp/squashfs-root/ dest: ~/.local/nvim diff --git a/ansible/roles/dotfiles/tasks/nerdfonts.yml b/ansible/roles/dotfiles/tasks/nerdfonts.yml index 8d5824b..a3fc39c 100644 --- a/ansible/roles/dotfiles/tasks/nerdfonts.yml +++ b/ansible/roles/dotfiles/tasks/nerdfonts.yml @@ -28,15 +28,11 @@ path: /tmp/fonts state: directory - - name: Download fonts - get_url: - url: "https://github.com/ryanoasis/nerd-fonts/releases/download/{{ nerd_fonts_version }}/{{ item }}.zip" - dest: /tmp/ - loop: "{{ nerd_fonts }}" - - - name: Unzip fonts - shell: | - unzip /tmp/{{ item }}.zip -d /tmp/fonts + - name: Download and unzip fonts + ansible.builtin.unarchive: + src: "https://github.com/ryanoasis/nerd-fonts/releases/download/{{ nerd_fonts_version }}/{{ item }}.zip" + dest: /tmp/fonts + remote_src: true loop: "{{ nerd_fonts }}" - name: Remove windows fonts diff --git a/ansible/roles/dotfiles/tasks/system.yml b/ansible/roles/dotfiles/tasks/system.yml index 06d4d54..738e030 100644 --- a/ansible/roles/dotfiles/tasks/system.yml +++ b/ansible/roles/dotfiles/tasks/system.yml @@ -59,10 +59,9 @@ - name: Clear resolv.conf file become: true - copy: - content: | - # CLEARED BY ANSIBLE - dest: /etc/resolv.conf + file: + path: /etc/resolv.conf + state: absent when: _disable_resolved.changed - name: Restart NetworkManager