Compare commits

..

3 Commits

4 changed files with 42 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
--- ---
# vars file # vars file
custom_vars: custom_vars:
generality: shared:
ssh_authorized_keys: ssh_authorized_keys:
- sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIO0sbFLwfgSWpWwn4cy4cddKvV74efUMZVYTTjX2vnjAAAABHNzaDo= rika@hikiki - sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIIO0sbFLwfgSWpWwn4cy4cddKvV74efUMZVYTTjX2vnjAAAABHNzaDo= rika@hikiki
- sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHJqHHMplgqm8yiq4Qwisk67p9+f9sLM8tIAzuw2qkwpAAAABHNzaDo= rika@hikiki - sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHJqHHMplgqm8yiq4Qwisk67p9+f9sLM8tIAzuw2qkwpAAAABHNzaDo= rika@hikiki
@@ -56,6 +56,7 @@ groups:
remote: remote:
group_name: remote group_name: remote
type: system type: system
id: ~
users: users:
# @NOTE key/field names MUST match value of 'username' key or field of its object # @NOTE key/field names MUST match value of 'username' key or field of its object
senpai: senpai:
@@ -81,8 +82,8 @@ users:
- sudo - sudo
- "{{ groups.remote.group_name }}" - "{{ groups.remote.group_name }}"
services: [sshd] services: [sshd]
ssh_authorized_keys: "{{ custom_vars.generality.ssh_authorized_keys }}" ssh_authorized_keys: "{{ custom_vars['shared']['ssh_authorized_keys'] }}"
ssh_private_key_paths: "{{ custom_vars.generality.ssh_private_key_paths }}" ssh_private_key_paths: "{{ custom_vars['shared']['ssh_private_key_paths'] }}"
ssh_private_key_path_pref: 0 ssh_private_key_path_pref: 0
gpg_keys: gpg_keys:
- id: 558041D5CF2AB23B # @NOTE professional - id: 558041D5CF2AB23B # @NOTE professional
@@ -128,8 +129,8 @@ users:
groups: groups:
- "{{ groups.remote.group_name }}" - "{{ groups.remote.group_name }}"
services: [proftpd,sftp,ftps] services: [proftpd,sftp,ftps]
ssh_authorized_keys: "{{ custom_vars.generality.ssh_authorized_keys }}" ssh_authorized_keys: "{{ custom_vars['shared']['ssh_authorized_keys'] }}"
ssh_private_key_paths: "{{ custom_vars.generality.ssh_private_key_paths }}" ssh_private_key_paths: "{{ custom_vars['shared']['ssh_private_key_paths'] }}"
ssh_private_key_path_pref: 0 ssh_private_key_path_pref: 0
gpg_keys: [] gpg_keys: []
gpg_keyid_pref: 0 gpg_keyid_pref: 0

6
init_env Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
SKATO_ANSIBLE_ROOT=$(dirname "$0")
set -o allexport
source "${SKATO_ANSIBLE_ROOT}/standard_paths"
set +o allexport

View File

@@ -13,7 +13,7 @@
private_ip: true private_ip: true
region: "{{ vps_service.region }}" region: "{{ vps_service.region }}"
root_pass: "{{ vps_service.password }}" root_pass: "{{ vps_service.password }}"
tags: "{{ hostvars[inventory_hostname].keywords }}" tags: "{{ keywords }}"
state: "{{ 'present' if vps_service.exists else 'absent' }}" state: "{{ 'present' if vps_service.exists else 'absent' }}"
tags: tags:
- vps_step - vps_step

28
standard_paths Normal file
View File

@@ -0,0 +1,28 @@
# SKATO_ANSIBLE_ROOT=
# Relative directory paths for role templates/files
SKANSIBLE_ARIA="aria2"
SKANSIBLE_PROFTPD="proftpd"
SKANSIBLE_PROFTPD_CONFS="${SKANSIBLE_PROFTPD}/conf.d"
# @NOTE below 4 filepaths have filenames that must correspond to
# the filenames in role ProFTPd templates'/files' Display settings
SKANSIBLE_PROFTPD_CONFS_WELCOME="${SKANSIBLE_PROFTPD}/conf.d/WELCOME.txt"
SKANSIBLE_PROFTPD_CONFS_BANNER="${SKANSIBLE_PROFTPD}/conf.d/BANNER.txt"
SKANSIBLE_PROFTPD_CONFS_SUCCESS="${SKANSIBLE_PROFTPD}/conf.d/SUCCESS.txt"
SKANSIBLE_PROFTPD_CONFS_EXIT="${SKANSIBLE_PROFTPD}/conf.d/BYE.txt"
SKANSIBLE_SSHD_CONFS="sshd_config.d"
SKANSIBLE_SYSTEMD="systemd"
SKANSIBLE_SYSTEMD_USER_UNITS="${SKANSIBLE_SYSTEMD}/user"
SKANSIBLE_FAIL2BAN="fail2ban"
SKANSIBLE_FAIL2BAN_JAILS="${SKANSIBLE_FAIL2BAN}/jail.d"
SKANSIBLE_FAIL2BAN_FILTERS="${SKANSIBLE_FAIL2BAN}/filter.d"
SKANSIBLE_GITCONFIG_CONFS="gitconfig.d"
# @NOTE files in here must have extension "key" with IDs in
# "gpg_keys" inventory variable list as basenames.
SKANSIBLE_GPG="gnupg"
# @NOTE files in path below must have extensions "key" (private),
# "crt" (signed), or "pem" (public) with inventory host FQDN as basename
SKANSIBLE_SSL="ca-certificates"
# Other directories
SKANSIBLE_SECRETS="${SKATO_ANSIBLE_ROOT}/.secrets"