Cleaning up and documenting.

This commit is contained in:
Kyle Isom 2023-04-10 22:55:59 -07:00
parent 5668cd163d
commit 25cdd54e26
3 changed files with 44 additions and 2 deletions

View File

@ -39,3 +39,27 @@
desktop installs the heavier and GUI things that I'd want on a desktop installs the heavier and GUI things that I'd want on a
desktop (or realistically, a laptop). 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.

View File

@ -61,16 +61,19 @@
## virtualization and containerization ## virtualization and containerization
- name: ensure repository key is installed - name: ensure repository key is installed
when: dev_virt | dev_full
become: true become: true
ansible.builtin.apt_key: ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg url: https://download.docker.com/linux/ubuntu/gpg
state: present state: present
- name: ensure docker registry is available - name: ensure docker registry is available
when: dev_virt | dev_full
become: true become: true
ansible.builtin.apt_repository: repo='deb https://download.docker.com/linux/ubuntu bionic stable' state=present ansible.builtin.apt_repository: repo='deb https://download.docker.com/linux/ubuntu bionic stable' state=present
- name: rootfs building tools - name: rootfs building tools
when: dev_virt | dev_full
ansible.builtin.apt: name={{ item }} state=present ansible.builtin.apt: name={{ item }} state=present
become: true become: true
with_items: with_items:
@ -88,6 +91,7 @@
- syslinux-utils - syslinux-utils
- name: install container and virtualisation management - name: install container and virtualisation management
when: dev_virt | dev_full
become: true become: true
ansible.builtin.apt: name={{ item }} state=present ansible.builtin.apt: name={{ item }} state=present
with_items: with_items:
@ -114,18 +118,21 @@
notify: "restart docker service" notify: "restart docker service"
- name: Ensure kvm group exists - name: Ensure kvm group exists
when: dev_virt | dev_full
become: true become: true
ansible.builtin.group: ansible.builtin.group:
name: kvm name: kvm
state: present state: present
- name: Ensure docker group exists - name: Ensure docker group exists
when: dev_virt | dev_full
become: true become: true
ansible.builtin.group: ansible.builtin.group:
name: docker name: docker
state: present state: present
- name: add laptop user {{ laptop_user }} to docker group - name: add laptop user {{ laptop_user }} to docker group
when: dev_virt | dev_full
become: true become: true
ansible.builtin.user: ansible.builtin.user:
name: "{{ laptop_user }}" name: "{{ laptop_user }}"
@ -135,6 +142,7 @@
## embedded dev stuff ## embedded dev stuff
- name: installed embedded dev tools - name: installed embedded dev tools
when: dev_embedded | dev_full
ansible.builtin.apt: name={{ item }} state=present ansible.builtin.apt: name={{ item }} state=present
become: true become: true
with_items: with_items:
@ -168,6 +176,7 @@
## vscode ## vscode
- name: add VS Code repo key - name: add VS Code repo key
when: dev_full
become: true become: true
ansible.builtin.apt_key: ansible.builtin.apt_key:
url: https://packages.microsoft.com/keys/microsoft.asc url: https://packages.microsoft.com/keys/microsoft.asc
@ -175,6 +184,7 @@
validate_certs: yes validate_certs: yes
- name: add VS Code repo - name: add VS Code repo
when: dev_full
become: true become: true
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
@ -182,18 +192,20 @@
validate_certs: yes validate_certs: yes
- name: install VS Code - name: install VS Code
when: dev_full
become: true become: true
ansible.builtin.apt: name=code state=present ansible.builtin.apt: name=code state=present
## rust ## rust
- name: check if cargo is installed - name: check if cargo is installed
when: dev_full
shell: command -v cargo shell: command -v cargo
register: cargo_exists register: cargo_exists
ignore_errors: yes ignore_errors: yes
- name: Download Installer - name: Download Installer
when: cargo_exists is failed when: dev_full and cargo_exists is failed
get_url: get_url:
url: https://sh.rustup.rs url: https://sh.rustup.rs
dest: /tmp/sh.rustup.rs dest: /tmp/sh.rustup.rs
@ -201,13 +213,14 @@
force: 'yes' force: 'yes'
- name: install rust/cargo - name: install rust/cargo
when: cargo_exists is failed when: dev_full and cargo_exists is failed
shell: /tmp/sh.rustup.rs -y shell: /tmp/sh.rustup.rs -y
## AI/ML stuff ## AI/ML stuff
- name: install machine learning and AI tools - name: install machine learning and AI tools
when: dev_full
become: true become: true
ansible.builtin.apt: ansible.builtin.apt:
name: "{{item}}" name: "{{item}}"
@ -216,6 +229,7 @@
- jupyter-notebook - jupyter-notebook
- name: install machine learning and AI python packages - name: install machine learning and AI python packages
when: dev_full
ansible.builtin.pip: ansible.builtin.pip:
executable: pip3 executable: pip3
name: "{{item}}" name: "{{item}}"

View File

@ -2,18 +2,22 @@
roles: roles:
- base - base
- dotfiles - dotfiles
- desktop
- development - development
- tailscale - tailscale
- heavy - heavy
vars: vars:
laptop_user: kyle laptop_user: kyle
dev_full: true
- hosts: work-laptop - hosts: work-laptop
roles: roles:
- base - base
- dotfiles - dotfiles
- desktop
- development - development
- tailscale - tailscale
- heavy - heavy
vars: vars:
laptop_user: k.isom laptop_user: k.isom
dev_virt: true