Compare commits

..
1 Commits
Author SHA1 Message Date
kevinnlsamuel ecd9f47bae import old book 2026-09-15 00:34:43 +05:30
41 changed files with 144 additions and 296 deletions

No files matched your search

+1 -2
View File
@@ -41,8 +41,7 @@ tags: []
# collection label 'namespace.name'. The value is a version range # collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version # L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ',' # range specifiers can be set and are separated by ','
dependencies: dependencies: {}
community.general: ">=13.0.0<14.0.0"
# The URL of the originating SCM repository # The URL of the originating SCM repository
repository: https://gitea.kevinnlsamuel.com/kevinnlsamuel/galaxy repository: https://gitea.kevinnlsamuel.com/kevinnlsamuel/galaxy
File renamed without changes.
File renamed without changes.
+3
View File
@@ -0,0 +1,3 @@
[defaults]
inventory = ./hosts.ini
vault_password_file = ./secrets-client
@@ -1,20 +1,13 @@
--- ---
- hosts: - hosts: all
- 127.0.0.1 name: setup desktop
connection: local vars_files:
name: setup fedora workstation - secrets
module_defaults:
ansible.builtin.dnf:
install_weak_deps: false
tasks: tasks:
- name: remove fedora fluff - name: remove fedora fluff
become: true become: true
ansible.builtin.dnf: ansible.builtin.dnf:
state: absent
allowerasing: true allowerasing: true
autoremove: true autoremove: true
name: name:
@@ -25,10 +18,10 @@
- python3-botocore - python3-botocore
- firefox - firefox
- nodejs - nodejs
state: absent
- name: install core components - name: install core components
become: true become: true
ansible.builtin.dnf: dnf:
state: present state: present
name: name:
- git - git
@@ -49,7 +42,6 @@
- mosh - mosh
- unzip - unzip
- flatpak - flatpak
- name: install pup - name: install pup
become: true become: true
unarchive: unarchive:
@@ -57,30 +49,33 @@
creates: /usr/local/bin/pup creates: /usr/local/bin/pup
dest: /usr/local/bin/ dest: /usr/local/bin/
src: https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip src: https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
- name: install google-chrome dnf repository
- name: install dnf repos become: true
include_role: copy:
role: installdnfrepo dest: /etc/yum.repos.d/google-chrome.repo
loop: content: |
- id: googlechrome [google-chrome]
baseurl: https://dl.google.com/linux/chrome/rpm/stable/x86_64 name=google-chrome
gpgkey: https://dl.google.com/linux/linux_signing_key.pub baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
- id: wayscriber gpgcheck=1
baseurl: https://wayscriber.com/rpm gpgkey=https://dl.google.com/linux/linux_signing_key.pub
gpgkey: https://wayscriber.com/rpm/RPM-GPG-KEY-wayscriber.asc - name: install tailscale dnf repository
become: true
- id: tailscale copy:
baseurl: https://pkgs.tailscale.com/stable/fedora/$basearch dest: /etc/yum.repos.d/tailscale.repo
gpgkey: https://pkgs.tailscale.com/stable/fedora/repo.gpg content: |
[tailscale]
- id: charmcli name=Tailscale
baseurl: https://repo.charm.sh/yum/ baseurl=https://pkgs.tailscale.com/stable/fedora/$basearch
gpgkey: https://repo.charm.sh/yum/gpg.key enabled=1
type=rpm
repo_gpgcheck=1
gpgcheck=1
gpgkey=https://pkgs.tailscale.com/stable/fedora/repo.gpg
- name: install dnf packages - name: install dnf packages
become: true become: true
ansible.builtin.dnf: dnf:
state: present state: present
name: name:
- aria2 - aria2
@@ -90,7 +85,6 @@
- btrfs-progs - btrfs-progs
- coreutils - coreutils
- moreutils - moreutils
- parallel
- fcitx5-gtk4 - fcitx5-gtk4
- file - file
- gh - gh
@@ -123,10 +117,6 @@
- wkhtmltopdf - wkhtmltopdf
- yq - yq
- ImageMagick - ImageMagick
- wayscriber
- qt6ct
- trash-cli
- name: install flatpak applications - name: install flatpak applications
become: true become: true
flatpak: flatpak:
@@ -135,13 +125,12 @@
- https://valent.andyholmes.ca/valent.flatpakref - https://valent.andyholmes.ca/valent.flatpakref
- com.nextcloud.desktopclient.nextcloud - com.nextcloud.desktopclient.nextcloud
- org.libreoffice.LibreOffice - org.libreoffice.LibreOffice
- org.mozilla.thunderbird_esr - org.mozilla.Thunderbird
- com.logseq.Logseq - com.logseq.Logseq
- com.github.xournalpp.xournalpp - com.github.xournalpp.xournalpp
- com.obsproject.Studio - com.obsproject.Studio
- com.obsproject.Studio.Plugin.DroidCam
- com.yubico.yubioath - com.yubico.yubioath
- com.github.tchx84.Flatseal - com.github.tchx84.Flatseal
@@ -160,27 +149,39 @@
- org.inkscape.Inkscape - org.inkscape.Inkscape
- org.darktable.Darktable - org.darktable.Darktable
- org.audacityteam.Audacity - org.audacityteam.Audacity
- name: create group myself - name: create group myself
become: true become: true
group: group:
name: myself name: myself
gid: 690 gid: 690
system: true system: true
- name: create group rootlessmen
become: true
group:
name: rootlessmen
system: true
- name: create users - name: create users
loop: become: true
with_items:
- name: kevins - name: kevins
uid: 6901 uid: 6901
groups: ["wheel", "myself"] groups: ["myself", "rootlessmen"]
- name: kevinsamuel - name: kevinsamuel
uid: 6902 uid: 6902
groups: ["myself"] groups: myself
- name: kevinnlsamuel - name: kevinnlsamuel
uid: 6903 uid: 6903
groups: ["myself"] groups: ["myself", "rootlessmen"]
ansible.builtin.include_role: user:
role: createworkstationuser state: present
name: "{{ item.name }}"
uid: "{{ item.uid }}"
groups: "{{ item.groups }}"
skeleton: /dev/null
append: true
password: $1$aBLdYKQI$iB3ZfYF.QPCwVhgnkROUX.
update_password: on_create
shell: /bin/zsh
- name: use crun as podman engine - name: use crun as podman engine
become: true become: true
@@ -199,8 +200,15 @@
path: "{{file}}" path: "{{file}}"
line: 'runtime = "/usr/bin/runc"' line: 'runtime = "/usr/bin/runc"'
search_string: 'runtime = ' search_string: 'runtime = '
- name: create storage for rootlessmen
- name: setup podman btrfs storage become: true
file:
path: /var/lib/rootlessmen
owner: root
group: rootlessmen
mode: "0770"
state: directory
- name: setup podman to use rootlessmen for storage
become: true become: true
vars: vars:
file: /etc/containers/storage.conf file: /etc/containers/storage.conf
@@ -214,12 +222,27 @@
path: "{{file}}" path: "{{file}}"
line: "[storage]" line: "[storage]"
insertbefore: BOF insertbefore: BOF
- name: setup storage config to use rootlessmen
- name: set podman storage config to btrfs with_items:
- line: 'driver_priority = ["btrfs", "overlay", "vfs"]'
search_string: 'driver_priority = '
- line: 'rootless_storage_path = "/var/lib/rootlessmen/$USER/storage"'
search_string: 'rootless_storage_path = '
lineinfile: lineinfile:
path: "{{file}}" path: "{{file}}"
line: 'driver_priority = ["btrfs", "overlay", "vfs"]' line: "{{item.line}}"
search_string: 'driver_priority = ' search_string: "{{item.search_string}}"
- name: set selinux fcontext for rootlessmen
become: true
with_items:
- pathspec: /var/lib/rootlessmen/[^/]+/storage/artifacts(/.*)?
type: container_ro_file_t
- pathspec: /var/lib/rootlessmen/[^/]+/storage/volumes/[^/]*/.*
type: container_file_t
sefcontext:
target: "{{item.pathspec}}"
setype: "{{item.type}}"
seuser: unconfined_u
- name: enable tpm-tss in dracut - name: enable tpm-tss in dracut
become: true become: true
@@ -231,7 +254,6 @@
mode: "1644" mode: "1644"
create: true create: true
state: present state: present
- name: tell PAM to unlock gnome-keyring in tty - name: tell PAM to unlock gnome-keyring in tty
become: true become: true
with_items: with_items:
@@ -289,18 +311,6 @@
firewall-cmd --permanent --zone home --add-service=kdeconnect --add-service=mosh --add-service=ssh firewall-cmd --permanent --zone home --add-service=kdeconnect --add-service=mosh --add-service=ssh
firewall-cmd --reload firewall-cmd --reload
- import_role:
role: managegooglechrome
become: true
name: set chrome policies
- name: enabled tailscaled service
become: true
ansible.builtin.service:
name: tailscaled
enabled: true
state: started
- name: create /home/myself - name: create /home/myself
become: true become: true
file: file:
@@ -309,14 +319,12 @@
group: myself group: myself
owner: kevins owner: kevins
mode: '2770' mode: '2770'
- name: check if HOME.git is cloned - name: check if HOME.git is cloned
become: true become: true
become_user: kevins become_user: kevins
register: home_repo register: home_repo
stat: stat:
path: /home/myself/HOME.git/HEAD path: /home/myself/HOME.git/HEAD
- name: "clone HOME.git" - name: "clone HOME.git"
become: true become: true
become_user: kevins become_user: kevins
@@ -329,7 +337,7 @@
origin \ origin \
-t stable \ -t stable \
-m stable \ -m stable \
git@github.com:kevinnlsamuel/HOME.git https://{{PAT}}@github.com/kevinnlsamuel/HOME.git
git fetch --set-upstream origin stable git fetch --set-upstream origin stable
- name: clone HOME to my selves - name: clone HOME to my selves
File renamed without changes.
File renamed without changes.
-12
View File
@@ -1,12 +0,0 @@
---
- hosts:
- tmp.kevinnlsamuel.com
vars:
ansible_user: root
alt_ssh_port: 1023
name: setup server natsuco
roles:
- kevinnlsamuel.galaxy.sshd.disablepasswd
- kevinnlsamuel.galaxy.sshd.altport
tasks:
@@ -1 +0,0 @@
Port {{ alt_ssh_port }}
+38
View File
@@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for .
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for .
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for .
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
localhost
+6
View File
@@ -0,0 +1,6 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- .
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for .
-6
View File
@@ -1,6 +0,0 @@
galaxy_info:
author: kevinnlsamuel
description: sayin hello
dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
View File
Whitespace-only changes.
-6
View File
@@ -1,6 +0,0 @@
galaxy_info:
author: kevinnlsamuel
description: sayin hello
dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
-28
View File
@@ -1,28 +0,0 @@
- ansible.builtin.import_role:
role: ensuredir
become: true
vars:
path: "{{ subvpath | dirname }}"
- name: check if btrfs subv exists
register: btrfssubvexists
become: true
failed_when: false
changed_when: false
ansible.builtin.shell: "btrfs subv list {{ subvpath | mandatory | dirname }} | grep -qF {{ subvpath | basename }}"
- block:
- name: "create btrfs subv {{ subvpath | mandatory }}"
when: btrfssubvexists.rc != 0
become: true
ansible.builtin.command:
cmd: "btrfs subv create {{ subvpath }}"
- name: "set owner:group of subv {{ subvpath }}"
when: btrfssubvexists.rc != 0
become: true
ansible.builtin.file:
state: touch
path: "{{ subvpath | mandatory }}"
owner: "{{ owner | mandatory }}"
group: "{{ group | default(owner) }}"
@@ -1,6 +0,0 @@
galaxy_info:
author: kevinnlsamuel
description: sayin hello
dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
@@ -1,18 +0,0 @@
- become: true
user:
state: present
name: "{{ item.name }}"
uid: "{{ item.uid }}"
groups: "{{ item.groups }}"
skeleton: /dev/null
append: true
password: $1$aBLdYKQI$iB3ZfYF.QPCwVhgnkROUX.
update_password: on_create
shell: /bin/zsh
- name: "create subv for containers"
ansible.builtin.include_role:
role: createbtrfssubv
apply:
vars:
subvpath: "/home/{{ item.name }}/.local/share/containers"
owner: "{{ item.name }}"
-6
View File
@@ -1,6 +0,0 @@
galaxy_info:
author: kevinnlsamuel
description: sayin hello
dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
-28
View File
@@ -1,28 +0,0 @@
- name: check if dir exists
register: stat_output
ansible.builtin.stat:
path: "{{ path }}"
- name: create dir if not exists
when: not stat_output.stat.exists
ansible.builtin.file:
path: "{{ path }}"
state: directory
- name: backup and create dir if not dir
when: stat_output.stat.exists and not stat_output.stat.isdir
block:
- name: "backup existing {{ path }}"
no_log: true
ansible.builtin.copy:
src: "{{ path }}"
dest: "{{ path }}.old"
- name: "delete existing {{ path }}"
no_log: true
ansible.builtin.file:
path: "{{ path }}"
state: absent
- name: "create {{ path }}"
ansible.builtin.file:
path: "{{ path }}"
state: directory
-6
View File
@@ -1,6 +0,0 @@
galaxy_info:
author: kevinnlsamuel
description: sayin hello
dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
-8
View File
@@ -1,8 +0,0 @@
- name: "install {{ item.id | default( id ) | mandatory }} dnf repository"
become: true
ansible.builtin.template:
dest: "/etc/yum.repos.d/{{ item.id | default( id ) | mandatory }}.repo"
src: dnfrepo.j2
owner: root
group: root
mode: 644
@@ -1,7 +0,0 @@
[{{ item.id | default( id ) | mandatory }}]
name={{ item.id | default( id ) | mandatory }}
baseurl={{ item.baseurl | default( baseurl ) | mandatory }}
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey={{ item.gpgkey | default( gpgkey ) | mandatory }}
-16
View File
@@ -1,16 +0,0 @@
- name: manage google chrome
block:
- ansible.builtin.file:
path: /etc/opt/chrome/policies/managed/
state: directory
owner: root
group: root
mode: '0755'
- ansible.builtin.copy:
src: disable-local-llm.json
dest: /etc/opt/chrome/policies/managed/disable-local-llm.json
owner: root
group: root
mode: '0644'
-5
View File
@@ -1,5 +0,0 @@
---
- name: restart sshd
service:
name: sshd
state: restarted
-1
View File
@@ -1 +0,0 @@
/home/kevins/Projects/galaxy/roles/sshd/_handlers
-16
View File
@@ -1,16 +0,0 @@
---
- name: change ssh port to {{ alt_ssh_port | mandatory }}
notify: restart sshd
template:
src: 00-altport.conf
dest: /etc/ssh/sshd_config.d/00-altport.conf
- name: install semanage
when: ansible_facts.selinux.status != 'disabled'
dnf:
state: present
name: policycoreutils-python-utils
- name: give sshd access to alt port on selinux
register: result_change_to_alt_port
ignore_errors: true
changed_when: "'already defined' not in result_change_to_alt_port.stdout"
command: semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}
@@ -1 +0,0 @@
Port {{ alt_ssh_port }}
@@ -1 +0,0 @@
PasswordAuthentication no
-1
View File
@@ -1 +0,0 @@
/home/kevins/Projects/galaxy/roles/sshd/_handlers
-5
View File
@@ -1,5 +0,0 @@
- name: disable password auth
notify: restart sshd
copy:
src: 00-nopasswd.conf
dest: /etc/ssh/sshd_config.d/00-nopasswd.conf
-35
View File
@@ -1,35 +0,0 @@
#SPDX-License-Identifier: MIT-0
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
-8
View File
@@ -1,8 +0,0 @@
- name: check connection to hosted git servers
loop:
- github.com
- gitea.kevinnlsamuel.com
changed_when: false
ansible.builtin.shell: >
ssh -T git@{{item}} 2>&1 | grep -qF 'successfully authenticated'