-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b543c42
commit 5fa0cad
Showing
7 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
apt: | ||
- curl | ||
- dnsmasq | ||
- dstat | ||
- htop | ||
- rsyslog | ||
|
||
mai_info: "{{ network | selectattr('shortname', 'eq', 'mai') }}" | ||
mai_ipv4: "{{ mai_info[0].ipv4 }}" | ||
mai_interface: "{{ mai_info[0].interface }}" | ||
|
||
dnsmasq: | ||
domain: hayaworld.home | ||
local: /hayaworld.home/ | ||
listen_address: "{{ mai_ipv4 }}" | ||
interface: "{{ mai_interface }}" | ||
dhcp_range: | ||
start: 192.168.1.151 | ||
end: 192.168.1.191 | ||
netmask: 255.255.255.0 | ||
ttl: "12h" | ||
dhcp_option: | ||
ntp_server: 210.130.188.10 | ||
dns_server: "{{ mai_ipv4 }}" | ||
router: "{{ subnet.gw4 }}" | ||
netmask: "255.255.255.0" | ||
dns: | ||
cache_size: 4000 | ||
NXDOMAIN_hosts: /etc/dnsmasq.d/NXDOMAIN.conf | ||
logs: | ||
log_facility: local5 | ||
|
||
services_start: | ||
- dnsmasq | ||
- rsyslog | ||
- ssh | ||
- systemd-journald | ||
|
||
firewall: | ||
policy: deny | ||
allow_rules: | ||
- name: "SSH from service line" | ||
proto: "tcp" | ||
src: "192.168.1.0/24" | ||
port: '22' | ||
- name: "Zabbix from Zabbix-server" | ||
proto: "tcp" | ||
src: "192.168.1.106/24" | ||
port: "10050" | ||
- name: "DNS from service line" | ||
proto: "tcp" | ||
src: "192.168.1.0/24" | ||
port: "53" | ||
- name: "DNS(UDP) from service line" | ||
proto: "udp" | ||
src: "192.168.1.0/24" | ||
port: "53" | ||
- name: "DHCP from service line" | ||
proto: "udp" | ||
src: "any" | ||
port: "67" | ||
- name: "DHCP Client from service line" | ||
proto: "udp" | ||
src: "any" | ||
port: "68" | ||
- name: "Runner Docker ssh" | ||
proto: "tcp" | ||
src: "172.17.0.0/16" | ||
port: "22" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
- name: Play for mai.hayaworld.home | ||
hosts: mai | ||
remote_user: hayato | ||
gather_facts: true | ||
become: true | ||
|
||
vars_files: | ||
- inventories/host_vars/rui/NXDOMAIN.yml | ||
- inventories/host_vars/rui/CNAME.yml | ||
- inventories/host_vars/mai.yml | ||
- inventories/host_vars/networks.yml | ||
|
||
handlers: | ||
- name: Restart handler tasks | ||
ansible.builtin.import_tasks: | ||
file: handlers/main.yml | ||
|
||
tasks: | ||
- name: Common Settings | ||
ansible.builtin.import_tasks: | ||
file: tasks/all/main.yml | ||
|
||
- name: Stop systemd-resolved | ||
ansible.builtin.import_tasks: | ||
file: tasks/rui/stop-systemd-resolved.yml | ||
tags: | ||
- dnsmasq | ||
|
||
- name: Setup dnsmask | ||
ansible.builtin.import_tasks: | ||
file: tasks/rui/dnsmasq.yml | ||
tags: | ||
- dnsmasq | ||
|
||
- name: Show hosts(5) | ||
ansible.builtin.debug: | ||
msg: "{{ lookup('template', './templates/rui/etc/hosts.j2') }}" | ||
tags: | ||
- debug | ||
- dnsmasq | ||
- dryrun | ||
|
||
- 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 | ||
|
||
- name: Make Started Services | ||
ansible.builtin.import_tasks: | ||
file: tasks/service_start.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
_ | ||
_ __ ___ __ _(_) | ||
| '_ ` _ \ / _` | | | ||
| | | | | | (_| | | | ||
|_| |_| |_|\__,_|_| | ||
|