feat: add pipx packages via file and add docker group

This commit is contained in:
Matthieu Bessat 2024-06-10 23:30:00 +02:00
parent 47c88e5e72
commit d9cfb729ec
8 changed files with 35 additions and 14 deletions

View file

@ -7,3 +7,6 @@
- add cargo global packages, like `pads` - add cargo global packages, like `pads`
- packages
- add kanshi, dynamic wayland output manager
- add smbutils

1
ansible/.gitignore vendored
View file

@ -1 +1,2 @@
arch_packages.json arch_packages.json
pip_packages.json

View file

@ -153,7 +153,7 @@ categories:
- scrcpy - scrcpy
- kdeconnect - kdeconnect
geo: [] geo: []
# - aur/osmium-tool #- aur/osmium-tool
random_gen: random_gen:
- python-faker - python-faker
- aur/uuid - aur/uuid
@ -166,6 +166,7 @@ categories:
- zbar - zbar
- zint - zint
- qrencode - qrencode
- newsboat
security: security:
- gopass - gopass
@ -209,6 +210,8 @@ categories:
- ruff - ruff
lua: lua:
- lua - lua
web:
- caddy
static: static:
- hugo - hugo

View file

@ -1,9 +1,11 @@
import json import json
import sys
import yaml import yaml
import fileinput
packages_tree = None packages_tree = None
with open("arch_packages.yaml", 'r') as config_f: yaml_config = ''.join(sys.stdin.readlines())
packages_tree = yaml.safe_load(config_f) packages_tree = yaml.safe_load(yaml_config)
assert packages_tree is not None, "Must have load valid package tree" assert packages_tree is not None, "Must have load valid package tree"

View file

@ -0,0 +1,8 @@
base:
- desc: JSON adapter
name: jc
- copyparty
- lesspass
- xkcd-pass
- azlyrics2
- yewtube

View file

@ -1 +0,0 @@
-

View file

@ -9,7 +9,11 @@ export ANSIBLE_CONFIG=$base/ansible.cfg
export ANSIBLE_LOG_PATH=ansible_run.log export ANSIBLE_LOG_PATH=ansible_run.log
cd $base cd $base
python3 parse_arch_packages.py > arch_packages.json cat arch_packages.yaml | python3 parse_arch_packages.py > arch_packages.json
cd $workdir
cd $base
cat pip_packages.yaml | python3 parse_arch_packages.py > pip_packages.json
cd $workdir cd $workdir
rm $base/vm_files rm $base/vm_files
@ -17,10 +21,10 @@ ln -s $workdir $base/vm_files
ansible-playbook $base/workstation.yaml \ ansible-playbook $base/workstation.yaml \
-v \ -v \
--ask-become-pass \
-u "mbess" \ -u "mbess" \
-i "inventory.yaml" \ -i "inventory.yaml" \
--ssh-extra-args "-o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 22 -i ./master_sshkey" \ --ssh-extra-args "-o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 22 -i ./master_sshkey" \
--extra-vars "@$workdir/vars.yaml" \ --extra-vars "@$workdir/vars.yaml" \
--extra-vars "ansible_sudo_pass=pidell43" --start-at-task "Install pip packages"
#--start-at-task "Create the aur_builder user"

View file

@ -148,6 +148,12 @@
name: "{{ user }}" name: "{{ user }}"
shell: /usr/bin/fish shell: /usr/bin/fish
- name: Add user to useful group (docker)
become: true
user:
name: "{{ user }}"
groups: ["docker"]
- name: Create machine.fish - name: Create machine.fish
template: template:
src: fish/machine.fish src: fish/machine.fish
@ -273,15 +279,10 @@
include_role: include_role:
name: popequer_notebook name: popequer_notebook
- name: Install others packages - name: Install pip packages
community.general.pipx: community.general.pipx:
name: "{{ item }}" name: "{{ item }}"
loop: loop: "{{ (lookup('file', 'pip_packages.json') | from_json)['native'] }}"
- azlyrics2
- lesspass
- jc
- xkcd-pass
- yewtube
- name: Enable bluetooth service - name: Enable bluetooth service
become: true become: true