Compare commits

...
30 Commits
Author SHA1 Message Date
kevinnlsamuel 227bb41259 rearrange a lot 2026-10-25 01:46:36 +05:30
kevinnlsamuel 161ce95e7e that was so silly + restart sshd after disablepasswd 2026-10-23 23:04:19 +05:30
kevinnlsamuel 36cbf9861f track selinux change to alt ssh port 2026-10-23 23:01:21 +05:30
kevinnlsamuel 322a14a882 let's turn these into roles 2026-10-23 23:00:10 +05:30
kevinnlsamuel 7ce23b6fa4 yay! so this actually works 2026-10-23 22:35:04 +05:30
kevinnlsamuel 999595a699 new playbook? 2026-10-23 22:21:19 +05:30
kevinnlsamuel 4d6fcdee6f propa management of chrome 2026-10-01 17:23:25 +05:30
kevinnlsamuel e7f0d5e453 streamline dnf repo install 2026-10-01 00:33:47 +05:30
kevinnlsamuel 1843173e25 dust off 2026-09-30 23:57:52 +05:30
kevinnlsamuel 06d0065f69 dnf ignore weak deps by default 2026-09-30 23:52:25 +05:30
kevinnlsamuel ca805a8db4 typo 2026-09-15 22:00:25 +05:30
kevinnlsamuel 0b364a1bd4 cleanup 2026-09-15 21:57:20 +05:30
kevinnlsamuel 92012be667 catch up with refactor 2026-09-15 21:56:38 +05:30
kevinnlsamuel a06e02c7cc refactor 2/2: ensureparentdir > ensuredir 2026-09-15 21:55:40 +05:30
kevinnlsamuel 829e8225f6 refactor 1/2 ensureparentdir > ensuredir 2026-09-15 21:53:54 +05:30
kevinnlsamuel e07b18b587 clean up a little 2026-09-15 21:37:45 +05:30
kevinnlsamuel b17d8649ea more minor fixes 2026-09-15 20:46:58 +05:30
kevinnlsamuel 307dd26339 + wayscriber 2026-09-15 20:46:14 +05:30
kevinnlsamuel b9a1648a6f minor fixes 2026-09-15 20:44:31 +05:30
kevinnlsamuel c26d236db1 users 2026-09-15 15:40:44 +05:30
kevinnlsamuel 114f3dbf5e trying again 2026-09-15 15:28:16 +05:30
kevinnlsamuel 3a346acfb6 add dep 2026-09-15 15:26:32 +05:30
kevinnlsamuel c8d13e274e minor changes 2026-09-15 15:10:36 +05:30
kevinnlsamuel 8bde23573c hello, i overengineer everything 2026-09-15 15:06:19 +05:30
kevinnlsamuel abe2daebb9 this is stupid 2026-09-15 14:34:47 +05:30
kevinnlsamuel 396e18ff18 templates for things i want to make 2026-09-15 13:43:57 +05:30
kevinnlsamuel cb90399e47 role: check git connections 2026-09-15 13:32:29 +05:30
kevinnlsamuel 374b182c92 more renaming + ignore weak dnf deps 2026-09-15 11:57:24 +05:30
kevinnlsamuel 2aba8dd2f5 rename to valid characters 2026-09-15 09:18:12 +05:30
kevinnlsamuel bc85ab7969 import old book 2026-09-15 09:18:07 +05:30
49 changed files with 792 additions and 60 deletions

No files matched your search

