2023-04-11 02:55:24 +00:00
|
|
|
- name: install dev tools
|
|
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
|
|
become: true
|
|
|
|
with_items:
|
|
|
|
- autoconf
|
|
|
|
- automake
|
|
|
|
- build-essential
|
|
|
|
- clang
|
|
|
|
- cloc
|
|
|
|
- cmake
|
|
|
|
- devscripts
|
|
|
|
- gcc
|
|
|
|
- golang-google-genproto-dev
|
|
|
|
- golang-goprotobuf-dev
|
|
|
|
- golang-protobuf-extensions-dev
|
|
|
|
- git
|
|
|
|
- ipython3
|
|
|
|
- libprotobuf-dev
|
|
|
|
- lua5.3
|
|
|
|
- luarocks
|
|
|
|
- make
|
|
|
|
- protobuf-compiler
|
|
|
|
- python3-pip
|
|
|
|
- sbcl
|
|
|
|
- texinfo
|
|
|
|
- tig
|
|
|
|
- zlib1g
|
|
|
|
- zlib1g-dev
|
|
|
|
|
2023-04-11 20:19:58 +00:00
|
|
|
- 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
|
|
|
|
|
2023-04-11 02:55:24 +00:00
|
|
|
## golang
|
|
|
|
- name: install godeb
|
|
|
|
become: true
|
|
|
|
ansible.builtin.unarchive:
|
|
|
|
src: "{{ role_path }}/files/godeb-amd64.tar.gz"
|
|
|
|
dest: /usr/local/bin
|
|
|
|
creates: /usr/local/bin/godeb
|
|
|
|
|
|
|
|
- name: install go
|
|
|
|
become: true
|
|
|
|
ansible.builtin.command: godeb install "{{ go_version }}"
|
|
|
|
args:
|
|
|
|
chdir: /tmp
|
|
|
|
creates: /usr/local/go/bin/go
|
|
|
|
|
|
|
|
## bazel
|
|
|
|
- name: "install bazelisk v{{ bazelisk_version }}"
|
|
|
|
ansible.builtin.get_url:
|
|
|
|
checksum: sha256:168851e70cf5f95c0e215e7f3aaca5132ffc3c8dd8f585a4157b0be2b53cfe32
|
|
|
|
dest: "/home/{{ laptop_user }}/.local/bin/bazelisk"
|
|
|
|
mode: 0755
|
|
|
|
url: "https://github.com/bazelbuild/bazelisk/releases/download/v{{ bazelisk_version }}/bazelisk-linux-amd64"
|
|
|
|
|
|
|
|
# the process of getting buildifier in an automated way is onerous, ergo
|
|
|
|
# this hack.
|
|
|
|
- name: install buildifier
|
|
|
|
ansible.builtin.unarchive:
|
|
|
|
src: "{{ role_path }}/files/buildifier.tgz"
|
|
|
|
dest: "/home/{{ laptop_user }}/.local/bin"
|
|
|
|
creates: "/home/{{ laptop_user }}/.local/bin/buildifier"
|
|
|
|
|
|
|
|
## virtualization and containerization
|
|
|
|
- name: ensure repository key is installed
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_key:
|
|
|
|
url: https://download.docker.com/linux/ubuntu/gpg
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: ensure docker registry is available
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_repository: repo='deb https://download.docker.com/linux/ubuntu bionic stable' state=present
|
|
|
|
|
|
|
|
- name: rootfs building tools
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
|
|
become: true
|
|
|
|
with_items:
|
|
|
|
- dracut
|
|
|
|
- fusecram
|
|
|
|
- genext2fs
|
|
|
|
- genisoimage
|
|
|
|
- genromfs
|
|
|
|
- makebootfat
|
|
|
|
- mmdebstrap
|
|
|
|
- proot
|
|
|
|
- pxelinux
|
|
|
|
- syslinux
|
|
|
|
- syslinux-efi
|
|
|
|
- syslinux-utils
|
|
|
|
|
|
|
|
- name: install container and virtualisation management
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
|
|
with_items:
|
|
|
|
- conman
|
|
|
|
- crun
|
|
|
|
- docker-ce
|
|
|
|
- docker-compose
|
|
|
|
- ipxe-qemu
|
|
|
|
- kvmtool
|
|
|
|
- podman
|
|
|
|
- qemubuilder
|
|
|
|
- qemu-efi-aarch64
|
|
|
|
- qemu-efi-arm
|
|
|
|
- qemu-system-arm
|
|
|
|
- qemu-system
|
|
|
|
- qemu-system-x86
|
|
|
|
- qemu-user-static
|
|
|
|
- sbuild-qemu
|
|
|
|
- seabios
|
|
|
|
- u-boot-qemu
|
|
|
|
- virt-top
|
|
|
|
notify: "restart docker service"
|
|
|
|
|
2023-04-11 20:19:58 +00:00
|
|
|
- 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
|
|
|
|
|
2023-04-11 02:55:24 +00:00
|
|
|
- name: Ensure kvm group exists
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.group:
|
|
|
|
name: kvm
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Ensure docker group exists
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.group:
|
|
|
|
name: docker
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: add laptop user {{ laptop_user }} to docker group
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_virt or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: "{{ laptop_user }}"
|
|
|
|
append: true
|
|
|
|
groups:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
## embedded dev stuff
|
|
|
|
- name: installed embedded dev tools
|
2023-04-11 14:24:59 +00:00
|
|
|
when: dev_embedded or dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
|
|
become: true
|
|
|
|
with_items:
|
|
|
|
- avr-libc
|
|
|
|
- avrdude
|
|
|
|
- binutils-arm-none-eabi
|
|
|
|
- binutils-arm-linux-gnueabi
|
|
|
|
- binutils-arm-linux-gnueabihf
|
|
|
|
- binutils-avr
|
|
|
|
- gcc-arm-none-eabi
|
|
|
|
- gcc-arm-linux-gnueabi
|
|
|
|
- gcc-arm-linux-gnueabihf
|
|
|
|
- gcc-avr
|
|
|
|
- libstdc++-arm-none-eabi-newlib
|
|
|
|
- picocom
|
2023-04-11 20:19:58 +00:00
|
|
|
|
|
|
|
- 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:
|
2023-04-11 02:55:24 +00:00
|
|
|
- pulseview
|
|
|
|
- sigrok
|
|
|
|
|
|
|
|
## documentation stuff
|
|
|
|
- name: install documentation tooling
|
|
|
|
become: true
|
|
|
|
ansible.builtin.apt: name={{ item }} state=present
|
|
|
|
with_items:
|
|
|
|
- asciidoc
|
|
|
|
- doxygen
|
|
|
|
- pelican
|
|
|
|
- pelican-doc
|
|
|
|
- python3-sphinx
|
|
|
|
- scdoc
|
|
|
|
|
|
|
|
## vscode
|
|
|
|
- name: add VS Code repo key
|
2023-04-11 20:19:58 +00:00
|
|
|
when: dev_full and not headless
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_key:
|
|
|
|
url: https://packages.microsoft.com/keys/microsoft.asc
|
|
|
|
state: present
|
|
|
|
validate_certs: yes
|
|
|
|
|
|
|
|
- name: add VS Code repo
|
2023-04-11 20:19:58 +00:00
|
|
|
when: dev_full and not headless
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt_repository:
|
|
|
|
repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
|
|
|
|
state: present
|
|
|
|
validate_certs: yes
|
|
|
|
|
|
|
|
- name: install VS Code
|
2023-04-11 20:19:58 +00:00
|
|
|
when: dev_full and not headless
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt: name=code state=present
|
|
|
|
|
2023-04-11 05:48:13 +00:00
|
|
|
## rust
|
|
|
|
|
|
|
|
- name: check if cargo is installed
|
2023-04-11 20:19:58 +00:00
|
|
|
when: dev_rust or dev_full
|
2023-04-11 05:48:13 +00:00
|
|
|
shell: command -v cargo
|
|
|
|
register: cargo_exists
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Download Installer
|
2023-04-11 20:19:58 +00:00
|
|
|
when: (dev_rust or dev_full) and (cargo_exists is failed)
|
2023-04-11 05:48:13 +00:00
|
|
|
get_url:
|
|
|
|
url: https://sh.rustup.rs
|
|
|
|
dest: /tmp/sh.rustup.rs
|
|
|
|
mode: '0755'
|
|
|
|
force: 'yes'
|
|
|
|
|
|
|
|
- name: install rust/cargo
|
2023-04-11 20:19:58 +00:00
|
|
|
when: (dev_rust or dev_full) and (cargo_exists is failed)
|
2023-04-11 20:33:05 +00:00
|
|
|
shell: /tmp/sh.rustup.rs -y --no-modify-path
|
2023-04-11 05:48:13 +00:00
|
|
|
|
|
|
|
|
2023-04-11 02:55:24 +00:00
|
|
|
## AI/ML stuff
|
|
|
|
|
|
|
|
- name: install machine learning and AI tools
|
2023-04-11 05:55:59 +00:00
|
|
|
when: dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
become: true
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "{{item}}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- jupyter-notebook
|
|
|
|
|
|
|
|
- name: install machine learning and AI python packages
|
2023-04-11 05:55:59 +00:00
|
|
|
when: dev_full
|
2023-04-11 02:55:24 +00:00
|
|
|
ansible.builtin.pip:
|
|
|
|
executable: pip3
|
|
|
|
name: "{{item}}"
|
|
|
|
extra_args: --user
|
|
|
|
with_items:
|
|
|
|
- Keras
|
|
|
|
- numpy
|
|
|
|
- scikit-learn
|
|
|
|
- scipy
|
|
|
|
- tensorflow
|
|
|
|
- torch
|