fixing variable usage and deploying to headless machine
This commit is contained in:
parent
ce4d2b94a2
commit
dacef969e9
5
Makefile
5
Makefile
|
@ -3,13 +3,14 @@ L := "$(shell hostname -s)"
|
||||||
C := -c local
|
C := -c local
|
||||||
K := -K
|
K := -K
|
||||||
P := site.yml
|
P := site.yml
|
||||||
|
V := -vvv
|
||||||
|
|
||||||
all: deploy
|
all: deploy
|
||||||
|
|
||||||
check:
|
check:
|
||||||
ansible-playbook -i $I -l $L $C $K --syntax-check $P
|
ansible-playbook -i $I -l $L $C $K --syntax-check $V $P
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
ansible-playbook -i $I -l $L $C $K $P
|
ansible-playbook -i $I -l $L $C $K $V $P
|
||||||
|
|
||||||
.PHONY: all check deploy
|
.PHONY: all check deploy
|
||||||
|
|
|
@ -2,4 +2,8 @@
|
||||||
petrichor
|
petrichor
|
||||||
|
|
||||||
[worklaptop]
|
[worklaptop]
|
||||||
kisom-x1
|
kisom-x1
|
||||||
|
|
||||||
|
[build]
|
||||||
|
orion
|
||||||
|
|
||||||
|
|
|
@ -25,3 +25,12 @@
|
||||||
- tree
|
- tree
|
||||||
- unzip
|
- unzip
|
||||||
- zsh
|
- zsh
|
||||||
|
|
||||||
|
- name: set up tools specifically for headless systems
|
||||||
|
when: headless
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- emacs-nox
|
||||||
|
- vim-nox
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
go_version: 1.20.3
|
go_version: 1.20.3
|
||||||
bazelisk_version: 1.16.0
|
bazelisk_version: 1.16.0
|
||||||
|
dev_embedded: False
|
||||||
|
dev_full: False
|
||||||
|
dev_rust: False
|
||||||
|
dev_virt: False
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
- cloc
|
- cloc
|
||||||
- cmake
|
- cmake
|
||||||
- devscripts
|
- devscripts
|
||||||
- erlang
|
|
||||||
- gcc
|
- gcc
|
||||||
- golang-google-genproto-dev
|
- golang-google-genproto-dev
|
||||||
- golang-goprotobuf-dev
|
- golang-goprotobuf-dev
|
||||||
|
@ -28,6 +27,20 @@
|
||||||
- zlib1g
|
- zlib1g
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
|
|
||||||
|
- name: install dev tools with guis
|
||||||
|
when: not headless
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- erlang
|
||||||
|
|
||||||
|
- name: install headless dev tools
|
||||||
|
when: headless
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- erlang-nox
|
||||||
|
|
||||||
## golang
|
## golang
|
||||||
- name: install godeb
|
- name: install godeb
|
||||||
become: true
|
become: true
|
||||||
|
@ -108,15 +121,21 @@
|
||||||
- qemu-system-arm
|
- qemu-system-arm
|
||||||
- qemu-system
|
- qemu-system
|
||||||
- qemu-system-x86
|
- qemu-system-x86
|
||||||
- qemu-system-gui
|
|
||||||
- qemu-user-static
|
- qemu-user-static
|
||||||
- sbuild-qemu
|
- sbuild-qemu
|
||||||
- seabios
|
- seabios
|
||||||
- u-boot-qemu
|
- u-boot-qemu
|
||||||
- virt-manager
|
|
||||||
- virt-top
|
- virt-top
|
||||||
notify: "restart docker service"
|
notify: "restart docker service"
|
||||||
|
|
||||||
|
- name: install container and virtualisation GUIs
|
||||||
|
when: (dev_virt or dev_full) and not headless
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
|
- qemu-system-gui
|
||||||
|
- virt-manager
|
||||||
|
|
||||||
- name: Ensure kvm group exists
|
- name: Ensure kvm group exists
|
||||||
when: dev_virt or dev_full
|
when: dev_virt or dev_full
|
||||||
become: true
|
become: true
|
||||||
|
@ -158,10 +177,15 @@
|
||||||
- gcc-avr
|
- gcc-avr
|
||||||
- libstdc++-arm-none-eabi-newlib
|
- libstdc++-arm-none-eabi-newlib
|
||||||
- picocom
|
- picocom
|
||||||
|
|
||||||
|
- name: install embedded dev guis
|
||||||
|
when: (dev_virt or dev_full) and not headless
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt: name={{ item }} state=present
|
||||||
|
with_items:
|
||||||
- pulseview
|
- pulseview
|
||||||
- sigrok
|
- sigrok
|
||||||
|
|
||||||
|
|
||||||
## documentation stuff
|
## documentation stuff
|
||||||
- name: install documentation tooling
|
- name: install documentation tooling
|
||||||
become: true
|
become: true
|
||||||
|
@ -176,7 +200,7 @@
|
||||||
|
|
||||||
## vscode
|
## vscode
|
||||||
- name: add VS Code repo key
|
- name: add VS Code repo key
|
||||||
when: dev_full
|
when: dev_full and not headless
|
||||||
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
|
||||||
|
@ -184,7 +208,7 @@
|
||||||
validate_certs: yes
|
validate_certs: yes
|
||||||
|
|
||||||
- name: add VS Code repo
|
- name: add VS Code repo
|
||||||
when: dev_full
|
when: dev_full and not headless
|
||||||
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
|
||||||
|
@ -192,20 +216,20 @@
|
||||||
validate_certs: yes
|
validate_certs: yes
|
||||||
|
|
||||||
- name: install VS Code
|
- name: install VS Code
|
||||||
when: dev_full
|
when: dev_full and not headless
|
||||||
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
|
when: dev_rust or 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: dev_full and cargo_exists is failed
|
when: (dev_rust or 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
|
||||||
|
@ -213,7 +237,7 @@
|
||||||
force: 'yes'
|
force: 'yes'
|
||||||
|
|
||||||
- name: install rust/cargo
|
- name: install rust/cargo
|
||||||
when: dev_full and cargo_exists is failed
|
when: (dev_rust or dev_full) and (cargo_exists is failed)
|
||||||
shell: /tmp/sh.rustup.rs -y
|
shell: /tmp/sh.rustup.rs -y
|
||||||
|
|
||||||
|
|
||||||
|
|
20
site.yml
20
site.yml
|
@ -9,7 +9,8 @@
|
||||||
- heavy
|
- heavy
|
||||||
vars:
|
vars:
|
||||||
laptop_user: kyle
|
laptop_user: kyle
|
||||||
dev_full: true
|
headless: False
|
||||||
|
dev_full: True
|
||||||
|
|
||||||
- hosts: worklaptop
|
- hosts: worklaptop
|
||||||
roles:
|
roles:
|
||||||
|
@ -21,4 +22,19 @@
|
||||||
- heavy
|
- heavy
|
||||||
vars:
|
vars:
|
||||||
laptop_user: k.isom
|
laptop_user: k.isom
|
||||||
dev_virt: true
|
headless: False
|
||||||
|
dev_virt: True
|
||||||
|
|
||||||
|
- hosts: build
|
||||||
|
roles:
|
||||||
|
- base
|
||||||
|
- dotfiles
|
||||||
|
- development
|
||||||
|
- server
|
||||||
|
- tailscale
|
||||||
|
vars:
|
||||||
|
laptop_user: kyle
|
||||||
|
headless: True
|
||||||
|
dev_virt: True
|
||||||
|
dev_embedded: True
|
||||||
|
dev_rust: True
|
||||||
|
|
Loading…
Reference in New Issue