Initialer Import der Synology Scripts

This commit is contained in:
root
2026-08-05 08:43:57 +02:00
commit 5e32a7c411
404 changed files with 79932 additions and 0 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
- name: samba
package:
name: samba
state: present
BIN
View File
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
- name: Install Apache Webserver
package:
name: "apache2"
update_cache: yes
state: present
BIN
View File
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
# roles/SERVER_TYP_03/tasks/main.yml
- name: Install Notepad++
import_tasks: npp.yaml
- name: Install VLC
import_tasks: vlc.yaml
- name: Ping erlauben
import_tasks: ping.yml
+16
View File
@@ -0,0 +1,16 @@
- name: Download NPP
ansible.windows.win_get_url:
url: https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.9/npp.8.9.Installer.exe
dest: C:\Windows\Temp\npp.exe
force: yes
- name: Install Notepad++ silent
ansible.windows.win_shell: |
Start-Process "C:\Windows\Temp\npp.exe" -ArgumentList "/S" -Wait
args:
creates: C:\Program Files\Notepad++\notepad++.exe
- name: Delete installer
ansible.windows.win_file:
path: C:\Windows\Temp\npp.exe
state: absent
+11
View File
@@ -0,0 +1,11 @@
- name: Allow Ping IN IPv4
win_firewall_rule:
name: "Allow Incoming ICMPv4 Echo Request (Ping)"
enabled: no
state: present
profiles: "domain,private,public"
action: allow
direction: in
protocol: icmpv4
icmp_type:code:
- '8:*'
+14
View File
@@ -0,0 +1,14 @@
- name: Download VLC
win_get_url:
url: "https://www.vlc.de/download/vlc/msi/vlc-3.0.4-win64.msi"
dest: "C:\\Windows\\Temp\\vlc.msi"
- name: Install VLC
win_package:
path: "C:\\Windows\\Temp\\vlc.msi"
state: present
- name: Remove VLC
win_file:
path: "C:\\Windows\\Temp\\vlc.msi"
state: absent
+67
View File
@@ -0,0 +1,67 @@
- name: Skip wenn Zertifikat deaktiviert
meta: end_host
when: not (cert.enabled | default(false))
- name: Prüfe Profil
fail:
msg: "Kein Zertifikatsprofil definiert auf {{ inventory_hostname }}"
when: cert.profile is not defined
- name: Lade Profildefinition
set_fact:
cert_cfg: "{{ cert_profiles[cert.profile] }}"
- name: Zielpfad setzen
set_fact:
cert_path: "{{ cert_base_path }}/{{ inventory_hostname }}"
- name: Verzeichnisse erstellen
file:
path: "{{ cert_path }}/{{ item }}"
state: directory
mode: '0755'
loop:
- KEY
- CSR
- CERT
- name: Installiere cryptography Abhängigkeit
apt:
name:
- python3-cryptography
- python3-pip
state: present
update_cache: true
become: true
ignore_errors: true
- name: Private Key erzeugen
community.crypto.openssl_privatekey:
path: "{{ cert_path }}/KEY/{{ inventory_hostname }}.key"
size: "{{ cert_cfg.key_size }}"
type: RSA
- name: FQDN bestimmen
set_fact:
cert_fqdn: >-
{{
ansible_facts['fqdn']
| default(ansible_facts['hostname'])
| default(inventory_hostname ~ '.local')
}}
- name: SAN bauen (DNS + IP)
set_fact:
san_list: >-
{{
['DNS:' ~ cert_fqdn]
+ ([ 'IP:' ~ ansible_host ] if ansible_host is defined else [])
}}
- name: CSR erzeugen (dynamisch)
community.crypto.openssl_csr:
path: "{{ cert_path }}/CSR/{{ inventory_hostname }}.csr"
privatekey_path: "{{ cert_path }}/KEY/{{ inventory_hostname }}.key"
common_name: "{{ cert_fqdn }}"
subject_alt_name: "{{ san_list }}"
+4
View File
@@ -0,0 +1,4 @@
---
- hosts: SERVER_TYP_03
roles:
- SERVER_TYP_03
+15
View File
@@ -0,0 +1,15 @@
---
- hosts: SERVER_TYP_01
become: true
roles:
- SERVER_TYP_01
- hosts: SERVER_TYP_02
become: false
roles:
- SERVER_TYP_02
- hosts: SERVER_TYP_03
roles:
- SERVER_TYP_03
- import_playbook: certificate.yaml