first ansible structure with dhcp and resolv-dns hosts
This commit is contained in:
parent
68d3466f24
commit
6e59cf386a
6 changed files with 42 additions and 0 deletions
5
deploy.yaml
Normal file
5
deploy.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Ensure base config is deployment on all hosts
|
||||
hosts: all
|
||||
roles:
|
||||
- base_config
|
8
inventories/eh22/hosts.yaml
Normal file
8
inventories/eh22/hosts.yaml
Normal 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
|
3
roles/base_config/meta/main.yaml
Normal file
3
roles/base_config/meta/main.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: deploy_systemd_journal_config
|
3
roles/deploy_systemd_journal_config/files/10-ccchh.conf
Normal file
3
roles/deploy_systemd_journal_config/files/10-ccchh.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
[Journal]
|
||||
MaxFileSec=2day
|
||||
MaxRetentionSec=2week
|
5
roles/deploy_systemd_journal_config/handlers/main.yaml
Normal file
5
roles/deploy_systemd_journal_config/handlers/main.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: Restart `systemd-journald.service`
|
||||
ansible.builtin.systemd:
|
||||
name: systemd-journald.service
|
||||
state: restarted
|
||||
become: true
|
18
roles/deploy_systemd_journal_config/tasks/main.yaml
Normal file
18
roles/deploy_systemd_journal_config/tasks/main.yaml
Normal 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`
|
Loading…
Add table
Add a link
Reference in a new issue