ansible/roles/development/tasks/main.yml

355 lines
8.2 KiB
YAML
Raw Permalink Normal View History

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
2023-04-18 00:16:35 +00:00
- ghc
2023-04-13 04:49:58 +00:00
- git
2023-04-11 02:55:24 +00:00
- golang-google-genproto-dev
- golang-goprotobuf-dev
- golang-protobuf-extensions-dev
2023-04-12 08:27:03 +00:00
- graphviz
2023-04-11 02:55:24 +00:00
- ipython3
2023-04-12 06:13:11 +00:00
- jq
2023-04-11 02:55:24 +00:00
- libprotobuf-dev
- lua5.3
- luarocks
- make
2023-04-14 18:08:16 +00:00
- mercurial
2023-04-13 04:49:58 +00:00
- pgcli
2023-04-11 02:55:24 +00:00
- protobuf-compiler
- python3-pip
2023-04-12 06:13:11 +00:00
- python3-progressbar
- python3-pycryptodome
2023-04-11 02:55:24 +00:00
- sbcl
2023-05-12 02:21:55 +00:00
- sqlite3
2023-04-11 02:55:24 +00:00
- texinfo
- tig
2023-05-01 16:39:45 +00:00
- tshark
2023-04-14 18:08:16 +00:00
- yamllint
2023-04-11 02:55:24 +00:00
- zlib1g
- zlib1g-dev
2023-04-12 06:13:11 +00:00
# prefer python3-$package instead of using pip.
- name: install various python utils
ansible.builtin.pip:
executable: pip3
name: "{{item}}"
extra_args: --user
with_items:
- yq
- 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"
2023-05-12 02:21:55 +00:00
- name: setup bazel symlink
become: true
ansible.builtin.file:
src: "/home/{{ laptop_user }}/.local/bin/bazelisk"
dest: /usr/local/bin/bazel
state: link
owner: root
group: root
mode: '0755'
2023-04-11 02:55:24 +00:00
## 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:
2023-04-11 20:50:16 +00:00
- dosfstools
2023-04-11 02:55:24 +00:00
- dracut
2023-04-11 20:50:16 +00:00
- e2fsprogs
2023-04-11 02:55:24 +00:00
- fusecram
- genext2fs
- genisoimage
- genromfs
- makebootfat
- mmdebstrap
- proot
- pxelinux
- syslinux
- syslinux-efi
- syslinux-utils
- vboot-utils
2023-04-14 18:08:16 +00:00
- whois
2023-04-11 02:55:24 +00:00
- 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"
- 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
2023-04-12 06:13:11 +00:00
- dfu-util
2023-04-11 02:55:24 +00:00
- gcc-arm-none-eabi
- gcc-arm-linux-gnueabi
- gcc-arm-linux-gnueabihf
- gcc-avr
- libstdc++-arm-none-eabi-newlib
2023-04-12 06:13:11 +00:00
- libusb-0.1-4
- libusb-1.0-0
- libusb-1.0-0-dev
- libusb-1.0-doc
- libusb-dev
2023-04-11 02:55:24 +00:00
- picocom
2023-04-12 06:13:11 +00:00
- python3-usb
- 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
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
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
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-13 02:24:13 +00:00
2023-04-11 05:48:13 +00:00
## rust
- name: check if cargo is installed
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
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
when: (dev_rust or dev_full) and (cargo_exists is failed)
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
2023-04-13 02:24:13 +00:00
- name: install balena etcher repo key
become: true
when: (dev_full or dev_embedded) and not headless
ansible.builtin.apt_key:
url: https://dl.cloudsmith.io/public/balena/etcher/gpg.70528471AFF9A051.key
state: present
- name: setup balena etcher repo
become: true
when: (dev_full or dev_embedded) and not headless
ansible.builtin.apt_repository:
repo: 'deb https://dl.cloudsmith.io/public/balena/etcher/deb/ubuntu jammy main'
state: present
- name: setup balena etcher source repo
become: true
when: (dev_full or dev_embedded) and not headless
ansible.builtin.apt_repository:
repo: 'deb-src https://dl.cloudsmith.io/public/balena/etcher/deb/ubuntu jammy main'
state: present
- name: install balena etcher
become: true
when: (dev_full or dev_embedded) and not headless
ansible.builtin.apt: name=balena-etcher-electron state=present
- name: link etcher to /usr/bin
become: true
when: (dev_full or dev_embedded) and not headless
ansible.builtin.file:
src: /opt/balenaEtcher/balena-etcher-electron
dest: /usr/local/bin/etcher
owner: root
group: root
mode: 0755
state: link
2023-05-12 02:21:55 +00:00
- name: install minio CLI tool
become: true
ansible.builtin.get_url:
checksum: sha256:cd26ea353811880704efe8eb1b3335461240c1d4f7e4f3efee1b4391697662e4
dest: /usr/local/bin/mc
mode: 0755
url: https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-05-04T18-10-16Z