mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-14 11:04:31 +05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aae9c50f10 | ||
|
|
db0d06408a | ||
|
|
b5b6a7ad5f | ||
|
|
3fdf04518f | ||
|
|
5f015d069f | ||
|
|
76fcd4860f | ||
|
|
96c8ceee44 |
1
.github/workflows/public-galaxy.yml
vendored
1
.github/workflows/public-galaxy.yml
vendored
@@ -2,7 +2,6 @@ name: Public to Ansible Galaxy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
|
|||||||
14
README.EN.md
14
README.EN.md
@@ -69,7 +69,7 @@ Wireguard, only domains, stubby, Russia, acces from wg network, host 192.168.1.1
|
|||||||
remote_user: root
|
remote_user: root
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- domain-routing-openwrt
|
- itdoginfo.domain_routing_openwrt
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
tunnel: wg
|
tunnel: wg
|
||||||
@@ -93,12 +93,22 @@ Sing-box, stubby, Russia
|
|||||||
remote_user: root
|
remote_user: root
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- domain-routing-openwrt
|
- itdoginfo.domain_routing_openwrt
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
tunnel: singbox
|
tunnel: singbox
|
||||||
dns_encrypt: stubby
|
dns_encrypt: stubby
|
||||||
country: russia-inside
|
country: russia-inside
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: sing-box config
|
||||||
|
template:
|
||||||
|
src: "templates/openwrt-sing-box-json.j2"
|
||||||
|
dest: "/etc/sing-box/config.json"
|
||||||
|
mode: 0644
|
||||||
|
notify:
|
||||||
|
- Restart sing-box
|
||||||
|
- Restart network
|
||||||
```
|
```
|
||||||
|
|
||||||
License
|
License
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -1,7 +1,7 @@
|
|||||||
[English role README](https://github.com/itdoginfo/domain-routing-openwrt/blob/master/README.EN.md)
|
[English role README](https://github.com/itdoginfo/domain-routing-openwrt/blob/master/README.EN.md)
|
||||||
|
|
||||||
# Описание
|
# Описание
|
||||||
Shell скрипт и playbook для Ansible. Автоматизируют настройку роутера на OpenWrt для роутинга по доменам и спискам IP-адресов.
|
Shell скрипт и [роль для Ansible](https://galaxy.ansible.com/ui/standalone/roles/itdoginfo/domain_routing_openwrt). Автоматизируют настройку роутера на OpenWrt для роутинга по доменам и спискам IP-адресов.
|
||||||
|
|
||||||
Полное описание происходящего:
|
Полное описание происходящего:
|
||||||
- [Статья на хабре](https://habr.com/ru/articles/767464/)
|
- [Статья на хабре](https://habr.com/ru/articles/767464/)
|
||||||
@@ -44,7 +44,7 @@ ansible-galaxy role install itdoginfo.domain_routing_openwrt
|
|||||||
|
|
||||||
Примеры playbooks
|
Примеры playbooks
|
||||||
|
|
||||||
Wireguard, only domains, stubby, Russia, acces from wg network (примерное значение 192.168.80.0/24), host 192.168.1.1
|
Wireguard, only domains, stubby, Russia, acces from wg network (пример 192.168.80.0/24), host 192.168.1.1
|
||||||
```
|
```
|
||||||
- hosts: 192.168.1.1
|
- hosts: 192.168.1.1
|
||||||
remote_user: root
|
remote_user: root
|
||||||
@@ -81,6 +81,16 @@ Sing-box, stubby, Russia
|
|||||||
tunnel: singbox
|
tunnel: singbox
|
||||||
dns_encrypt: stubby
|
dns_encrypt: stubby
|
||||||
country: russia-inside
|
country: russia-inside
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: sing-box config
|
||||||
|
template:
|
||||||
|
src: "templates/openwrt-sing-box-json.j2"
|
||||||
|
dest: "/etc/sing-box/config.json"
|
||||||
|
mode: 0644
|
||||||
|
notify:
|
||||||
|
- Restart sing-box
|
||||||
|
- Restart network
|
||||||
```
|
```
|
||||||
|
|
||||||
В inventory файле роутер обязательно должен быть в группе `[openwrt]`
|
В inventory файле роутер обязательно должен быть в группе `[openwrt]`
|
||||||
@@ -183,8 +193,7 @@ service getdomains start
|
|||||||
[Инструкция для OpenWrt 21.02](https://t.me/itdoginfo/8)
|
[Инструкция для OpenWrt 21.02](https://t.me/itdoginfo/8)
|
||||||
|
|
||||||
## Текстовый редактор nano
|
## Текстовый редактор nano
|
||||||
Устанавливается по умолчанию
|
Устанавливается по умолчанию. Можно выключить
|
||||||
Можно выключить
|
|
||||||
```
|
```
|
||||||
nano: false
|
nano: false
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ if [ "$WG" == true ]; then
|
|||||||
if [ $ROUTE_TABLE -eq 1 ]; then
|
if [ $ROUTE_TABLE -eq 1 ]; then
|
||||||
checkpoint_true "Route table WG"
|
checkpoint_true "Route table WG"
|
||||||
else
|
else
|
||||||
checkpoint_false "Route table VPN"
|
checkpoint_false "Route table WG"
|
||||||
echo "Details: https://cli.co/Atxr6U3"
|
echo "Details: https://cli.co/Atxr6U3"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
- name: Restart sing-box
|
||||||
|
service:
|
||||||
|
name: sing-box
|
||||||
|
state: restarted
|
||||||
|
|
||||||
- name: Restart network
|
- name: Restart network
|
||||||
service:
|
service:
|
||||||
name: network
|
name: network
|
||||||
|
|||||||
Reference in New Issue
Block a user