diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..87af05bf --- /dev/null +++ b/Gemfile @@ -0,0 +1,17 @@ +# Gemfile + +source 'https://rubygems.org' + +gem 'debug', '1.8.0' +gem 'google-protobuf', '3.25.0' +gem 'io-console', '0.6.0' +gem 'irb', '1.8.3' +gem 'pry' +gem 'pry-doc' +gem 'psych', '5.1.1.1' +gem 'rake' +gem 'rdoc', '6.5.0' +gem 'reline', '0.3.9' +gem 'sorbet-runtime', '0.5.11116' +gem 'stringio', '3.0.8' +gem 'tty-progressbar' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..7cdb3f3b --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,69 @@ +GEM + remote: https://rubygems.org/ + specs: + coderay (1.1.3) + debug (1.8.0) + irb (>= 1.5.0) + reline (>= 0.3.1) + google-protobuf (3.25.0) + google-protobuf (3.25.0-aarch64-linux) + google-protobuf (3.25.0-arm64-darwin) + google-protobuf (3.25.0-x86-linux) + google-protobuf (3.25.0-x86_64-darwin) + google-protobuf (3.25.0-x86_64-linux) + io-console (0.6.0) + irb (1.8.3) + rdoc + reline (>= 0.3.8) + method_source (1.0.0) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-doc (1.4.0) + pry (~> 0.11) + yard (~> 0.9.11) + psych (5.1.1.1) + stringio + rake (13.1.0) + rdoc (6.5.0) + psych (>= 4.0.0) + reline (0.3.9) + io-console (~> 0.5) + sorbet-runtime (0.5.11116) + stringio (3.0.8) + strings-ansi (0.2.0) + tty-cursor (0.7.1) + tty-progressbar (0.18.2) + strings-ansi (~> 0.2) + tty-cursor (~> 0.7) + tty-screen (~> 0.8) + unicode-display_width (>= 1.6, < 3.0) + tty-screen (0.8.2) + unicode-display_width (2.5.0) + yard (0.9.34) + +PLATFORMS + aarch64-linux + arm64-darwin + ruby + x86-linux + x86_64-darwin + x86_64-linux + +DEPENDENCIES + debug (= 1.8.0) + google-protobuf (= 3.25.0) + io-console (= 0.6.0) + irb (= 1.8.3) + pry + pry-doc + psych (= 5.1.1.1) + rake + rdoc (= 6.5.0) + reline (= 0.3.9) + sorbet-runtime (= 0.5.11116) + stringio (= 3.0.8) + tty-progressbar + +BUNDLED WITH + 2.5.3 diff --git a/README.md b/README.md index 97d292d4..51befecc 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ An exercise in configuration management. Intended to serve as an IaC framework f The repository contains Ansible roles, playbooks, and modules to help configure and manage Linux hosts that are part of an audio production workflow. -## directory index +## Directory Index | Path | Content | | | :------------------------ | :------------------------------------------ | --- | @@ -42,7 +42,7 @@ vars/{{ distro }}/packages.yml - package lists var/stheme.yml - theme variables -### role variables +### Role Variables #### defaults/main.yml @@ -60,6 +60,13 @@ var/stheme.yml - theme variables - Role variables allow users to customize the role without modifying the role's default behavior. +### Using Tags + +```bash +ansible-playbook -i inventory.ini playbooks/full.yml --tags $TAGS --limit $HOSTNAME +``` + + # demo [![asciicast](https://asciinema.org/a/622463.svg)](https://asciinema.org/a/622463) diff --git a/bin/cfgmgv3.rb b/bin/cfgmgv3.rb new file mode 100755 index 00000000..d3ff06db --- /dev/null +++ b/bin/cfgmgv3.rb @@ -0,0 +1,125 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require 'cli/ui' +require 'yaml' +require 'json' +require 'csv' +require 'open4' +require "tty-prompt" + + +if ENV['ANSIBLE_HOME'] + ANSIBLE_HOME = ENV['ANSIBLE_HOME'] +else + ANSIBLE_HOME = File.expand_path('..', __dir__) +end + +VARS = File.join(ANSIBLE_HOME, 'vars') +PLAYBOOKS = File.join(ANSIBLE_HOME, 'playbooks') +GROUP_VARS = File.join(ANSIBLE_HOME, 'group_vars') +HOST_VARS = File.join(ANSIBLE_HOME, 'host_vars') +ROLES = File.join(ANSIBLE_HOME, 'roles') +INVENTORY = File.join(ANSIBLE_HOME, 'inventory.ini') + + + +class Ansible + + attr_accessor :inventory, :playbooks, :group_vars, :host_vars, :tags + + def initialize(location) + @playbooks = Dir.children(PLAYBOOKS) + @group_vars = File.join(location, 'group_vars') + @host_vars = File.join(location, 'host_vars') + end + + def tags(playbook) + @tags = `ansible-playbook -i #{INVENTORY} #{playbook} --list-tags | awk -F 'TASK TAGS:' '{print $2}'`.chomp.strip.gsub(/\[|\]|,/,'') + end + + +end + +# select playbook + + +syncopated = Ansible.new(ANSIBLE_HOME) + +p syncopated.playbooks + +playbook = `gum filter #{Dir.children(PLAYBOOKS).join(' ')}`.chomp.strip +p playbook + +tags = syncopated.tags(File.join(PLAYBOOKS, playbook)) +p tags + +t = `gum filter #{tags} --no-limit`.chomp.split("\n") + +p t + + + + + + + +CLI::UI::StdoutRouter.enable + + + +CLI::UI::Frame.open('{{*}} {{bold:a}}', color: :green) do + puts "hey fucker, select a playbook" + puts "full playbook selected, retriveing tags" + CLI::UI::Frame.open('{{i}} b', color: :magenta) do + puts "select tags to run..." + CLI::UI::Frame.open('{{?}} c', color: :cyan) do + + @distro = CLI::UI.ask('Select Distro', options: %w(AlmaLinux Archlinux)) + + end + + end + + CLI::UI::Frame.divider('{{v}} lol') + + puts "#{@distro}" + + packages = YAML.load_file(File.join(VARS, "#{@distro}", "packages.yml")) + + prompt = TTY::Prompt.new + + choice = prompt.multi_select("Select packages", packages["packages"]).flatten + + t = `gum filter #{choice.join(' ')} --no-limit`.chomp.split("\n") + + p t + +end + + +def test(arg) + puts "hey fucker" +end + +CLI::UI::Frame.open('{{i}} b', color: :magenta) do + + CLI::UI::Prompt.ask('What language/framework do you use?') do |handler| + handler.option('rails') { |selection| test(selection) } + handler.option('go') { |selection| selection } + handler.option('ruby') { |selection| selection } + handler.option('python') { |selection| selection } + end + +end + +CLI::UI::Progress.progress do |bar| + 100.times do + bar.tick + end +end + +CLI::UI::SpinGroup.new do |spin_group| + spin_group.add('Title') { |spinner| `ansible-playbook -C -i /home/b08x/Workspace/syncopatedIaC/inventory.ini /home/b08x/Workspace/syncopatedIaC/playbooks/full.yml --limit lapbot --tags desktop` } + spin_group.add('Title 2') { |spinner| sleep 3.0; spinner.update_title('New Title'); sleep 3.0 } +end diff --git a/bin/package_names.sh b/bin/package_names.sh new file mode 100644 index 00000000..0308c04c --- /dev/null +++ b/bin/package_names.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + + +# Supported filters are: +# +# search +# project name substring to look for +# maintainer +# return projects maintainer by specified person +# category +# return projects with specified category +# inrepo +# return projects present in specified repository +# notinrepo +# return projects absent in specified repository +# repos +# return projects present in specified number of repositories (exact values and open/closed ranges are allowed, e.g. 1, 5-, -5, 2-7 +# families +# return projects present in specified number of repository families (for instance, use 1 to get unique projects) +# repos_newest +# return projects which are up to date in specified number of repositories +# families_newest +# return projects which are up to date in specified number of repository families +# newest +# return newest projects only +# outdated +# return outdated projects only +# problematic +# return problematic projects only + +# Example: get unique outdated projects not present in FreeBSD maintainer by foo@bar.com +# +# /api/v1/projects/?notinrepo=freebsd&maintainer=foo@bar.com&families=1&outdated=1 + +curl -s "https://repology.org/api/v1/projects/?inrepo=arcg&search=ambix"|jq + +curl -s "https://repology.org/api/v1/project/ambix" | jq diff --git a/bin/something.rb b/bin/something.rb new file mode 100755 index 00000000..774056ef --- /dev/null +++ b/bin/something.rb @@ -0,0 +1,58 @@ +#!/usr/bin/env ruby +require 'cli/ui' +require 'yaml' +require 'json' +require 'csv' +require 'open4' +require "tty-prompt" + +INVENTORY = '$ANSIBLE_HOME/hosts' +PLAYBOOK = '$ANSIBLE_HOME/soundbot.yml' + +# module Ansible +# module_function +# +# def playbook(*args) +# Soundbot::Command.tty("ansible-playbook -i #{INVENTORY} #{PLAYBOOK} #{args.join(' ')}") +# end +# +# def tags +# +# tags = playbook("--list-tags") +# +# return tags +# +# end +# +# def tasks +# +# tasks = playbook("--list-tasks") +# +# return tasks +# end +# +# def start_at_task(task) +# playbook("--start-at-task=#{task}") +# end +# +# end + +#!/usr/bin/env ruby +# send osc messages to sonic-pi for every line printed when running a playbook +# https://stackoverflow.com/a/43208709/10073106 + +require 'open3' +require 'tty-progressbar' +bar = TTY::ProgressBar.new("importing [:bar] :elapsed :percent", total: 225 ) + + + Dir.chdir(File.join(ENV["HOME"], "Workspace", "syncopatedIaC")) do + Open3.popen3 "ansible-playbook -C -i inventory.ini playbooks/full.yml --limit lapbot" do |stdin, stdout, stderr, thread| + while line = stdout.gets + # puts line + # `oscsend localhost 4560 /test/thing s "#{line}"` if line.include?("TASK") + bar.log("#{line.gsub(/\*/,'')}") + bar.advance if line.include?("TASK") + end + end + end diff --git a/bin/tasks.sh b/bin/tasks.sh index 229e7a0c..64cc311f 100755 --- a/bin/tasks.sh +++ b/bin/tasks.sh @@ -3,20 +3,30 @@ INVENTORY="${ANSIBLE_HOME}/inventory.ini" PLAYBOOKS="${ANSIBLE_HOME}/playbooks" -# tags=$(ansible-playbook -i $INVENTORY $PLAYBOOKS/full.yml --list-tags | awk -F 'TASK TAGS:' '{print $2}' | xargs | -# xargs | sd '^\[|\]|,' '') +declare -a tags=$(ansible-playbook -i $INVENTORY $PLAYBOOKS/full.yml --list-tags | awk -F 'TASK TAGS:' '{print $2}' | sd '^\[|\]|,' '') +echo $tags +# | xargs | xargs # -# gum choose --no-limit ${tags[@]} +declare -a todo=$(gum choose --no-limit ${tags[@]}) -# tasks=$(ansible-playbook -i $INVENTORY "${PLAYBOOKS}/full.yml" --list-tasks | awk -F ':' '{print $2}' | awk -F '\t' '{print $1}'| uniq | gum filter --no-limit) +echo ${todo} -tasks=$(ansible-playbook -i $INVENTORY "${PLAYBOOKS}/full.yml" --list-tasks | awk -F ':' '{print $2}' | awk -F '\t' '{print $1}'| uniq) -echo $tasks -exit +# tasks=$(ansible-playbook -i $INVENTORY "${PLAYBOOKS}/full.yml" --list-tasks | awk -F ':' '{print $2}' | awk -F '\t' '{print $1}'| uniq | gum filter --no-limit) + +# tasks=$(ansible-playbook -i $INVENTORY "${PLAYBOOKS}/full.yml" --list-tasks | awk -F ':' '{print $2}' | awk -F '\t' '{print $1}'| uniq) +# +# echo $tasks +# exit # for task in "${tasks[@]}"; do # ansible-playbook -i $INVENTORY "${PLAYBOOKS}/full.yml" --start-at-ask="$task" --limit syncopatedos # done +for tag in "${todo}"; do + t=$(echo $tag | sd -s '\[\]' '') + echo $t + #ansible-playbook -C -i $INVENTORY "${PLAYBOOKS}/full.yml" --tag $t --limit lapbot +done + # alacritty, always, applications, asdf, audio, autofs, autologin, backgrounds, backup, barrier, base, bluetooth, cpupower, deadbeef, desktop, docker, dunst, env, firewall, fonts, full, gnome, groups, grub, gtk, htop, i3, icons, keybindings, keys, kitty, libvirt, lnav, media, menu, mirrors, mixxx, network, networkmanager, nfs, ntp, osc2midi, packages, pacman, picom, pipewire, profile, protokol, pulsar, python, qt, ranger, realtime, reaper, repo, rofi, rsyncd, rtirq, rtkit, ruby, scripts, setup, shell, sonicannotator, soniclineup, ssh, sshd, sudoers, sway, sxhkd, sysctl, terminal, testing, theme, thunar, tony, touchosc, tuned, tuning, updatedb, user, vagrant, vamp, video, vscode, wireless, xdg, xorg, zram diff --git a/host_vars/lapbot.yml b/host_vars/lapbot.yml index 8d13045b..87c99a45 100644 --- a/host_vars/lapbot.yml +++ b/host_vars/lapbot.yml @@ -58,16 +58,16 @@ i3: workspaces: 'default' keybindings: 'default' -network: - interfaces: - eth0: - type: ethernet - ifname: eth0 - conn_name: eth0 - mac: 58:8a:5a:38:fb:22 - autoconnect: False - state: present - method4: disabled +# network: +# interfaces: +# eth0: +# type: ethernet +# ifname: eth0 +# conn_name: eth0 +# mac: 58:8a:5a:38:fb:22 +# autoconnect: False +# state: present +# method4: disabled # enp0s20f0u1: # type: ethernet # ifname: enp0s20f0u1 @@ -82,28 +82,30 @@ network: # ifname: wlan0 # conn_name: wlan0 # mac: 66:a1:53:c9:7b:e5 + # assigned_address: c0:25:e9:74:cd:96 + # ssid: visiblemagic + # autoconnect: False + # state: present + # method4: auto + # wlan1: + # type: wifi + # ifname: wlan1 + # conn_name: visiblemagic + # mac: c0:25:e9:74:cd:96 + # assigned_address: c0:25:e9:74:cd:96 # ssid: invisiblemagic + # wifi_sec: + # key_mgmt: wpa-psk + # psk: "{{ wifi_key }}" + # ip4: 192.168.41.4/24 + # gw4: 192.168.41.1 + # dns4: + # - 192.168.41.41 + # - 192.168.41.1 + # dns4_search: syncopated.net # autoconnect: False # state: present - # method4: disabled - wlan1: - type: wifi - ifname: wlan1 - conn_name: invisiblemagic - mac: c0:25:e9:74:cd:96 - ssid: invisiblemagic - wifi_sec: - key_mgmt: wpa-psk - psk: "{{ wifi_key }}" - ip4: 192.168.41.4/24 - gw4: 192.168.41.1 - dns4: - - 192.168.41.41 - - 192.168.41.1 - dns4_search: syncopated.net - autoconnect: True - state: present - method4: manual + # method4: manual host: kernel: diff --git a/host_vars/ninjabot.yml b/host_vars/ninjabot.yml index b5291394..d44d38af 100644 --- a/host_vars/ninjabot.yml +++ b/host_vars/ninjabot.yml @@ -60,31 +60,31 @@ i3: - "$ws10 output DVI-D-0" keybindings: 'default' -network: - interfaces: - eth0: - type: ethernet - ifname: eth0 - conn_name: eth0 - mac: bc:5f:f4:0e:bb:b5 - ip4: 192.168.41.44/24 - gw4: 192.168.41.1 - dns4: - - 192.168.41.41 - - 192.168.41.1 - dns4_search: syncopated.net - autoconnect: True - state: present - method4: manual - eth1: - type: ethernet - ifname: eth1 - conn_name: audio - mac: bc:5f:f4:0e:bb:b3 - ip4: 192.168.36.3/32 - autoconnect: True - state: present - method4: manual +# network: +# interfaces: +# eth0: +# type: ethernet +# ifname: eth0 +# conn_name: eth0 +# mac: bc:5f:f4:0e:bb:b5 +# ip4: 192.168.41.44/24 +# gw4: 192.168.41.1 +# dns4: +# - 192.168.41.41 +# - 192.168.41.1 +# dns4_search: syncopated.net +# autoconnect: True +# state: present +# method4: manual +# eth1: +# type: ethernet +# ifname: eth1 +# conn_name: audio +# mac: bc:5f:f4:0e:bb:b3 +# ip4: 192.168.36.3/32 +# autoconnect: True +# state: present +# method4: manual host: kernel: diff --git a/host_vars/soundbot.yml b/host_vars/soundbot.yml index e50b2a83..22664539 100644 --- a/host_vars/soundbot.yml +++ b/host_vars/soundbot.yml @@ -28,7 +28,7 @@ docker: nvidia: False desktop: - dm: lightdm + dm: False wm: i3 terminal: "kitty" terminal_alt: "alacritty" @@ -61,31 +61,39 @@ i3: # - "$ws10 output eDP1" keybindings: 'default' -network: - interfaces: - eth2: - type: ethernet - ifname: eth2 - conn_name: audio - mac: 00:e0:4d:78:b7:7c - ip4: 192.168.36.1/24 - autoconnect: True - state: present - method4: manual - eth1: - type: ethernet - ifname: eth1 - conn_name: eth1 - mac: 00:50:b6:91:fc:4d - ip4: 192.168.41.42/24 - gw4: 192.168.41.1 - dns4: - - 192.168.41.41 - - 192.168.41.1 - dns4_search: syncopated.net - autoconnect: True - state: present - method4: manual +# network: +# interfaces: +# eth0: +# type: ethernet +# ifname: eth0 +# conn_name: eth0 +# mac: 54:ee:75:fd:46:30 +# autoconnect: False +# state: present +# method4: disabled +# eth2: +# type: ethernet +# ifname: eth2 +# conn_name: audio +# mac: 00:e0:4d:78:b7:7c +# ip4: 192.168.36.1/24 +# autoconnect: True +# state: present +# method4: manual +# eth1: +# type: ethernet +# ifname: eth1 +# conn_name: eth1 +# mac: 00:50:b6:91:fc:4d +# ip4: 192.168.41.42/24 +# gw4: 192.168.41.1 +# dns4: +# - 192.168.41.41 +# - 192.168.41.1 +# dns4_search: syncopated.net +# autoconnect: True +# state: present +# method4: manual host: xorg: diff --git a/host_vars/tinybot.yml b/host_vars/tinybot.yml index b6ab8932..e785882e 100644 --- a/host_vars/tinybot.yml +++ b/host_vars/tinybot.yml @@ -70,31 +70,31 @@ i3: - "$ws10 output DP-2" keybindings: "default" -network: - interfaces: - eth1: - type: ethernet - ifname: eth1 - conn_name: eth1 - mac: 68:1d:ef:2a:ac:47 - ip4: 192.168.41.43/24 - gw4: 192.168.41.1 - dns4: - - 192.168.41.41 - - 192.168.41.1 - dns4_search: syncopated.net - autoconnect: True - state: present - method4: manual - eth0: - type: ethernet - ifname: eth0 - conn_name: audio - mac: 68:1d:ef:2a:b4:03 - ip4: 192.168.36.2/24 - autoconnect: True - state: present - method4: manual +# network: +# interfaces: +# eth1: +# type: ethernet +# ifname: eth1 +# conn_name: eth1 +# mac: 68:1d:ef:2a:ac:47 +# ip4: 192.168.41.43/24 +# gw4: 192.168.41.1 +# dns4: +# - 192.168.41.41 +# - 192.168.41.1 +# dns4_search: syncopated.net +# autoconnect: True +# state: present +# method4: manual +# eth0: +# type: ethernet +# ifname: eth0 +# conn_name: audio +# mac: 68:1d:ef:2a:b4:03 +# ip4: 192.168.36.2/24 +# autoconnect: True +# state: present +# method4: manual # wlan0: # type: wifi diff --git a/playbooks/full.yml b/playbooks/full.yml index 7b96f0de..5e58d741 100644 --- a/playbooks/full.yml +++ b/playbooks/full.yml @@ -1,16 +1,15 @@ --- -- hosts: all +- hosts: workstation tags: ['workstation'] become: True - gather_facts: True - # gather_subset: - # - hardware - # - network + gather_subset: + - hardware + - network vars_files: - - ../vars/{{ ansible_facts["distribution"] }}/packages.yml + - ../vars/Archlinux/packages.yml - ../vars/theme.yml vars: - suffix: ".{{ ansible_date_time.epoch }}.{{ ansible_date_time.date }}@{{ ansible_date_time.time }}~" + # suffix: ".{{ ansible_date_time.epoch }}.{{ ansible_date_time.date }}@{{ ansible_date_time.time }}~" path: - "{{ lookup('env','HOME') }}/.local/bin" - "{{ lookup('env','HOME') }}/.asdf/bin" @@ -26,11 +25,32 @@ var: ansible_facts["date_time"]["epoch"] tags: ['always'] + # the task will run if `check_mode` to 'no' + - name: Register timestamp + shell: 'date +"%Y%m%d_%H%M%S"' + register: timestamp + check_mode: no + tags: ['always'] + + # - name: show expected_value + # debug: + # var: timestamp + # tags: ['always'] + + - name: Set suffix + set_fact: + suffix: "{{ timestamp.stdout_lines[0] }}" + tags: ['always'] # - name: Set expected_value # set_fact: # expected_value: "playbook_pretask_setfact" # tags: ["testing"] + # - name: show expected_value + # debug: + # var: suffix + # tags: ['always'] + - name: Symlink /etc/os-release to /etc/system-release file: src: /etc/os-release diff --git a/roles/base/files/usr/lib/systemd/user/gnome-keyring-daemon.service b/roles/base/files/usr/lib/systemd/user/gnome-keyring-daemon.service new file mode 100644 index 00000000..fc1514e5 --- /dev/null +++ b/roles/base/files/usr/lib/systemd/user/gnome-keyring-daemon.service @@ -0,0 +1,14 @@ +[Unit] +Description=GNOME Keyring daemon + +Requires=gnome-keyring-daemon.socket + +[Service] +Type=simple +StandardError=journal +ExecStart=/usr/bin/gnome-keyring-daemon --foreground --components="pkcs11,secrets,ssh,gpg" --control-directory=%t/keyring +Restart=on-failure + +[Install] +Also=gnome-keyring-daemon.socket +WantedBy=default.target diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 5661b0de..ce51560c 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -53,20 +53,24 @@ file: zram.yml tags: ['zram'] -- name: Set video modules in mkinitcpio - template: - src: etc/mkinitcpio.conf.j2 - dest: /etc/mkinitcpio.conf - owner: root - group: root - mode: '0644' - backup: yes - register: mkinitcpio_conf - tags: ['mkinitcpio'] - -- name: use shell to do stuff - shell: mkinitcpio -P - when: mkinitcpio_conf.changed +- block: + - name: Set video modules in mkinitcpio + template: + src: etc/mkinitcpio.conf.j2 + dest: /etc/mkinitcpio.conf + owner: root + group: root + mode: '0644' + backup: yes + register: mkinitcpio_conf + + + - name: Re-create ramdisk if config changed + shell: mkinitcpio -P + when: mkinitcpio_conf.changed + + # when: ansible_facts["lsb"]["id"] != 'EndeavourOS' + when: inventory_hostname != 'soundbot' tags: ['mkinitcpio'] - import_tasks: diff --git a/roles/base/tasks/sshd.yml b/roles/base/tasks/sshd.yml index 056e0c5d..41e885d0 100644 --- a/roles/base/tasks/sshd.yml +++ b/roles/base/tasks/sshd.yml @@ -13,3 +13,21 @@ state: restarted enabled: True when: sshd_config.changed + +- name: Adjust gnome-keyring-service file to include ssh and gpg + copy: + src: usr/lib/systemd/user/gnome-keyring-daemon.service + dest: /usr/lib/systemd/user/gnome-keyring-daemon.service + mode: '0644' + backup: yes + register: keyringservice + tags: ['gnome-keyring'] + +- name: Enable gnome-keyring service + systemd: + name: gnome-keyring-daemon + enabled: yes + scope: user + become_user: "{{ user.name }}" + when: keyringservice.changed + tags: ['gnome-keyring'] diff --git a/roles/base/templates/etc/mkinitcpio.conf.j2 b/roles/base/templates/etc/mkinitcpio.conf.j2 index 580b1e93..6cd5b7a5 100644 --- a/roles/base/templates/etc/mkinitcpio.conf.j2 +++ b/roles/base/templates/etc/mkinitcpio.conf.j2 @@ -6,12 +6,14 @@ # MODULES=(usbhid xhci_hcd) {% if inventory_hostname == 'ninjabot' %} MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) -{% endif %} +{% else %} {% if inventory_hostname == 'tinybot' %} MODULES=(i915 intel_agp) {% else %} MODULES=() {% endif %} +{% endif %} + # BINARIES # This setting includes any additional binaries a given user may diff --git a/roles/desktop/files/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop b/roles/desktop/files/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop new file mode 100644 index 00000000..d52395ba --- /dev/null +++ b/roles/desktop/files/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Name=PolicyKit Authentication Agent +Name[ar]=مدير الاستيثاق PolicyKit +Name[be]=PolicyKit - аґент аўтэнтыфікацыі +Name[bn_IN]=PolicyKit অনুমোদনের এজেন্ট +Name[ca]=Agent d'autenticació del PolicyKit +Name[cs]=Ověřovací agent PolicyKit +Name[da]=Godkendelsesprogrammet PolicyKit +Name[de]=Legitimationsdienst von PolicyKit +Name[el]=Πράκτορας πιστοποίησης PolicyKit +Name[en_GB]=PolicyKit Authentication Agent +Name[es]=Agente de autenticación de PolicyKit +Name[eu]=PolicyKit autentifikatzeko agentea +Name[fi]=PolicytKit-tunnistautumisohjelma +Name[fr]=Agent d'authentification de PolicyKit +Name[gl]=Axente de autenticación PolicyKit +Name[gu]=PolicyKit સત્તાધિકરણ એજન્ટ +Name[hi]=PolicyKit प्रमाणीकरण प्रतिनिधि +Name[hu]=PolicyKit hitelesítési ügynök +Name[it]=Agente di autenticazione per PolicyKit +Name[ja]=PolicyKit 認証エージェント +Name[kn]=PolicyKit ದೃಢೀಕರಣ ಮಧ್ಯವರ್ತಿ +Name[lt]=PolicyKit tapatybės nustatymo agentas +Name[ml]=പോളിസിക്കിറ്റ് ഓഥന്റിക്കേഷന്‍ ഏജന്റ് +Name[mr]=PolicyKit ऑथेंटीकेशन एजेंट +Name[or]=PolicyKit ବୈଧିକରଣ ସଦସ୍ୟ +Name[pa]=ਪਾਲਸੀਕਿੱਟ ਪਰਮਾਣਕਿਤਾ ਏਜੰਟ +Name[pl]=Agent uwierzytelniania PolicyKit +Name[pt]=Agente de Autenticação PolicyKit +Name[pt_BR]=Agente de autenticação PolicyKit +Name[ro]=Agent de autentificare PolicyKit +Name[sk]=Agent PolicyKit na overovanie totožnosti +Name[sl]=PolicyKit program overjanja +Name[sv]=Autentiseringsagent för PolicyKit +Name[ta]=PolicyKit அங்கீகார முகவர் +Name[te]=పాలసీకిట్ ధృవీకరణ ప్రతినిధి +Name[th]=ตัวกลางสำหรับยืนยันตัวบุคคล PolicyKit +Name[uk]=Агент автентифікації PolicyKit +Name[zh_CN]=PolicyKit 认证代理 +Name[zh_HK]=PolicyKit 驗證代理程式 +Name[zh_TW]=PolicyKit 驗證代理程式 +Comment=PolicyKit Authentication Agent +Comment[ar]=مدير الاستيثاق PolicyKit +Comment[be]=PolicyKit - аґент аўтэнтыфікацыі +Comment[bn_IN]=PolicyKit অনুমোদনের এজেন্ট +Comment[ca]=Agent d'autenticació del PolicyKit +Comment[cs]=Ověřovací agent PolicyKit +Comment[da]=Godkendelsesprogrammet PolicyKit +Comment[de]=Legitimationsdienst von PolicyKit +Comment[el]=Πράκτορας πιστοποίησης PolicyKit +Comment[en_GB]=PolicyKit Authentication Agent +Comment[es]=Agente de autenticación de PolicyKit +Comment[eu]=PolicyKit autentifikatzeko agentea +Comment[fi]=PolicytKit-tunnistautumisohjelma +Comment[fr]=Agent d'authentification de PolicyKit +Comment[gl]=Axente de autenticación PolicyKit +Comment[gu]=PolicyKit સત્તાધિકરણ એજન્ટ +Comment[hi]=PolicyKit प्रमाणीकरण प्रतिनिधि +Comment[hu]=PolicyKit hitelesítési ügynök +Comment[it]=Agente di autenticazione per PolicyKit +Comment[ja]=PolicyKit 認証エージェント +Comment[kn]=PolicyKit ದೃಢೀಕರಣ ಮಧ್ಯವರ್ತಿ +Comment[lt]=PolicyKit tapatybės nustatymo agentas +Comment[ml]=പോളിസിക്കിറ്റ് ഓഥന്റിക്കേഷന്‍ ഏജന്റ് +Comment[mr]=PolicyKit ऑथेंटीकेशन एजेंट +Comment[or]=PolicyKit ବୈଧିକରଣ ସଦସ୍ୟ +Comment[pa]=ਪਾਲਸੀਕਿੱਟ ਪਰਮਾਣਕਿਤਾ ਏਜੰਟ +Comment[pl]=Agent uwierzytelniania PolicyKit +Comment[pt]=Agente de Autenticação PolicyKit +Comment[pt_BR]=Agente de autenticação PolicyKit +Comment[ro]=Agent de autentificare PolicyKit +Comment[sk]=Agent PolicyKit na overovanie totožnosti +Comment[sl]=PolicyKit program overjanja +Comment[sv]=Autentiseringsagent för PolicyKit +Comment[ta]=PolicyKit அங்கீகார முகவர் +Comment[te]=పాలసీకిట్ ధృవీకరణ ప్రతినిధి +Comment[th]=ตัวกลางสำหรับยืนยันตัวบุคคล PolicyKit +Comment[uk]=Агент автентифікації PolicyKit +Comment[zh_CN]=PolicyKit 认证代理 +Comment[zh_HK]=PolicyKit 驗證代理程式 +Comment[zh_TW]=PolicyKit 驗證代理程式 +Exec=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +Terminal=false +Type=Application +Categories= +NoDisplay=true +NotShowIn=GNOME; diff --git a/roles/desktop/files/etc/xdg/autostart/dunst.desktop b/roles/desktop/files/etc/xdg/dunst.desktop similarity index 100% rename from roles/desktop/files/etc/xdg/autostart/dunst.desktop rename to roles/desktop/files/etc/xdg/dunst.desktop diff --git a/roles/desktop/files/etc/xdg/autostart/gnome-keyring.desktop b/roles/desktop/files/etc/xdg/gnome-keyring.desktop similarity index 100% rename from roles/desktop/files/etc/xdg/autostart/gnome-keyring.desktop rename to roles/desktop/files/etc/xdg/gnome-keyring.desktop diff --git a/roles/desktop/files/etc/xdg/autostart/jacktrip.desktop b/roles/desktop/files/etc/xdg/jacktrip.desktop similarity index 100% rename from roles/desktop/files/etc/xdg/autostart/jacktrip.desktop rename to roles/desktop/files/etc/xdg/jacktrip.desktop diff --git a/roles/desktop/files/etc/xdg/autostart/picom.desktop b/roles/desktop/files/etc/xdg/picom.desktop similarity index 100% rename from roles/desktop/files/etc/xdg/autostart/picom.desktop rename to roles/desktop/files/etc/xdg/picom.desktop diff --git a/roles/desktop/files/etc/xdg/autostart/snapshot-detect.desktop b/roles/desktop/files/etc/xdg/snapshot-detect.desktop similarity index 100% rename from roles/desktop/files/etc/xdg/autostart/snapshot-detect.desktop rename to roles/desktop/files/etc/xdg/snapshot-detect.desktop diff --git a/roles/desktop/tasks/main.yml b/roles/desktop/tasks/main.yml index c03088ec..ce692f81 100644 --- a/roles/desktop/tasks/main.yml +++ b/roles/desktop/tasks/main.yml @@ -132,8 +132,8 @@ - name: Set picom config template: - src: "etc/skel/.config/picom/picom.conf.j2" - dest: "{{ user.home }}/.config/picom/picom.conf" + src: "etc/skel/.config/picom.conf.j2" + dest: "{{ user.home }}/.config/picom.conf" owner: root group: root mode: "0644" @@ -169,6 +169,7 @@ checksum: yes perms: no rsync_opts: + - "--delete" - "--update" - "--progress" - "--itemize-changes" diff --git a/roles/desktop/templates/etc/skel/.config/picom/picom.conf.j2 b/roles/desktop/templates/etc/skel/.config/picom.conf.j2 similarity index 100% rename from roles/desktop/templates/etc/skel/.config/picom/picom.conf.j2 rename to roles/desktop/templates/etc/skel/.config/picom.conf.j2 diff --git a/roles/i3/tasks/main.yml b/roles/i3/tasks/main.yml index 0e30c72b..872beec5 100644 --- a/roles/i3/tasks/main.yml +++ b/roles/i3/tasks/main.yml @@ -63,12 +63,12 @@ register: wmconfig with_items: - .config/i3/config - - .config/i3/window_behavior - .config/i3/modes/resize - .config/i3/keybindings - .config/i3/appearance - - .config/i3/window_assignments - - .config/i3/autostart + # - .config/i3/window_behavior + # - .config/i3/window_assignments + # - .config/i3/autostart - name: Set i3status-rs configuration template: diff --git a/roles/i3/templates/etc/skel/.config/i3/config.j2 b/roles/i3/templates/etc/skel/.config/i3/config.j2 index 7cd3d15c..13d1062e 100644 --- a/roles/i3/templates/etc/skel/.config/i3/config.j2 +++ b/roles/i3/templates/etc/skel/.config/i3/config.j2 @@ -120,13 +120,17 @@ $exec_always xrdb -load ~/.Xresources $exec "/usr/share/i3/scripts/i3autolayout.py" {% endif %} - {% if i3.autostart != 'default' %} {% for a in i3.autostart %} $exec {{ a }} {% endfor %} {% endif %} +$exec_always nitrogen --restore + $exec "dex -a -s /etc/xdg/autostart/:~/.config/autostart/" +### placed here as for some reason did not execute in .xprofile +$exec pactl -- set-sink-volume 0 55% + $exec_always "reload-sxhkd.sh" diff --git a/roles/i3/templates/etc/skel/.config/picom/picom.conf.j2 b/roles/i3/templates/etc/skel/.config/picom/picom.conf.j2 deleted file mode 100644 index 25ea1318..00000000 --- a/roles/i3/templates/etc/skel/.config/picom/picom.conf.j2 +++ /dev/null @@ -1,77 +0,0 @@ -unredir-if-possible = false; -# Shadow -shadow = false; -shadow-radius = 7; -shadow-offset-x = -7; -shadow-offset-y = -7; -log-level = "warn"; -shadow-opacity = 0.5; -shadow-exclude = [ - "name = 'Notification'", - "class_g = 'Conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "_GTK_FRAME_EXTENTS@:c" -]; - -# Opacity -inactive-opacity = 1; -active-opacity = 1; -frame-opacity = 1; -# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) -inactive-dim = 0.2 -inactive-opacity-override = false; -blur-kern = "3x3box"; -blur-background-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'", - "_GTK_FRAME_EXTENTS@:c" -]; -opacity-rule = [ - "90:class_g = 'URTerm' && focused", - "60:class_g = 'URTerm' && !focused", - "100:class_g = 'Google-chrome' && focused", - "100:class_g = 'Google-chrome' && !focused", - "100:name *= 'EBU R128 Meter' && focused", - "98:name *= 'EBU R128 Meter' && !focused", - "100:name *= 'zita-mu1-0.3.3' && focused", - "95:name *= 'zita-mu1-0.3.3' && !focused", - "90:name *= 'thunar' && focused", - "80:name *= 'thunar' && !focused" -]; -# Fading -fading = true; -fade-delta = 4; -fade-in-step = 0.05; -fade-out-step = 0.03; -fade-exclude = ["name = 'jgmenu'"]; - -# Other -backend = "glx"; -mark-wmwin-focused = true; -mark-ovredir-focused = true; -# use-ewmh-active-win = true; -detect-rounded-corners = true; -detect-client-opacity = true; -refresh-rate = 0; -vsync = true; -focus-exclude = [ "class_g = 'Cairo-clock'" ]; -detect-transient = true; -detect-client-leader = true; -invert-color-include = [ ]; - -# GLX backend -glx-no-stencil = true; -glx-no-rebind-pixmap = true; -# xrender-sync-fence = true; -use-damage = true; - -# Window type settings -wintypes: -{ - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - dock = { shadow = false; } - dnd = { shadow = false; } - popup_menu = { opacity = 1; } - dropdown_menu = { opacity = 1; } -}; diff --git a/roles/network/tasks/interfaces.yml b/roles/network/tasks/interfaces.yml index feef51ab..7265224a 100644 --- a/roles/network/tasks/interfaces.yml +++ b/roles/network/tasks/interfaces.yml @@ -37,6 +37,7 @@ method4: "{{ item.value.method4 }}" wifi: mac-address: "{{ item.value.mac }}" + assigned-mac-address: "{{ item.value.assigned_mac }}" ssid: "{{ item.value.ssid }}" wifi_sec: key-mgmt: "{{ item.value.wifi_sec.key_mgmt }}" diff --git a/roles/terminal/templates/etc/skel/.config/kitty/kitty.conf.j2 b/roles/terminal/templates/etc/skel/.config/kitty/kitty.conf.j2 index 8f81d479..8ad6d972 100644 --- a/roles/terminal/templates/etc/skel/.config/kitty/kitty.conf.j2 +++ b/roles/terminal/templates/etc/skel/.config/kitty/kitty.conf.j2 @@ -134,7 +134,7 @@ mark2_background #f2dcd3 mark3_foreground black mark3_background #f274bc -shell /bin/zsh --login +shell /bin/zsh editor . diff --git a/roles/xorg/templates/etc/skel/.xprofile.j2 b/roles/xorg/templates/etc/skel/.xprofile.j2 index 4908b226..864afbc2 100644 --- a/roles/xorg/templates/etc/skel/.xprofile.j2 +++ b/roles/xorg/templates/etc/skel/.xprofile.j2 @@ -30,7 +30,8 @@ xset -b numlockx on -/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +# move to xdg autostart +# /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & {% if x.autostart != 'default' %} {% for program in x.autostart %} @@ -39,8 +40,9 @@ numlockx on {% endfor %} {% endif %} -picom -b & +[[ -f "$HOME/.asound.state" ]] && alsactl restore -f "$HOME/.asound.state" + +picom -b nm-applet & redshift-gtk & -nitrogen --restore & dunst & diff --git a/roles/zsh/files/usr/local/share/zsh/functions/ranger b/roles/zsh/files/usr/local/share/zsh/functions/ranger deleted file mode 100644 index 62b65120..00000000 --- a/roles/zsh/files/usr/local/share/zsh/functions/ranger +++ /dev/null @@ -1,7 +0,0 @@ -ranger() { - if [ -z "$RANGER_LEVEL" ]; then - /usr/bin/ranger "$@" - else - exit - fi -} diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml index 6fe3272f..061a1989 100644 --- a/roles/zsh/tasks/main.yml +++ b/roles/zsh/tasks/main.yml @@ -27,7 +27,7 @@ - "--omit-dir-times" - "--progress" - "--itemize-changes" - # - "--chown=root:root" + - "--delete" - "--backup" - "--suffix={{ suffix }}" ignore_errors: "{{ ansible_check_mode }}" diff --git a/roles/zsh/templates/etc/skel/.zprofile.j2 b/roles/zsh/templates/etc/skel/.zprofile.j2 index f7307a2f..dbb38868 100644 --- a/roles/zsh/templates/etc/skel/.zprofile.j2 +++ b/roles/zsh/templates/etc/skel/.zprofile.j2 @@ -12,28 +12,20 @@ fi export -U PATH -export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh -export GPG_TTY="$TTY" - -if [[ $(id -u) -ne 0 ]]; then - systemctl --user import-environment GPG_TTY SSH_AUTH_SOCK - dbus-update-activation-environment --all -fi - -if ! pgrep -a "keyring" >/dev/null; then - echo "starting gnome-keyring from .zprofile???" - eval "$(/usr/bin/gnome-keyring-daemon --replace --daemonize --components=pkcs11,secrets,ssh,gpg)" -fi - -export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT_INFO SSH_AUTH_SOCK - -if [[ $(id -u) -ne 0 ]]; then - [[ -z "${DISPLAY}" ]] && pactl -- set-sink-volume 0 55% - sleep 0.125 - - [[ -z "${DISPLAY}" ]] && [[ -f "$HOME/.asound.state" ]] && alsactl restore -f "$HOME/.asound.state" - sleep 0.125 -fi +# export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh +# export GPG_TTY="$TTY" +# +# if [[ $(id -u) -ne 0 ]]; then +# systemctl --user import-environment GPG_TTY SSH_AUTH_SOCK +# dbus-update-activation-environment --all +# fi +# +# if ! pgrep -a "keyring" >/dev/null; then +# echo "starting gnome-keyring from .zprofile???" +# eval "$(/usr/bin/gnome-keyring-daemon --replace --daemonize --components=pkcs11,secrets,ssh,gpg)" +# fi +# +# export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT_INFO SSH_AUTH_SOCK {% if desktop.dm == False %} diff --git a/vars/Archlinux/packages.yml b/vars/Archlinux/packages.yml index 3583ed9e..dbc01439 100644 --- a/vars/Archlinux/packages.yml +++ b/vars/Archlinux/packages.yml @@ -101,6 +101,7 @@ packages: - patat-bin - pgvector - redshift + - geoclue - rofi - sampler - sd @@ -167,7 +168,6 @@ packages: - html2md - odt2txt - open-chinese-fonts - - pandoc-cli - pdf2htmlex-appimage - pdfjs - perl-image-exiftool @@ -176,6 +176,8 @@ packages: - qpdf - qpdfview - termpdf.py-git + texlive: + - pandoc-cli - texlive-basic - texlive-bin - texlive-coffee-stains @@ -186,6 +188,7 @@ packages: - texlive-latexrecommended - texlive-pictures - texlive-xetex + - texlive-fontsextra editors: - aubio - audacity