From 25cdd54e269d3560578dbc2f8bcf327f98bcd210 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Mon, 10 Apr 2023 22:55:59 -0700 Subject: [PATCH] Cleaning up and documenting. --- README.org | 24 ++++++++++++++++++++++++ roles/development/tasks/main.yml | 18 ++++++++++++++++-- site.yml | 4 ++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 2ee2118..13dcb54 100644 --- a/README.org +++ b/README.org @@ -39,3 +39,27 @@ desktop installs the heavier and GUI things that I'd want on a desktop (or realistically, a laptop). + +*** development + + This installs a baseline of development tools; it also has + variables to control what else gets installed: + + + dev_full installs everything + + dev_virt installs virtualisation stuff, including docker + + dev_embedded installs various embedded toolchains. + +*** dotfiles + + Ye olde dotfiles, managed in Ansible. Was this a mistake? Nothing + I do is a mistake. + +*** heavy + + This is where stuff that takes a while to install goes. It's all + desktop stuff, so it really only makes sense with the ~desktop~ + role. + +*** tailscale + + Almost everything is going to get this; it installs tailscale. diff --git a/roles/development/tasks/main.yml b/roles/development/tasks/main.yml index 1dc5c92..1dcd564 100644 --- a/roles/development/tasks/main.yml +++ b/roles/development/tasks/main.yml @@ -61,16 +61,19 @@ ## virtualization and containerization - name: ensure repository key is installed + when: dev_virt | dev_full become: true ansible.builtin.apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: ensure docker registry is available + when: dev_virt | dev_full become: true ansible.builtin.apt_repository: repo='deb https://download.docker.com/linux/ubuntu bionic stable' state=present - name: rootfs building tools + when: dev_virt | dev_full ansible.builtin.apt: name={{ item }} state=present become: true with_items: @@ -88,6 +91,7 @@ - syslinux-utils - name: install container and virtualisation management + when: dev_virt | dev_full become: true ansible.builtin.apt: name={{ item }} state=present with_items: @@ -114,18 +118,21 @@ notify: "restart docker service" - name: Ensure kvm group exists + when: dev_virt | dev_full become: true ansible.builtin.group: name: kvm state: present - name: Ensure docker group exists + when: dev_virt | dev_full become: true ansible.builtin.group: name: docker state: present - name: add laptop user {{ laptop_user }} to docker group + when: dev_virt | dev_full become: true ansible.builtin.user: name: "{{ laptop_user }}" @@ -135,6 +142,7 @@ ## embedded dev stuff - name: installed embedded dev tools + when: dev_embedded | dev_full ansible.builtin.apt: name={{ item }} state=present become: true with_items: @@ -168,6 +176,7 @@ ## vscode - name: add VS Code repo key + when: dev_full become: true ansible.builtin.apt_key: url: https://packages.microsoft.com/keys/microsoft.asc @@ -175,6 +184,7 @@ validate_certs: yes - name: add VS Code repo + when: dev_full become: true ansible.builtin.apt_repository: repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main @@ -182,18 +192,20 @@ validate_certs: yes - name: install VS Code + when: dev_full become: true ansible.builtin.apt: name=code state=present ## rust - name: check if cargo is installed + when: dev_full shell: command -v cargo register: cargo_exists ignore_errors: yes - name: Download Installer - when: cargo_exists is failed + when: dev_full and cargo_exists is failed get_url: url: https://sh.rustup.rs dest: /tmp/sh.rustup.rs @@ -201,13 +213,14 @@ force: 'yes' - name: install rust/cargo - when: cargo_exists is failed + when: dev_full and cargo_exists is failed shell: /tmp/sh.rustup.rs -y ## AI/ML stuff - name: install machine learning and AI tools + when: dev_full become: true ansible.builtin.apt: name: "{{item}}" @@ -216,6 +229,7 @@ - jupyter-notebook - name: install machine learning and AI python packages + when: dev_full ansible.builtin.pip: executable: pip3 name: "{{item}}" diff --git a/site.yml b/site.yml index d312d78..08f6077 100644 --- a/site.yml +++ b/site.yml @@ -2,18 +2,22 @@ roles: - base - dotfiles + - desktop - development - tailscale - heavy vars: laptop_user: kyle + dev_full: true - hosts: work-laptop roles: - base - dotfiles + - desktop - development - tailscale - heavy vars: laptop_user: k.isom + dev_virt: true