+2 -1
View File
@@ -41,7 +41,8 @@ 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
+4
View File
@@ -0,0 +1,4 @@
check:
ansible-playbook --check -i inventory.ini -v --become-method community.general.run0 main.yaml
run:
ansible-playbook -i inventory.ini -v --become-method community.general.run0 main.yaml
+2
View File
@@ -0,0 +1,2 @@
[all]
localhost ansible_connection=local
+47
View File
@@ -0,0 +1,47 @@
- name: backup stuff
hosts: all
vars:
backup_directory: /var/backups/{{ ansible_date_time.date }}
pre_tasks:
- name: create backup directory
become: true
file:
state: directory
owner: root
group: root
mode: '0770'
path: "{{ backup_directory }}"
- name: "let {{ ansible_user_id }} write to backup directory"
register: setfacl
failed_when:
- setfacl.rc != 140
- setfacl.rc != 0
changed_when: setfacl.rc != 140
become: true
shell: |
if { getfacl -tn {{ backup_directory }} | tr -d ' ' | grep -Fq 'user{{ansible_user_uid}}rwxrwx' ; }; then
exit 140
fi
setfacl -dRmu:{{ ansible_user_id }}:rwX {{ backup_directory }}
setfacl -mu:{{ ansible_user_id }}:rwX {{ backup_directory }}
- name: structure the backup directory
file:
state: directory
path: "{{ backup_directory }}/{{ item }}"
with_items:
- disks
- "system-{{ ansible_hostname }}/users"
roles:
- storefacts
- disks
tasks:
- name: turn it into an archive
community.general.archive:
path: "{{ backup_directory }}"
dest: "{{ backup_directory | dirname }}/{{ backup_directory | basename }}.tar"
format: tar
+12
View File
@@ -0,0 +1,12 @@
---
- 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:
@@ -0,0 +1 @@
Port {{ alt_ssh_port }}
+4
View File
@@ -0,0 +1,4 @@
setup:
ansible all -a 'ansible-galaxy collection install community.general'
play:
ansible-playbook desktop-playbook.yml -v
+12
View File
@@ -0,0 +1,12 @@
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do | config |
config.vm.box = "fedora/41-cloud-base"
config.vm.provider :libvirt do | v |
end
config.ssh.insert_key = false
config.vm.define "desktop" do | client |
client.vm.hostname = "desktop"
# client.vm.network :private_network, ip: "192.168.122.132"
end
end
+7
View File
@@ -0,0 +1,7 @@
[all]
; set to whatever the vm is
172.35.1.142
[all:vars]
ansible_user = admin
ansible_ssh_private_key_file = ~/.ssh/keys/kevins.pub
+360
View File
@@ -0,0 +1,360 @@
---
- hosts:
- 127.0.0.1
connection: local
name: setup fedora workstation
module_defaults:
ansible.builtin.dnf:
install_weak_deps: false
tasks:
- name: remove fedora fluff
become: true
ansible.builtin.dnf:
state: absent
allowerasing: true
autoremove: true
name:
- anaconda-core
- anaconda-live
- anaconda-install-env-deps
- cockpit-system
- python3-botocore
- firefox
- nodejs
- name: install core components
become: true
ansible.builtin.dnf:
state: present
name:
- git
- git-crypt
- git-lfs
- gnupg2
- tmux
- curl
- acl
- stow
- make
- just
- zsh
- neovim
- nnn
- openssh-clients
- openssh-server
- mosh
- unzip
- flatpak
- name: install pup
become: true
unarchive:
remote_src: yes
creates: /usr/local/bin/pup
dest: /usr/local/bin/
src: https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
- name: install dnf repos
include_role:
role: installdnfrepo
loop:
- id: googlechrome
baseurl: https://dl.google.com/linux/chrome/rpm/stable/x86_64
gpgkey: https://dl.google.com/linux/linux_signing_key.pub
- id: wayscriber
baseurl: https://wayscriber.com/rpm
gpgkey: https://wayscriber.com/rpm/RPM-GPG-KEY-wayscriber.asc
- id: tailscale
baseurl: https://pkgs.tailscale.com/stable/fedora/$basearch
gpgkey: https://pkgs.tailscale.com/stable/fedora/repo.gpg
- id: charmcli
baseurl: https://repo.charm.sh/yum/
gpgkey: https://repo.charm.sh/yum/gpg.key
- name: install dnf packages
become: true
ansible.builtin.dnf:
state: present
name:
- aria2
- bat
- bc
- btop
- btrfs-progs
- coreutils
- moreutils
- parallel
- fcitx5-gtk4
- file
- gh
- google-chrome-stable
- gparted
- jo
- jq
- jrnl
- kitty
- kitty-terminfo
- lshw
- mpv
- ncdu
- pandoc
- podman
- runc
- pass
- wtype
- tailscale
- rclone
- rsync
- seahorse
- timew
- toolbox
- tree
- fzf
- socat
- tree-sitter-cli
- waybar
- wkhtmltopdf
- yq
- ImageMagick
- wayscriber
- qt6ct
- trash-cli
- name: install flatpak applications
become: true
flatpak:
state: present
name:
- https://valent.andyholmes.ca/valent.flatpakref
- com.nextcloud.desktopclient.nextcloud
- org.libreoffice.LibreOffice
- org.mozilla.thunderbird_esr
- com.logseq.Logseq
- com.github.xournalpp.xournalpp
- com.obsproject.Studio
- com.obsproject.Studio.Plugin.DroidCam
- com.yubico.yubioath
- com.github.tchx84.Flatseal
- org.gnome.Loupe
- com.github.johnfactotum.Foliate
- org.gnome.Papers
- org.gnome.FileRoller
- org.gnome.SimpleScan
- com.github.neithern.g4music
- info.febvre.Komikku
- org.gimp.GIMP
- net.scribus.Scribus
- org.inkscape.Inkscape
- org.darktable.Darktable
- org.audacityteam.Audacity
- name: create group myself
become: true
group:
name: myself
gid: 690
system: true
- name: create users
loop:
- name: kevins
uid: 6901
groups: ["wheel", "myself"]
- name: kevinsamuel
uid: 6902
groups: ["myself"]
- name: kevinnlsamuel
uid: 6903
groups: ["myself"]
ansible.builtin.include_role:
role: createworkstationuser
- name: use crun as podman engine
become: true
vars:
file: /etc/containers/containers.conf
block:
- lineinfile:
owner: root
group: root
mode: '0644'
create: true
path: "{{file}}"
line: "[engine]"
insertbefore: BOF
- lineinfile:
path: "{{file}}"
line: 'runtime = "/usr/bin/runc"'
search_string: 'runtime = '
- name: setup podman btrfs storage
become: true
vars:
file: /etc/containers/storage.conf
block:
- name: create container storage config
lineinfile:
owner: root
group: root
mode: '0644'
create: true
path: "{{file}}"
line: "[storage]"
insertbefore: BOF
- name: set podman storage config to btrfs
lineinfile:
path: "{{file}}"
line: 'driver_priority = ["btrfs", "overlay", "vfs"]'
search_string: 'driver_priority = '
- name: enable tpm-tss in dracut
become: true
lineinfile:
path: /etc/dracut.conf.d/55-tpm.conf
line: "add_dracutmodules+=' tpm2-tss '"
owner: root
group: root
mode: "1644"
create: true
state: present
- name: tell PAM to unlock gnome-keyring in tty
become: true
with_items:
- type: auth
args: ""
- type: session
args: auto_start
pamd:
name: login
state: before
type: "{{item.type}}"
control: include
module_path: postlogin
new_type: "-{{item.type}}"
new_control: optional
new_module_path: pam_gnome_keyring.so
module_arguments: "{{item.args}}"
- name: create wifi networks
become: true
loop:
- ssid: KEVINSAM_5
zone: home
- ssid: KEVINSAM
zone: home
- ssid: askKevin
zone: work
community.general.nmcli:
state: present
type: wifi
zone: "{{ item.zone }}"
conn_name: "{{ item.ssid }}"
ssid: "{{ item.ssid }}"
autoconnect: true
wifi:
hidden: true
wifi_sec:
key-mgmt: wpa-psk
psk: "not really the key"
- name: create tailscale firewall zone
become: true
shell: |
firewall-cmd --permanent --new-zone=tailscale
firewall-cmd --permanent --zone=tailscale --add-interface=tailscale0
firewall-cmd --permanent --zone=tailscale --add-forward
firewall-cmd --permanent --zone=tailscale --set-target=ACCEPT
firewall-cmd --reload
- name: other firewall rules
become: true
shell: |
firewall-cmd --permanent --zone public --remove-service ssh
firewall-cmd --permanent --zone public --add-service kdeconnect
firewall-cmd --permanent --zone home --add-service=kdeconnect --add-service=mosh --add-service=ssh
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
become: true
file:
state: directory
path: /home/myself
group: myself
owner: kevins
mode: '2770'
- name: check if HOME.git is cloned
become: true
become_user: kevins
register: home_repo
stat:
path: /home/myself/HOME.git/HEAD
- name: "clone HOME.git"
become: true
become_user: kevins
when: not home_repo.stat.exists
shell: |
mkdir -p /home/myself/HOME.git
cd /home/myself/HOME.git
git init --bare .
git remote add \
origin \
-t stable \
-m stable \
git@github.com:kevinnlsamuel/HOME.git
git fetch --set-upstream origin stable
- name: clone HOME to my selves
vars:
src: /home/myself/HOME.git
dest: "/home/{{item}}/.local/state/HOME"
with_items:
- kevins
- kevinsamuel
- kevinnlsamuel
become_user: "{{item}}"
become: true
failed_when:
- result.rc != 140
- result.rc != 0
changed_when: "result.rc != 140"
register: result
shell: |
mkdir -p "{{dest}}"
cd "{{dest}}"
if [ -f ".git/HEAD" ]; then exit 140 2>/dev/null; fi
git init -b main
git config --add safe.directory "{{src}}"
git remote add myself "{{src}}"
git pull myself main
# manually install:
# - sieve
@@ -0,0 +1,2 @@
collections:
- name: community.general
+27
View File
@@ -0,0 +1,27 @@
$ANSIBLE_VAULT;1.1;AES256
38333432336134663937363161333833373365386635613338333761346662653566333439363132
3437393431643233393133643133313963323134626465630a666565653234626630373837343933
64633966303761333539633335393234396264616266323439303932623535396335663839323363
3861643566303563610a333166363032636462353836303365333634643639353934386233353438
31373664386332613637626663633030313232383435303966643835346536313737393030623038
36616465653563366138633334343665363131313361343836383132346334306330636138666666
35636631646431393130376232663665343736313466626235623032636462316438656238656463
35396465643936613935646237373837373037333561393133633033303038373565386236336339
36636666623835343662346461643735646237653236386132623334653734633431313735363765
64323839663765326336336263323535373663323232323336386464623734373433353135393566
30663130656336653832653862383464363261323831346632306539613139646632306133666132
38363066666563383436316537626439313134363365326333623633383138346134356232646664
31333834323138366635613933616363363131643330353166383234333236343833343432656163
33663963333039303737386431396337636665633532373336383762363966343139346335353463
33383632343630343134333062326138383562636666396336313530363939333965626130303332
35306238663633613130616138613137393331343862666664613539346237616537376166303130
62393633613666613235633736666361653764356161396532306135343162316262386136386538
32353861633362323166616263656633346531336633323064336162323630343532323139366166
64316130633436303230353133623036656337316232323538316562663663326438383736313261
63633766326638363939346531643836616561366365326236393031643633633836353837613963
35333532393435313435333935353935656631386264626535303265353732653832613935623238
33643765633939343730636165313737393037343337653230313637306365303539636233643839
35613463386439323965613763396535383730383431666437393338336562663035653461613035
64346465313532373938383833343334666563333362643961626138653664623337383964383463
64343031373534346161386134663933626335326337386634666133343533626662646136623134
3536656133663039353436666339323437323162633139613632
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
set -e
pass encryptions/com.kevinnlsamuel/playbooks/setup-workstations/secrets
-38
View File
@@ -1,38 +0,0 @@
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).
@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for .
@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for .
-3
View File
@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for .
-3
View File
@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
localhost
-6
View File
@@ -1,6 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- .
-3
View File
@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for .
+6
View File
@@ -0,0 +1,6 @@
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
@@ -0,0 +1,6 @@
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
@@ -0,0 +1,28 @@
- 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) }}"
@@ -0,0 +1,6 @@
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.
@@ -0,0 +1,18 @@
- 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 }}"
+35
View File
@@ -0,0 +1,35 @@
#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.
+48
View File
@@ -0,0 +1,48 @@
- name: get list of disks
changed_when: false
shell: >
lsblk
--json
--paths
--filter 'MIN == 0 && TYPE == "disk" && MOUNTPOINT != "[SWAP]"'
| jq '.blockdevices'
register: disks
- name: backup partition tables
become: true
shell: |
if [ {{ item.type }} != disk ]; then exit 0; fi
sfdisk --dump {{ item.name }} >{{ backup_directory }}/disks/{{ item.name | basename }}.sfdisk
loop: "{{ disks.stdout }}"
- name: get list of luks devices
changed_when: false
shell: >
lsblk
--json
--paths
| jq '[ .blockdevices[]|.children[]?|select(recurse(.children[]?)|.type == "crypt") ]'
register: cryptdisks
- name: backup luks2 headers
become: true
loop: "{{ cryptdisks.stdout }}"
shell: |
rm -f {{ backup_directory }}/disks/{{ item.children[0].name | basename }}.luks2header
cryptsetup luksHeaderBackup {{ item.name }} \
--header-backup-file {{ backup_directory }}/disks/{{ item.children[0].name | basename }}.luks2header
- name: backup lvm volume groups
become: true
shell: |
if [ ! -d /etc/lvm/backup ]; then exit 0; fi
for vg in /etc/lvm/backup/*; do
cp $vg {{backup_directory}}/disks/${vg##*/}.volumegroup
done
# get list of disks
# run sfdisk on it
# get list of partitions with luks2
# # backup their headers
# get list of partitions with lvm2
# # copy the metadata
+6
View File
@@ -0,0 +1,6 @@
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
@@ -0,0 +1,28 @@
- 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
@@ -0,0 +1,6 @@
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.
+6
View File
@@ -0,0 +1,6 @@
- name: register greeting
command: echo hello
register: greeting
- name: say greeting
debug:
msg: "{{ greeting.stdout }}"
+6
View File
@@ -0,0 +1,6 @@
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
@@ -0,0 +1,8 @@
- 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
@@ -0,0 +1,7 @@
[{{ 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
@@ -0,0 +1,16 @@
- 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
@@ -0,0 +1,5 @@
---
- name: restart sshd
service:
name: sshd
state: restarted
+1
View File
@@ -0,0 +1 @@
/home/kevins/Projects/galaxy/roles/sshd/_handlers
+16
View File
@@ -0,0 +1,16 @@
---
- 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 }}
@@ -0,0 +1 @@
Port {{ alt_ssh_port }}
@@ -0,0 +1 @@
PasswordAuthentication no
+1
View File
@@ -0,0 +1 @@
/home/kevins/Projects/galaxy/roles/sshd/_handlers
+5
View File
@@ -0,0 +1,5 @@
- name: disable password auth
notify: restart sshd
copy:
src: 00-nopasswd.conf
dest: /etc/ssh/sshd_config.d/00-nopasswd.conf
+4
View File
@@ -0,0 +1,4 @@
- name: store facts
template:
src: facts.jinja2
dest: "{{ backup_directory }}/ansible_facts.json"
+1
View File
@@ -0,0 +1 @@
{{ ansible_facts | to_nice_json }}
+35
View File
@@ -0,0 +1,35 @@
#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
@@ -0,0 +1,8 @@
- 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'