mirror of
https://github.com/gjkcz/ansible-void.git
synced 2024-12-22 11:16:39 +01:00
Create role for SSH
This commit is contained in:
parent
9a0892c9b4
commit
78f53019c5
@ -3,10 +3,6 @@ timeout_blank: 1800
|
||||
timeout_lock: 30
|
||||
grub_timeout: 10
|
||||
|
||||
ssh_keys:
|
||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEm981GRiUIsp8e4bTDv+d9SyHfQ8P18W5oovgmAfnip em@x210
|
||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqmyaaIqRU9hx8PxRnIqe/pRANIxrEEscuMWrHZF1yh snowflake@flakeX230
|
||||
|
||||
xbps_install:
|
||||
# General
|
||||
- htop
|
||||
|
3
roles/ssh/defaults/main.yaml
Normal file
3
roles/ssh/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
ssh_user: root
|
||||
ssh_dir: /root/.ssh
|
||||
ssh_keys: []
|
14
roles/ssh/tasks/main.yaml
Normal file
14
roles/ssh/tasks/main.yaml
Normal 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 }}"
|
34
setup.yaml
34
setup.yaml
@ -2,19 +2,12 @@
|
||||
- name: SSH
|
||||
hosts: all
|
||||
tags: ssh
|
||||
|
||||
tasks:
|
||||
- name: Ensure root ssh directory exists
|
||||
file:
|
||||
path: /root/.ssh
|
||||
state: directory
|
||||
|
||||
- name: Import SSH keys
|
||||
authorized_key:
|
||||
user: root
|
||||
key: '{{ item }}'
|
||||
state: present
|
||||
loop: '{{ ssh_keys }}'
|
||||
roles:
|
||||
- role: ssh
|
||||
vars:
|
||||
ssh_keys:
|
||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEm981GRiUIsp8e4bTDv+d9SyHfQ8P18W5oovgmAfnip em@x210
|
||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqmyaaIqRU9hx8PxRnIqe/pRANIxrEEscuMWrHZF1yh snowflake@flakeX230
|
||||
|
||||
|
||||
- name: General
|
||||
@ -273,18 +266,9 @@
|
||||
loop:
|
||||
- "files/firefox/uBlock0@raymondhill.net.xpi"
|
||||
|
||||
|
||||
- name: Bakaláři
|
||||
hosts: teachers
|
||||
tags: bakalari
|
||||
|
||||
tasks:
|
||||
- name: Create a desktop shortcut for Bakaláři
|
||||
copy:
|
||||
src: "{{ item.src }}"
|
||||
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"
|
||||
- name: Bakaláři
|
||||
include_role:
|
||||
name: bakalari
|
||||
|
Loading…
Reference in New Issue
Block a user