refactor ansible scripts for contabo vps
This commit is contained in:
parent
6dad4a33a1
commit
ff738fdd8f
6 changed files with 28 additions and 7 deletions
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"ansible.python.interpreterPath": "/opt/homebrew/anaconda3/bin/python"
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
[almalinux-root]
|
[almalinux-root]
|
||||||
vps-root
|
; vps-root
|
||||||
|
janvoelkelde-root
|
||||||
|
|
||||||
|
|
||||||
[almalinux-user]
|
[almalinux-user]
|
||||||
vps
|
; vps
|
||||||
|
janvoelkelde
|
||||||
|
|
||||||
[all:vars]
|
[all:vars]
|
||||||
user_name="jan"
|
user_name="jan"
|
||||||
domain="janvoelkel-de"
|
domain="janvoelkel-de"
|
||||||
op_password_path="SSH/MyVPS jan/password"
|
op_password_path="SSH/VPS janvoelkel.de jan/password"
|
||||||
dnf_text_editor="nano"
|
dnf_text_editor="nano"
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
prompt: "Please enter the password for the new user"
|
prompt: "Please enter the password for the new user"
|
||||||
private: yes # Das Passwort wird versteckt eingegeben
|
private: yes # Das Passwort wird versteckt eingegeben
|
||||||
- name: "ssh_public_key"
|
- name: "ssh_public_key"
|
||||||
prompt: "Please enter the public key for shh of your pc"
|
prompt: "Please enter the public key for ssh of your pc"
|
||||||
private: no
|
private: no
|
||||||
roles:
|
roles:
|
||||||
- create_user_with_root
|
- create_user_with_root
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
- name: Erstelle einen neuen User mit Sudo-Rechten
|
- name: Erstelle einen neuen User mit Sudo-Rechten
|
||||||
user:
|
user:
|
||||||
name: "{{ user_name }}"
|
name: "{{ user_name }}"
|
||||||
password: "{{ lookup('pipe', 'op read \"op://' + op_password_path + '\"') | password_hash('sha512') }}"
|
password: "{{ lookup('pipe', 'op read \"op://' + op_password_path + '\"') }}"
|
||||||
state: present
|
state: present
|
||||||
shell: /bin/bash
|
shell: /bin/bash
|
||||||
groups: wheel
|
groups: wheel
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,9 @@
|
||||||
- name: Install DNF tools
|
- name: Install DNF tools
|
||||||
dnf:
|
dnf:
|
||||||
name: "{{ dnf_text_editor }}"
|
name: "{{ dnf_text_editor }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Install Git
|
||||||
|
dnf:
|
||||||
|
name: git
|
||||||
|
state: present
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,14 @@
|
||||||
zone: public
|
zone: public
|
||||||
service: ssh
|
service: ssh
|
||||||
permanent: yes
|
permanent: yes
|
||||||
state: enabled
|
state: enabled
|
||||||
|
|
||||||
|
- name: Add Tailscale interface to trusted zone
|
||||||
|
firewalld:
|
||||||
|
zone: trusted
|
||||||
|
interface: tailscale0
|
||||||
|
permanent: yes
|
||||||
|
state: enabled
|
||||||
|
|
||||||
|
- name: Reload firewalld
|
||||||
|
command: firewall-cmd --reload
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue