chore!: separated galaxy deps and own collections; modified ansible script generation to use two paths for collections
REQUIRES REGENERATING ansible.cfg!
This commit is contained in:
parent
4af69c31ce
commit
888590ed9f
188 changed files with 30 additions and 30 deletions
|
@ -0,0 +1,242 @@
|
|||
---
|
||||
- name: '[home] get user account information'
|
||||
ansible.builtin.getent:
|
||||
database: passwd
|
||||
key: "{{ workstation_user_account }}"
|
||||
split: ":"
|
||||
changed_when: false
|
||||
when: ansible_facts['getent_passwd'] is undefined or workstation_user_account not in ansible_facts['getent_passwd']
|
||||
|
||||
- name: '[setup] ensure expected home directories exist'
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ workstation_user_account }}"
|
||||
group: "{{ workstation_user_account }}"
|
||||
mode: '0750'
|
||||
loop:
|
||||
- .local/bin
|
||||
- .local/share/applications
|
||||
|
||||
- name: '[apt] install dependencies and tools'
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
force_apt_get: true
|
||||
cache_valid_time: 3600
|
||||
pkg:
|
||||
- apt-file
|
||||
- curl
|
||||
- dbus-x11 # terminator
|
||||
- diffpdf
|
||||
- feh
|
||||
- ffmpeg
|
||||
- flatpak
|
||||
- gettext # terminator
|
||||
- gir1.2-keybinder-3.0 # terminator
|
||||
- gir1.2-vte-2.91 # terminator
|
||||
- gnupg2
|
||||
- gvfs-backends
|
||||
- intltool # terminator
|
||||
- mesa-utils
|
||||
- mpc
|
||||
- mpd
|
||||
- mpv
|
||||
- ncmpcpp
|
||||
- numlockx
|
||||
- openssh-server
|
||||
- pass
|
||||
- poppler-utils
|
||||
- pwgen
|
||||
- python3-configobj # terminator
|
||||
- python3-gi # terminator
|
||||
- python3-gi-cairo # terminator
|
||||
- python3-pip
|
||||
- python3-psutil # terminator
|
||||
- python3-setuptools # terminator
|
||||
- ruby
|
||||
- ruby-dev
|
||||
- scrot
|
||||
- smbclient
|
||||
- socat
|
||||
- sshfs
|
||||
- suckless-tools
|
||||
- sudo
|
||||
- unclutter-xfixes
|
||||
- vlc
|
||||
- whois
|
||||
- wireshark
|
||||
- xdotool
|
||||
- xsel
|
||||
- xserver-xephyr
|
||||
state: present
|
||||
|
||||
- name: '[setup] add user to sudo group'
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
name: "{{ workstation_user_account }}"
|
||||
groups:
|
||||
- sudo
|
||||
append: true
|
||||
|
||||
- name: '[setup] setup Flatpak'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
block:
|
||||
- name: '[flatpak] add flatpak repos'
|
||||
ansible.builtin.command:
|
||||
cmd: flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
changed_when: false
|
||||
- name: '[flatpak] install flatpak apps'
|
||||
ansible.builtin.command:
|
||||
cmd: "flatpak install --user --noninteractive {{ item.repo }} {{ item.app }}"
|
||||
creates: "/var/lib/flatpak/app/{{ item.app }}"
|
||||
loop:
|
||||
- repo: flathub
|
||||
app: com.discordapp.Discord
|
||||
- repo: flathub
|
||||
app: md.obsidian.Obsidian
|
||||
|
||||
- name: '[github] install tools'
|
||||
become: true
|
||||
nullified.infrastructure.github_artifact:
|
||||
github_token: '{{ workstation_github_token }}'
|
||||
asset_name: "{{ item.asset_name | default('') }}"
|
||||
asset_type: "{{ item.asset_type }}"
|
||||
cmds: "{{ item.cmds | default([]) }}"
|
||||
creates: "{{ item.creates | default('') }}"
|
||||
repository: "{{ item.repository }}"
|
||||
version: "{{ item.version | default('') }}"
|
||||
loop:
|
||||
- asset_name: terminator-{version}.tar.gz
|
||||
asset_type: release
|
||||
repository: gnome-terminator/terminator
|
||||
creates: /usr/local/bin/terminator
|
||||
cmds:
|
||||
- tar -zxf {asset_dirname}/{asset_filename}
|
||||
- cd $(find . -maxdepth 1 -name terminator\* -type d); python3 setup.py build; python3 setup.py install --single-version-externally-managed --record=install-files.txt
|
||||
- rm -rf {asset_dirname}/{asset_filename}
|
||||
- asset_name: noseyparker-{version}-x86_64-unknown-linux-gnu.tar.gz
|
||||
asset_type: release
|
||||
repository: praetorian-inc/noseyparker
|
||||
creates: /usr/local/bin/noseyparker
|
||||
cmds:
|
||||
- tar -zxf {asset_dirname}/{asset_filename}
|
||||
- install --group=root --mode=755 --owner=root bin/noseyparker /usr/local/bin
|
||||
|
||||
- name: '[ruby] install tools'
|
||||
become: true
|
||||
ansible.builtin.command:
|
||||
cmd: "gem install {{ item.app }}"
|
||||
creates: "{{ item.creates }}"
|
||||
loop:
|
||||
- app: mdless
|
||||
creates: /usr/local/bin/mdless
|
||||
|
||||
- name: '[system] setup various directories'
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
mode: "{{ item.mode | default('0750') }}"
|
||||
owner: "{{ item.owner | default(workstation_user_account) }}"
|
||||
group: "{{ item.group | default(workstation_user_account) }}"
|
||||
state: directory
|
||||
loop:
|
||||
- { path: '/srv/git/foss' }
|
||||
- { path: '/srv/git/perso' }
|
||||
- { path: '/srv/git/work' }
|
||||
- { path: '/srv/storage' }
|
||||
|
||||
- name: '[emacs] fetch emacs configuration files'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
ansible.builtin.git:
|
||||
repo: "https://gitlab.0x2a.ninja/naeikindus/emacsd.git"
|
||||
dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.emacs.d"
|
||||
force: false
|
||||
|
||||
- name: '[config] set tools configuration'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0640') }}"
|
||||
loop:
|
||||
- { src: "../templates/.config/terminator", dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.config" }
|
||||
- { src: "../templates/.config/vlc", dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.config" }
|
||||
|
||||
- name: '[authenticator] find if binary is already installed'
|
||||
ansible.builtin.file:
|
||||
path: /opt/yubico-authenticator/authenticator
|
||||
register: authenticator_stat
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: '[yubico] install authenticator'
|
||||
become: true
|
||||
when: authenticator_stat.state is match("absent")
|
||||
block:
|
||||
- name: '[yubico] prepare target directory'
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
owner: "{{ workstation_user_account }}"
|
||||
group: "{{ workstation_user_account }}"
|
||||
mode: '0750'
|
||||
state: directory
|
||||
loop:
|
||||
- /tmp/yubico-unarchive
|
||||
- /opt/yubico-authenticator
|
||||
|
||||
- name: '[yubico] extract data'
|
||||
ansible.builtin.unarchive:
|
||||
src: https://developers.yubico.com/yubioath-flutter/Releases/yubico-authenticator-latest-linux.tar.gz
|
||||
remote_src: true
|
||||
dest: /tmp/yubico-unarchive
|
||||
owner: "{{ workstation_user_account }}"
|
||||
group: "{{ workstation_user_account }}"
|
||||
|
||||
- name: '[yubico] find extracted directory'
|
||||
ansible.builtin.command:
|
||||
cmd: find /tmp/yubico-unarchive -mindepth 1 -maxdepth 1
|
||||
register: yubico_extract_path
|
||||
changed_when: false
|
||||
|
||||
- name: '[yubico] move extracted data to final dir'
|
||||
ansible.builtin.copy:
|
||||
remote_src: true
|
||||
src: "{{ yubico_extract_path.stdout }}/"
|
||||
dest: /opt/yubico-authenticator
|
||||
owner: "{{ workstation_user_account }}"
|
||||
group: "{{ workstation_user_account }}"
|
||||
|
||||
- name: '[yubico] cleanup'
|
||||
ansible.builtin.file:
|
||||
path: /tmp/yubico-unarchive
|
||||
state: absent
|
||||
|
||||
- name: '[yubico] create shell wrapper'
|
||||
ansible.builtin.template:
|
||||
src: ../templates/bin_wrapper.sh.j2
|
||||
dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.local/bin/authenticator"
|
||||
mode: '0750'
|
||||
owner: "{{ workstation_user_account }}"
|
||||
group: "{{ workstation_user_account }}"
|
||||
vars:
|
||||
application: "/opt/yubico-authenticator/authenticator"
|
||||
|
||||
- name: '[yubico] create desktop entry'
|
||||
ansible.builtin.template:
|
||||
src: ../templates/desktop_app.j2
|
||||
dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.local/share/applications/authenticator.desktop"
|
||||
mode: '0600'
|
||||
owner: "{{ workstation_user_account }}"
|
||||
group: "{{ workstation_user_account }}"
|
||||
vars:
|
||||
application:
|
||||
nodisplay: false
|
||||
exec_cmd: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.local/bin/authenticator"
|
||||
name: "Authenticator"
|
||||
|
||||
- include_tasks: window_manager.yml
|
|
@ -0,0 +1,176 @@
|
|||
---
|
||||
- name: '[home] get user account information'
|
||||
ansible.builtin.getent:
|
||||
database: passwd
|
||||
key: "{{ workstation_user_account }}"
|
||||
split: ":"
|
||||
changed_when: false
|
||||
when: ansible_facts['getent_passwd'] is undefined or workstation_user_account not in ansible_facts['getent_passwd']
|
||||
|
||||
- name: '[awesomewm] install dependencies'
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
force_apt_get: true
|
||||
cache_valid_time: 3600
|
||||
pkg:
|
||||
- asciidoctor
|
||||
- build-essential
|
||||
- cmake
|
||||
- gir1.2-freedesktop
|
||||
- gir1.2-gdkpixbuf-2.0
|
||||
- gir1.2-glib-2.0
|
||||
- gir1.2-gtk-3.0
|
||||
- gir1.2-pango-1.0
|
||||
- imagemagick
|
||||
- libcairo-gobject2
|
||||
- libcairo2-dev
|
||||
- libdbus-1-dev
|
||||
- libgdk-pixbuf-2.0-dev
|
||||
- libgirepository1.0-dev
|
||||
- libglib2.0-dev
|
||||
- liblua5.4-dev
|
||||
- liblua5.4-dev
|
||||
- librsvg2-dev
|
||||
- libstartup-notification0-dev
|
||||
- libx11-dev
|
||||
- libx11-xcb-dev
|
||||
- libxcb-cursor-dev
|
||||
- libxcb-icccm4-dev
|
||||
- libxcb-keysyms1-dev
|
||||
- libxcb-randr0-dev
|
||||
- libxcb-shape0-dev
|
||||
- libxcb-util0-dev
|
||||
- libxcb-xfixes0-dev
|
||||
- libxcb-xinerama0-dev
|
||||
- libxcb-xkb-dev
|
||||
- libxcb-xrm-dev
|
||||
- libxcb-xtest0-dev
|
||||
- libxcb1-dev
|
||||
- libxdg-basedir-dev
|
||||
- libxkbcommon-x11-dev
|
||||
- libxkbcommon-dev
|
||||
- lua5.4
|
||||
- luajit2
|
||||
- menu
|
||||
- picom
|
||||
- x11-xserver-utils
|
||||
- xutils-dev
|
||||
|
||||
- name: '[lua-lgi] install lua-lgi'
|
||||
block:
|
||||
- name: '[lua-lgi] fetch source'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/lgi-devs/lgi.git
|
||||
dest: /srv/git/foss/lua-lgi
|
||||
force: false
|
||||
register: repo_clone
|
||||
failed_when:
|
||||
- repo_clone.failed
|
||||
- not 'Local modifications exist in the destination' in repo_clone.msg
|
||||
|
||||
- name: '[lua-lgi] switch from LUA 5.1 to LUA 5.4'
|
||||
ansible.builtin.replace:
|
||||
path: /srv/git/foss/lua-lgi/lgi/Makefile
|
||||
regexp: '5\.1'
|
||||
replace: '5.4'
|
||||
|
||||
- name: '[lua-lgi] building project'
|
||||
ansible.builtin.command:
|
||||
chdir: /srv/git/foss/lua-lgi
|
||||
cmd: make all
|
||||
creates: /srv/git/foss/lua-lgi/lgi/corelgilua51.so
|
||||
environment:
|
||||
LUA_CFLAGS: "-I/usr/include/lua5.4"
|
||||
|
||||
- name: '[lua-lgi] compile and install'
|
||||
become: true
|
||||
ansible.builtin.command:
|
||||
chdir: /srv/git/foss/lua-lgi
|
||||
cmd: make install
|
||||
creates: /usr/local/lib/lua/5.4/lgi/corelgilua51.so
|
||||
environment:
|
||||
LUA_CFLAGS: "-I/usr/include/lua5.4"
|
||||
|
||||
- name: '[lua-lgi] set permissions'
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: '{{ item }}'
|
||||
mode: 'u=rwX,g=rwX,o=rX'
|
||||
recurse: true
|
||||
loop:
|
||||
- /usr/local/lib/lua
|
||||
- /usr/local/share/lua/
|
||||
|
||||
- name: '[lua-lgi] set permissions'
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: '{{ item }}'
|
||||
mode: 'u=rwX,g=rwX,o=rX'
|
||||
loop:
|
||||
- /usr/local/lib/lua
|
||||
- /usr/local/share/lua
|
||||
|
||||
- name: '[awesomewm] install window manager'
|
||||
block:
|
||||
- name: '[awesomewm] fetch source'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/awesomeWM/awesome.git
|
||||
dest: /srv/git/foss/awesomeWM
|
||||
force: false
|
||||
register: repo_clone
|
||||
failed_when:
|
||||
- repo_clone.failed
|
||||
- not 'Local modifications exist in the destination' in repo_clone.msg
|
||||
|
||||
- name: '[awesomewm] building project'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
ansible.builtin.command:
|
||||
chdir: /srv/git/foss/awesomeWM
|
||||
cmd: 'make'
|
||||
creates: /srv/git/foss/awesomeWM/build
|
||||
environment:
|
||||
CMAKE_ARGS: "-DWITH_DBUS=ON -DLUA_LIBRARY=/usr/lib/x86_64-linux-gnu/liblua5.4.so.0 -DLUA_INCLUDE_DIR=/usr/include/lua5.4"
|
||||
|
||||
- name: '[awesomewm] building project'
|
||||
become: true
|
||||
ansible.builtin.command:
|
||||
chdir: /srv/git/foss/awesomeWM
|
||||
cmd: make install
|
||||
creates: /usr/local/bin/awesome
|
||||
|
||||
- name: '[awesomewm] setup configuration'
|
||||
become: true
|
||||
become_user: "{{ workstation_user_account }}"
|
||||
block:
|
||||
- name: '[awesomewm] fetch copycats base'
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/lcpz/awesome-copycats.git
|
||||
dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.config/awesome"
|
||||
depth: 1
|
||||
recursive: true
|
||||
force: false
|
||||
- name: '[awesomewm] copy customization'
|
||||
ansible.builtin.copy:
|
||||
src: ../templates/.config/awesome/
|
||||
dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.config/awesome"
|
||||
mode: '0640'
|
||||
|
||||
- name: '[home] copy X related configuration'
|
||||
become: true
|
||||
when: workstation_setup_xorg_enabled is truthy
|
||||
block:
|
||||
- name: '[x11] xorg.conf'
|
||||
ansible.builtin.copy:
|
||||
src: ../templates/system/xorg.conf
|
||||
dest: /etc/X11/xorg.conf
|
||||
mode: '0640'
|
||||
- name: '[x11] user .xsession'
|
||||
ansible.builtin.copy:
|
||||
src: ../templates/.xsession
|
||||
dest: "{{ ansible_facts['getent_passwd'][workstation_user_account][4] }}/.xsession"
|
Loading…
Add table
Add a link
Reference in a new issue