-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook.yml
54 lines (46 loc) · 2.21 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
- name: Setup ubuntu container
hosts: localhost
connection: local
tasks:
- name: Install basic packages
ansible.builtin.apt:
name: [ "sudo", "nano", "vim", "usbutils", "curl", "software-properties-common", "unzip", "git", "net-tools", "iproute2" ]
state: present
- name: Add PPA for newer versions of python
ansible.builtin.apt_repository:
repo: ppa:deadsnakes/ppa
- name: Install lattice radiant dependencies
ansible.builtin.apt:
name: [ "at-spi2-core", "libpangocairo-1.0-0", "libcairo2-dev", "pulseaudio", "libc6", "libjpeg-dev", "libieee1284-3", "libusb-0.1-4", "lsb-base", "libnss3", "libice6", "libgl1-mesa-glx", "libsm6", "libxt6", "libxext6", "libxrender1", "libxi6", "libxft2", "libxslt1.1", "libxrandr2", "libxfixes3", "libxdamage1", "libxcursor1", "libxcomposite1", "libxinerama1", "libxss1", "libxcb-image0", "libxcb-keysyms1", "libxcb-render-util0", "libxcb-xkb1", "libxcb-xinput0", "libxcb-xinerama0", "libxkbcommon0", "libxkbcommon-x11-0", "libxcb-icccm4", "libx11-6", "libgl1-mesa-dri", "qt5-default" ]
state: present
update_cache: yes
- name: Set root password
ansible.builtin.user:
name: root
state: present
password: '$6$tFmshjom4$dAmQ.y1v3fbzhTvcpEVpzq/aqaG9VisgfqN6PC33lIGLZTiYhuj.M5PtQPAHwK5fRC9twBDAe6BjtAulcN/Vq.'
- name: Ensure "sudo" group exists
ansible.builtin.group:
name: sudo
state: present
- name: Add user
ansible.builtin.user:
name: "{{ username }}"
state: present
password: '$6$tFmshjom4$dAmQ.y1v3fbzhTvcpEVpzq/aqaG9VisgfqN6PC33lIGLZTiYhuj.M5PtQPAHwK5fRC9twBDAe6BjtAulcN/Vq.'
group: users
groups: [ "users", "sudo", "dialout" ]
create_home: yes
- name: Add radiant bin to path
ansible.builtin.lineinfile:
path: /home/{{ username }}/.bashrc
line: 'PATH="~/lscc/radiant/2022.1/bin/lin64/${PATH:+:${PATH}}"'
- name: Install software dependencies
ansible.builtin.apt:
name: [ "direnv", "build-essential", "clang", "curl", "python3.10", "python3.10-venv", "libserialport-dev" ]
state: present
- name: Add direnv shell hook
ansible.builtin.lineinfile:
path: /home/{{ username }}/.bashrc
line: 'eval "$(direnv hook bash)"'