diff --git a/deploy.yaml b/deploy.yaml new file mode 100644 index 0000000..67f3518 --- /dev/null +++ b/deploy.yaml @@ -0,0 +1,5 @@ +--- +- name: Ensure base config is deployment on all hosts + hosts: all + roles: + - base_config diff --git a/inventories/eh22/hosts.yaml b/inventories/eh22/hosts.yaml new file mode 100644 index 0000000..985309e --- /dev/null +++ b/inventories/eh22/hosts.yaml @@ -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 diff --git a/roles/base_config/meta/main.yaml b/roles/base_config/meta/main.yaml new file mode 100644 index 0000000..487a783 --- /dev/null +++ b/roles/base_config/meta/main.yaml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: deploy_systemd_journal_config diff --git a/roles/deploy_systemd_journal_config/files/10-ccchh.conf b/roles/deploy_systemd_journal_config/files/10-ccchh.conf new file mode 100644 index 0000000..3419fd9 --- /dev/null +++ b/roles/deploy_systemd_journal_config/files/10-ccchh.conf @@ -0,0 +1,3 @@ +[Journal] +MaxFileSec=2day +MaxRetentionSec=2week diff --git a/roles/deploy_systemd_journal_config/handlers/main.yaml b/roles/deploy_systemd_journal_config/handlers/main.yaml new file mode 100644 index 0000000..685f2ce --- /dev/null +++ b/roles/deploy_systemd_journal_config/handlers/main.yaml @@ -0,0 +1,5 @@ +- name: Restart `systemd-journald.service` + ansible.builtin.systemd: + name: systemd-journald.service + state: restarted + become: true diff --git a/roles/deploy_systemd_journal_config/tasks/main.yaml b/roles/deploy_systemd_journal_config/tasks/main.yaml new file mode 100644 index 0000000..1161a33 --- /dev/null +++ b/roles/deploy_systemd_journal_config/tasks/main.yaml @@ -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`