Skip to content

Commit

Permalink
rui.hayaworld.localに依存するtasksのLint結果を反映
Browse files Browse the repository at this point in the history
  • Loading branch information
cradle8810 committed Apr 23, 2024
1 parent 72b6c13 commit dd4ba90
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
29 changes: 21 additions & 8 deletions rui.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: rui
- name: Play for rui.hayaworld.local
hosts: rui
remote_user: hayato
gather_facts: false
become: true
Expand All @@ -13,7 +14,9 @@
- inventories/host_vars/hosts_hayaworld.yml

handlers:
- import_tasks: handlers/main.yml
- name: Restart handler tasks
ansible.builtin.import_tasks:
file: handlers/main.yml

tasks:
- name: Set Hostname
Expand All @@ -22,9 +25,11 @@
tags:
- network

- import_tasks: tasks/authorized_keys.yml
- name: Put authorized Key
ansible.builtin.import_tasks:
file: tasks/authorized_keys.yml

- name: put motd
- name: Put motd
ansible.builtin.copy:
src: templates/rui/etc/motd
dest: /etc/motd
Expand All @@ -45,15 +50,23 @@
- system

- name: Show hosts(5)
debug:
ansible.builtin.debug:
msg: "{{ lookup('template', './templates/rui/etc/hosts.j2') }}"
tags:
- debug
- dryrun

- import_tasks: tasks/rui/dnsmasq.yml
- import_tasks: tasks/rui/journalctl.yml
- import_tasks: tasks/rui/rsyslog-rui.yml
- name: Setup dnsmask
ansible.builtin.import_tasks:
file: tasks/rui/dnsmasq.yml

- name: Setup journalctl
ansible.builtin.import_tasks:
file: tasks/rui/journalctl.yml

- name: Setup rsyslog
ansible.builtin.import_tasks:
file: tasks/rui/rsyslog-rui.yml
tags:
- rsyslog
- dnsmasq
16 changes: 11 additions & 5 deletions tasks/rui/dnsmasq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
dest: /etc/dnsmasq.conf
owner: root
group: root
mode: '0644'
notify: "Restart dnsmasq"
tags:
- dnsmasq

- name: Show dnsmasq.conf
debug:
ansible.builtin.debug:
msg: "{{ lookup('template', './templates/rui/etc/dnsmasq.conf.j2') }}"
tags:
- debug
Expand All @@ -22,12 +23,13 @@
dest: /etc/dnsmasq.d/resolv.txt
owner: root
group: root
mode: '0644'
notify: "Restart dnsmasq"
tags:
- dnsmasq

- name: Show dnsmasq.resolv.txt
debug:
ansible.builtin.debug:
msg: "{{ lookup('template', './templates/rui/etc/dnsmasq.d/resolv.txt.j2') }}"
tags:
- debug
Expand All @@ -39,12 +41,13 @@
dest: /etc/dnsmasq.d/dhcp_static.conf
owner: root
group: root
mode: '0644'
notify: "Restart dnsmasq"
tags:
- dnsmasq

- name: Show static DHCP config
debug:
ansible.builtin.debug:
msg: "{{ lookup('template', './templates/rui/etc/dnsmasq.d/dhcp_static.conf.j2') }}"
tags:
- debug
Expand All @@ -56,12 +59,13 @@
dest: /etc/dnsmasq.d/cname.conf
owner: root
group: root
mode: '0644'
notify: "Restart dnsmasq"
tags:
- dnsmasq

- name: Show cname config
debug:
ansible.builtin.debug:
msg: "{{ lookup('template', './templates/rui/etc/dnsmasq.d/cname.conf.j2') }}"
tags:
- debug
Expand All @@ -73,12 +77,13 @@
dest: /etc/dnsmasq.d/blocklist.conf
owner: root
group: root
mode: '0644'
notify: "Restart dnsmasq"
tags:
- dnsmasq

- name: Show cname config
debug:
ansible.builtin.debug:
msg: "{{ lookup('template', './templates/rui/etc/dnsmasq.d/blocklist.conf.j2') }}"
tags:
- debug
Expand All @@ -90,6 +95,7 @@
dest: /etc/hosts
owner: root
group: root
mode: '0644'
notify: "Restart dnsmasq"
tags:
- dnsmasq
1 change: 1 addition & 0 deletions tasks/rui/journalctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
dest: /etc/systemd/journald.conf
owner: root
group: root
mode: '0644'
notify: "Restart systemd-journald"
2 changes: 2 additions & 0 deletions tasks/rui/rsyslog-rui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
dest: /etc/rsyslog.conf
owner: root
group: root
mode: '0644'
notify: "Restart rsyslog"

- name: Put logrotate.conf(5)
Expand All @@ -14,4 +15,5 @@
dest: /etc/logrotate.conf
owner: root
group: root
mode: '0644'
notify: "Restart rsyslog"

0 comments on commit dd4ba90

Please sign in to comment.