first ansible structure with dhcp and resolv-dns hosts

This commit is contained in:
June 2025-04-17 20:21:21 +02:00
parent 68d3466f24
commit 6e59cf386a
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
6 changed files with 42 additions and 0 deletions
deploy.yaml
inventories/eh22
roles
base_config/meta
deploy_systemd_journal_config

5
deploy.yaml Normal file
View file

@ -0,0 +1,5 @@
---
- name: Ensure base config is deployment on all hosts
hosts: all
roles:
- base_config

View file

@ -0,0 +1,8 @@
all:
hosts:
dhcp:
ansible_host: 94.45.255.70
ansible_user: noc
resolv-dns:
ansible_host: 94.45.254.2
ansible_user: noc

View file

@ -0,0 +1,3 @@
---
dependencies:
- role: deploy_systemd_journal_config

View file

@ -0,0 +1,3 @@
[Journal]
MaxFileSec=2day
MaxRetentionSec=2week

View file

@ -0,0 +1,5 @@
- name: Restart `systemd-journald.service`
ansible.builtin.systemd:
name: systemd-journald.service
state: restarted
become: true

View file

@ -0,0 +1,18 @@
- name: Create 'journald.conf.d' directory if it does not exist
ansible.builtin.file:
path: "/etc/systemd/journald.conf.d"
state: directory
mode: '0644'
owner: root
group: root
become: true
- name: make sure the custom configuration file is deployed
ansible.builtin.copy:
src: "10-ccchh.conf"
dest: "/etc/systemd/journald.conf.d/10-ccchh.conf"
mode: "0644"
owner: root
group: root
become: true
notify: Restart `systemd-journald.service`