From 4d620a33b7b8ef6385c0f4df0438f115b2b7888b Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 18 Jan 2024 22:12:08 -0500 Subject: [PATCH] Add closed source vscode. --- .../environments/laptop/host_vars/odolinux | 1 - ansible/environments/laptop/host_vars/odowork | 2 +- ansible/roles/build/tasks/linux.yaml | 8 ++++++ ansible/roles/kubernetes/tasks/linux.yaml | 2 -- .../package_manager/files/freeze_kernel.conf | 2 ++ .../roles/package_manager/tasks/linux.yaml | 1 + ansible/roles/vscode/defaults/main.yaml | 1 + ansible/roles/vscode/tasks/linux.yaml | 25 +++++++++++++++++++ 8 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 ansible/roles/package_manager/files/freeze_kernel.conf create mode 100644 ansible/roles/vscode/defaults/main.yaml diff --git a/ansible/environments/laptop/host_vars/odolinux b/ansible/environments/laptop/host_vars/odolinux index 26037af..495f1dd 100644 --- a/ansible/environments/laptop/host_vars/odolinux +++ b/ansible/environments/laptop/host_vars/odolinux @@ -36,4 +36,3 @@ cores: 16 sway_conf_files: - rofimoji docker_storage_driver: overlay2 # alternatively zfs -docker_zfs_dataset: zroot/linux/archmain/docker diff --git a/ansible/environments/laptop/host_vars/odowork b/ansible/environments/laptop/host_vars/odowork index 0332bcf..f6dbeb4 100644 --- a/ansible/environments/laptop/host_vars/odowork +++ b/ansible/environments/laptop/host_vars/odowork @@ -33,4 +33,4 @@ cores: 16 sway_conf_files: - rofimoji docker_storage_driver: overlay2 # alternatively zfs -docker_zfs_dataset: zroot/linux/archwork/docker +closed_source_vscode: true diff --git a/ansible/roles/build/tasks/linux.yaml b/ansible/roles/build/tasks/linux.yaml index fd605aa..d44f0f3 100644 --- a/ansible/roles/build/tasks/linux.yaml +++ b/ansible/roles/build/tasks/linux.yaml @@ -94,6 +94,14 @@ - src: makepkg.conf # TODO: Is this needed or can I use the default from devtools? dest: /etc/aurutils/ +- name: chown the custom package db + file: + path: "{{ item }}" + owner: "{{ build_user.name }}" + recurse: true + loop: + - /var/cache/pacman/custom/ + - name: Create custom repo db command: repo-add --sign /var/cache/pacman/custom/custom.db.tar become: true diff --git a/ansible/roles/kubernetes/tasks/linux.yaml b/ansible/roles/kubernetes/tasks/linux.yaml index 92a6400..9ca113d 100644 --- a/ansible/roles/kubernetes/tasks/linux.yaml +++ b/ansible/roles/kubernetes/tasks/linux.yaml @@ -7,7 +7,6 @@ loop: - kubeswitch - flux-scm - - kubectl-minio - name: Update cache when: buildaur.changed @@ -23,5 +22,4 @@ - stern - kubeswitch - flux-scm - - kubectl-minio state: present diff --git a/ansible/roles/package_manager/files/freeze_kernel.conf b/ansible/roles/package_manager/files/freeze_kernel.conf new file mode 100644 index 0000000..e03e3c3 --- /dev/null +++ b/ansible/roles/package_manager/files/freeze_kernel.conf @@ -0,0 +1,2 @@ +[options] +IgnorePkg = linux linux-headers diff --git a/ansible/roles/package_manager/tasks/linux.yaml b/ansible/roles/package_manager/tasks/linux.yaml index 396da53..19ee9dd 100644 --- a/ansible/roles/package_manager/tasks/linux.yaml +++ b/ansible/roles/package_manager/tasks/linux.yaml @@ -52,6 +52,7 @@ group: root loop: - freeze_firefox.conf + - freeze_kernel.conf - name: Install packages package: diff --git a/ansible/roles/vscode/defaults/main.yaml b/ansible/roles/vscode/defaults/main.yaml new file mode 100644 index 0000000..836a46c --- /dev/null +++ b/ansible/roles/vscode/defaults/main.yaml @@ -0,0 +1 @@ +closed_source_vscode: false diff --git a/ansible/roles/vscode/tasks/linux.yaml b/ansible/roles/vscode/tasks/linux.yaml index 929cf56..672a571 100644 --- a/ansible/roles/vscode/tasks/linux.yaml +++ b/ansible/roles/vscode/tasks/linux.yaml @@ -1,4 +1,29 @@ +- name: Build aur packages + when: closed_source_vscode + register: buildaur + become_user: "{{ build_user.name }}" + command: "aurutils-sync --no-view {{ item }}" + args: + creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*" + loop: + - visual-studio-code-bin + +- name: Update cache + when: closed_source_vscode and buildaur.changed + pacman: + name: [] + state: present + update_cache: true + - name: Install packages + when: closed_source_vscode + package: + name: + - visual-studio-code-bin + state: present + +- name: Install packages + when: not closed_source_vscode package: name: - code