1
0
mirror of https://github.com/gjkcz/ansible-void.git synced 2024-12-22 19:26:38 +01:00

Create role for SSH

This commit is contained in:
Emil Miler 2024-12-04 11:04:12 +01:00
parent 9a0892c9b4
commit 78f53019c5
4 changed files with 26 additions and 29 deletions

View File

@ -3,10 +3,6 @@ timeout_blank: 1800
timeout_lock: 30 timeout_lock: 30
grub_timeout: 10 grub_timeout: 10
ssh_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEm981GRiUIsp8e4bTDv+d9SyHfQ8P18W5oovgmAfnip em@x210
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqmyaaIqRU9hx8PxRnIqe/pRANIxrEEscuMWrHZF1yh snowflake@flakeX230
xbps_install: xbps_install:
# General # General
- htop - htop

View File

@ -0,0 +1,3 @@
ssh_user: root
ssh_dir: /root/.ssh
ssh_keys: []

14
roles/ssh/tasks/main.yaml Normal file
View File

@ -0,0 +1,14 @@
- name: Ensure SSH directory exists
file:
path: "{{ ssh_dir }}"
state: directory
owner: "{{ ssh_user }}"
group: "{{ ssh_user }}"
mode: 0700
- name: Import SSH keys
authorized_key:
user: "{{ ssh_user }}"
key: "{{ item }}"
state: present
loop: "{{ ssh_keys }}"

View File

@ -2,19 +2,12 @@
- name: SSH - name: SSH
hosts: all hosts: all
tags: ssh tags: ssh
roles:
tasks: - role: ssh
- name: Ensure root ssh directory exists vars:
file: ssh_keys:
path: /root/.ssh - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEm981GRiUIsp8e4bTDv+d9SyHfQ8P18W5oovgmAfnip em@x210
state: directory - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqmyaaIqRU9hx8PxRnIqe/pRANIxrEEscuMWrHZF1yh snowflake@flakeX230
- name: Import SSH keys
authorized_key:
user: root
key: '{{ item }}'
state: present
loop: '{{ ssh_keys }}'
- name: General - name: General
@ -273,18 +266,9 @@
loop: loop:
- "files/firefox/uBlock0@raymondhill.net.xpi" - "files/firefox/uBlock0@raymondhill.net.xpi"
- name: Bakaláři - name: Bakaláři
hosts: teachers hosts: teachers
tags: bakalari
tasks: tasks:
- name: Create a desktop shortcut for Bakaláři - name: Bakaláři
copy: include_role:
src: "{{ item.src }}" name: bakalari
dest: "{{ item.dest }}"
loop:
- src: "files/bakalari/bakalari.desktop"
dest: "/usr/share/applications/bakalari.desktop"
- src: "files/bakalari/bakalari.png"
dest: "/usr/share/icons/bakalari.png"