Merge branch 'aur-helper'
This commit is contained in:
commit
208eca8c05
11 changed files with 117 additions and 42 deletions
3
files/docker-daemon.json
Normal file
3
files/docker-daemon.json
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"data-root": "/mnt/docker"
|
||||||
|
}
|
||||||
|
|
@ -19,11 +19,9 @@
|
||||||
- npm
|
- npm
|
||||||
tasks:
|
tasks:
|
||||||
- import_tasks: 'tasks/main.yml'
|
- import_tasks: 'tasks/main.yml'
|
||||||
- include_role:
|
|
||||||
name: common
|
|
||||||
tasks_from: 'poetry.yml'
|
|
||||||
- import_tasks: 'tasks/dotfiles.yml'
|
- import_tasks: 'tasks/dotfiles.yml'
|
||||||
- import_tasks: 'tasks/neovim.yml'
|
- import_tasks: 'tasks/neovim.yml'
|
||||||
|
- import_tasks: 'tasks/aur.yml'
|
||||||
|
- import_tasks: 'tasks/docker.yml'
|
||||||
vars_files:
|
vars_files:
|
||||||
- 'vars/main.yml'
|
- 'vars.yml'
|
||||||
- 'vars/{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml'
|
|
||||||
|
|
|
||||||
22
tasks/aur-package.yml
Normal file
22
tasks/aur-package.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
- name: 'build package {{ item.name }}'
|
||||||
|
command: 'makepkg --syncdeps --rmdeps --clean --noconfirm --force'
|
||||||
|
args:
|
||||||
|
chdir: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
|
|
||||||
|
- name: 'retrieve package name for {{ item.name }}'
|
||||||
|
command: 'grep -oP "(?<=pkgname=).*" {{ aur_build_dir }}/{{ item.name }}/PKGBUILD'
|
||||||
|
register: pkg_name
|
||||||
|
|
||||||
|
- name: 'retrieve package version for {{ item.name }}'
|
||||||
|
command: 'grep -oP "(?<=pkgver=).*" {{ aur_build_dir }}/{{ item.name }}/PKGBUILD'
|
||||||
|
register: pkg_version
|
||||||
|
|
||||||
|
- name: 'retrieve package release for {{ item.name }}'
|
||||||
|
command: 'grep -oP "(?<=pkgrel=).*" {{ aur_build_dir }}/{{ item.name }}/PKGBUILD'
|
||||||
|
register: pkg_release
|
||||||
|
|
||||||
|
- name: 'install {{ item.name }}'
|
||||||
|
become: true
|
||||||
|
pacman:
|
||||||
|
name: '{{ aur_build_dir }}/{{ item.name }}/{{ pkg_name.stdout }}-{{ pkg_version.stdout }}-{{ pkg_release.stdout }}-x86_64.pkg.tar.zst'
|
||||||
|
state: present
|
||||||
29
tasks/aur.yml
Normal file
29
tasks/aur.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
- name: clone aur packages
|
||||||
|
become: true
|
||||||
|
git:
|
||||||
|
repo: '{{ item.url }}'
|
||||||
|
dest: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
|
update: true
|
||||||
|
loop: '{{ aur_packages }}'
|
||||||
|
|
||||||
|
- name: change aur package directories owner
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '{{ aur_build_dir }}/{{ item.name }}'
|
||||||
|
state: directory
|
||||||
|
owner: '{{ ansible_user_id }}'
|
||||||
|
group: '{{ ansible_user_id }}'
|
||||||
|
recurse: true
|
||||||
|
loop: '{{ aur_packages }}'
|
||||||
|
|
||||||
|
- name: build & install aur packages
|
||||||
|
include_tasks: 'tasks/aur-package.yml'
|
||||||
|
loop: '{{ aur_packages }}'
|
||||||
|
|
||||||
|
- name: enable docker socket
|
||||||
|
systemd:
|
||||||
|
name: docker.socket
|
||||||
|
state: restarted
|
||||||
|
enabled: true
|
||||||
|
scope: user
|
||||||
|
daemon_reload: true
|
||||||
34
tasks/docker.yml
Normal file
34
tasks/docker.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
- name: copy docker mapping files
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
src: '{{ item.src }}'
|
||||||
|
dest: '{{ item.dest }}'
|
||||||
|
loop:
|
||||||
|
- {
|
||||||
|
src: 'templates/subgid.j2',
|
||||||
|
dest: '/etc/subgid',
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
src: 'templates/subuid.j2',
|
||||||
|
dest: '/etc/subuid',
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: setup desktop configuration
|
||||||
|
copy:
|
||||||
|
src: 'files/docker-daemon.json'
|
||||||
|
dest: '{{ xdg_config_dir }}/docker/daemon.json'
|
||||||
|
when: ansible_hostname == 'desktop'
|
||||||
|
|
||||||
|
- name: ensure correct DOCKER_HOST is set
|
||||||
|
lineinfile:
|
||||||
|
path: '{{ ansible_env.HOME }}/.bashrc'
|
||||||
|
regexp: '^export DOCKER_HOST='
|
||||||
|
line: 'export DOCKER_HOST=unix:///run/user/{{ ansible_user_uid }}/docker.sock'
|
||||||
|
|
||||||
|
- name: enable docker socket
|
||||||
|
systemd:
|
||||||
|
name: docker.socket
|
||||||
|
state: restarted
|
||||||
|
enabled: true
|
||||||
|
scope: user
|
||||||
|
daemon_reload: true
|
||||||
1
templates/subgid.j2
Normal file
1
templates/subgid.j2
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{ ansible_user_id }}:231072:65536
|
||||||
1
templates/subuid.j2
Normal file
1
templates/subuid.j2
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{{ ansible_user_id }}:231072:65536
|
||||||
|
|
@ -1,7 +1,30 @@
|
||||||
ansible_connection: local
|
ansible_connection: local
|
||||||
ansible_python_interpreter: '/usr/bin/env python'
|
ansible_python_interpreter: '/usr/bin/env python'
|
||||||
|
|
||||||
packages: []
|
packages:
|
||||||
|
- base-devel
|
||||||
|
- python
|
||||||
|
- poetry
|
||||||
|
- git
|
||||||
|
- vim
|
||||||
|
- neovim
|
||||||
|
- npm
|
||||||
|
- docker
|
||||||
|
- docker-compose
|
||||||
|
- fuse-overlayfs
|
||||||
|
- ttf-ibm-plex
|
||||||
|
|
||||||
|
aur_packages:
|
||||||
|
- {
|
||||||
|
url: 'https://aur.archlinux.org/rootlesskit.git',
|
||||||
|
name: 'rootlesskit'
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
url: 'https://aur.archlinux.org/docker-rootless-extras-bin.git',
|
||||||
|
name: 'docker-rootless'
|
||||||
|
}
|
||||||
|
|
||||||
|
aur_build_dir: '/usr/local/src'
|
||||||
|
|
||||||
xdg_config_dir: '{{ ansible_env.HOME }}/.config'
|
xdg_config_dir: '{{ ansible_env.HOME }}/.config'
|
||||||
xdg_data_dir: '{{ ansible_env.HOME }}/.local/share'
|
xdg_data_dir: '{{ ansible_env.HOME }}/.local/share'
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
packages:
|
|
||||||
- python
|
|
||||||
- poetry
|
|
||||||
- git
|
|
||||||
- vim
|
|
||||||
- neovim
|
|
||||||
- npm
|
|
||||||
- docker
|
|
||||||
- docker-compose
|
|
||||||
- ttf-ibm-plex
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
packages:
|
|
||||||
- git
|
|
||||||
- vim
|
|
||||||
- neovim
|
|
||||||
- python3
|
|
||||||
- python3-pip
|
|
||||||
- python3-venv
|
|
||||||
- python3-setuptools
|
|
||||||
- exuberant-ctags
|
|
||||||
- apt-transport-https
|
|
||||||
- fonts-ibm-plex
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
dotfiles_repo: 'https://git.fudiggity.nl/sonny/dotfiles.git'
|
|
||||||
githook_repo: 'https://git.fudiggity.nl/sonny/git-hooks.git'
|
|
||||||
|
|
||||||
packages:
|
|
||||||
- git
|
|
||||||
- vim
|
|
||||||
- neovim
|
|
||||||
- python2
|
|
||||||
- python3
|
|
||||||
- python3-pip
|
|
||||||
- python3-venv
|
|
||||||
- python3-setuptools
|
|
||||||
- exuberant-ctags
|
|
||||||
- apt-transport-https
|
|
||||||
- fonts-ibm-plex
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue