This commit is contained in:
2025-01-21 16:53:58 +01:00
parent c9cee6deae
commit 5fe32c6473
25 changed files with 717 additions and 573 deletions

View File

@ -0,0 +1,47 @@
---
- name: re-synchronize the package index files from their sources
raw: apt-get update
- name: Ensure aptitude is present
raw: test -e /usr/bin/aptitude || apt-get install aptitude -y
- name: Ensure python3 is present (This is necessary for ansible to work properly)
raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3)
- name: Ensure python-is-python3 is present (This is necessary for ansible to work properly)
raw: test -e /usr/bin/python3 && (apt -y update && apt install -y python-is-python3)
- name: Ensure python-apt-common is present (This is necessary for ansible to work properly)
raw: test -e /usr/bin/python && (apt -y update && apt install -y python-apt-common)
- name: Ensure python-apt is present (This is necessary for ansible to work properly)
raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3-apt)
- name: dpkg --configure -a
command: >
dpkg --configure -a
args:
warn: false
changed_when: _dpkg_configure.stdout_lines | length
register: _dpkg_configure
when: apt_dpkg_configure|bool
tags:
- ansible-dependencies
- name: apt upgrade
apt:
upgrade: "{{ apt_upgrade_type }}"
update_cache: true
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
when: apt_upgrade|bool
tags:
- ansible-dependencies
- name: apt install ansible dependencies
apt:
name: "{{ apt_ansible_dependencies }}"
state: "{{ apt_install_state }}"
tags:
- ansible-dependencies

View File

@ -36,7 +36,7 @@ radiotrabajandoparacristoirmp\.com$
group-hire\.com$
# Erinnerung: Überzahlung entdeckt Ihre Rückerstattung wartet!
mtasv\.net$
#mtasv\.net$
# edge.toprains.shop:w
edge\.toprains\.shop$

View File

@ -28,7 +28,7 @@
45.132.181.0/24
# Erinnerung: Überzahlung entdeckt Ihre Rückerstattung wartet!
50.31.205.0/24
#50.31.205.0/24
# edge.toprains.shop
51.89.16.112

View File

@ -135,6 +135,16 @@
tags:
- apt-initial-install
- name: (apt.yml) Initial install ubuntu packages (noble)
apt:
name: "{{ apt_initial_install_ubuntu_noble }}"
state: "{{ apt_install_state }}"
when:
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_release'] == "noble"
tags:
- apt-initial-install
# ---
# Microcode

View File

@ -1,5 +1,9 @@
---
- import_tasks: show.yml
tags:
- show
# tags supported inside basic.yml
#
# timezone

View File

@ -9,10 +9,17 @@
path: /etc/motd.ORIG
register: motd_orig_exist
- name: (motd.yml) Check if /etc/motd exist
stat:
path: /etc/motd
register: motd_exist
- name: (motd.yml) Backup existing file /etc/motd
command: cp -a /etc/motd /etc/motd.ORIG
when: motd_orig_exist.stat.exists == False
when:
- motd_exist.stat.exists == True
- motd_orig_exist.stat.exists == False
- name: (motd.yml) create /etc/motd
shell: figlet {{ ansible_hostname }} > /etc/motd

View File

@ -0,0 +1,7 @@
---
- name: Show hostname
debug:
msg: "Host: {{ ansible_fqdn | split('.') | first }} FQDN: {{ ansible_fqdn.split('.')[0] }}.{{ ansible_fqdn.split('.')[1] | default('NONE') }}.{{ ansible_fqdn.split('.')[2] | default('NONE') }}"
# msg: "Host: {{ ansible_fqdn | split('.') | first }} FQDN: {{ ansible_fqdn.split('.')[0] | join( '.') }} | {{ join ( ansible_fqdn.split('.')[1] ) }}"

View File

@ -1,7 +1,7 @@
---
munin_remote_ipv4: 95.217.64.122
munin_remote_ipv6: 2a01:4f9:4a:2b57::122
munin_remote_ipv4: 37.27.121.227
munin_remote_ipv6: 2a01:4f9:3070:2bda::227
is_dns_server: false

View File

@ -7,14 +7,8 @@
service:
name: ipt-firewall
state: restarted
when:
- interfaces_ipv4_exists.stat.exists
- main_ipv4_exists.stat.exists
- name: Restart IPv6 Firewall
service:
name: ip6t-firewall
state: restarted
when:
- interfaces_ipv6_exists.stat.exists
- main_ipv6_exists.stat.exists

View File

@ -0,0 +1,49 @@
---
- name: show
import_role:
name: common
tasks_from: show.yml
- name: basic
import_role:
name: common
tasks_from: basic.yml
- name: apt
import_role:
name: common
tasks_from: apt.yml
- name: motd
import_role:
name: common
tasks_from: motd.yml
- name: users
import_role:
name: common
tasks_from: users.yml
tags:
- users
- name: users-systemfiles
import_role:
name: common
tasks_from: users-systemfiles
tags:
- users
- users-systemfiles
- name: sshd
import_role:
name: common
tasks_from: sshd.yml
- name: sudoers
import_role:
name: common
tasks_from: sudoers.yml
tags: sudoers