mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-13 18:44:31 +05:00
add support OpenWrt 22
This commit is contained in:
@@ -14,6 +14,8 @@ Playbook для Ansible, автоматизирующий настройку о
|
|||||||
Тестировалось с
|
Тестировалось с
|
||||||
- Ansible 2.9.6
|
- Ansible 2.9.6
|
||||||
- OpenWrt 20.02.3
|
- OpenWrt 20.02.3
|
||||||
|
- OpenWrt 21.05.0
|
||||||
|
- OpenWrt 22.03.0
|
||||||
|
|
||||||
# Использование
|
# Использование
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
opkg:
|
opkg:
|
||||||
name: ipset
|
name: ipset
|
||||||
state: present
|
state: present
|
||||||
|
when: ansible_distribution_major_version < "22"
|
||||||
|
|
||||||
- name: install dnscrypt
|
- name: install dnscrypt
|
||||||
opkg:
|
opkg:
|
||||||
@@ -206,7 +207,7 @@
|
|||||||
src: lan
|
src: lan
|
||||||
family: ipv4
|
family: ipv4
|
||||||
|
|
||||||
- name: add ipset for subnet
|
- name: add ipset for subnet (<22)
|
||||||
uci:
|
uci:
|
||||||
command: section
|
command: section
|
||||||
config: firewall
|
config: firewall
|
||||||
@@ -217,8 +218,9 @@
|
|||||||
match: dst_net
|
match: dst_net
|
||||||
storage: hash
|
storage: hash
|
||||||
loadfile: /tmp/lst/subnet.lst
|
loadfile: /tmp/lst/subnet.lst
|
||||||
|
when: ansible_distribution_major_version < "22"
|
||||||
|
|
||||||
- name: add ipset for ip
|
- name: add ipset for ip (<22)
|
||||||
uci:
|
uci:
|
||||||
command: section
|
command: section
|
||||||
config: firewall
|
config: firewall
|
||||||
@@ -231,8 +233,9 @@
|
|||||||
loadfile: /tmp/lst/ip.lst
|
loadfile: /tmp/lst/ip.lst
|
||||||
hashsize: 9900000
|
hashsize: 9900000
|
||||||
maxelem: 9900000
|
maxelem: 9900000
|
||||||
|
when: ansible_distribution_major_version < "22"
|
||||||
|
|
||||||
- name: add ipset for community
|
- name: add ipset for community (<22)
|
||||||
uci:
|
uci:
|
||||||
command: section
|
command: section
|
||||||
config: firewall
|
config: firewall
|
||||||
@@ -245,6 +248,43 @@
|
|||||||
loadfile: /tmp/lst/community.lst
|
loadfile: /tmp/lst/community.lst
|
||||||
hashsize: 9900000
|
hashsize: 9900000
|
||||||
maxelem: 9900000
|
maxelem: 9900000
|
||||||
|
when: ansible_distribution_major_version < "22"
|
||||||
|
|
||||||
|
- name: add ipset for subnet (22)
|
||||||
|
uci:
|
||||||
|
command: section
|
||||||
|
config: firewall
|
||||||
|
type: ipset
|
||||||
|
find_by:
|
||||||
|
name: vpn_subnets
|
||||||
|
value:
|
||||||
|
match: dst_net
|
||||||
|
loadfile: /tmp/lst/subnet.lst
|
||||||
|
when: ansible_distribution_major_version == "22"
|
||||||
|
|
||||||
|
- name: add ipset for ip (22)
|
||||||
|
uci:
|
||||||
|
command: section
|
||||||
|
config: firewall
|
||||||
|
type: ipset
|
||||||
|
find_by:
|
||||||
|
name: vpn_ip
|
||||||
|
value:
|
||||||
|
match: dst_net
|
||||||
|
loadfile: /tmp/lst/ip.lst
|
||||||
|
when: ansible_distribution_major_version == "22"
|
||||||
|
|
||||||
|
- name: add ipset for community (22)
|
||||||
|
uci:
|
||||||
|
command: section
|
||||||
|
config: firewall
|
||||||
|
type: ipset
|
||||||
|
find_by:
|
||||||
|
name: vpn_community
|
||||||
|
value:
|
||||||
|
match: dst_net
|
||||||
|
loadfile: /tmp/lst/community.lst
|
||||||
|
when: ansible_distribution_major_version == "22"
|
||||||
|
|
||||||
- name: add mark rule vpn_subnet
|
- name: add mark rule vpn_subnet
|
||||||
uci:
|
uci:
|
||||||
|
|||||||
Reference in New Issue
Block a user