fix(opnsense): использовать Item-эндпоинты API os-xray (searchItem/getItem/setItem/addItem/delItem/toggleItem)
ansible-opnsense / deploy (push) Successful in 10s
ansible-opnsense / deploy (push) Successful in 10s
This commit is contained in:
1 parent
21f106993f
commit
931d8d0970
1 file changed
+7
-7
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
- name: Получить текущие инстансы из OPNsense
|
- name: Получить текущие инстансы из OPNsense
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/search"
|
url: "https://{{ opnsense_host }}/api/xray/instance/searchItem"
|
||||||
method: GET
|
method: GET
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
- name: Отключить лишние активные инстансы
|
- name: Отключить лишние активные инстансы
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/toggle/{{ item.uuid }}/0"
|
url: "https://{{ opnsense_host }}/api/xray/instance/toggleItem/{{ item.uuid }}/0"
|
||||||
method: POST
|
method: POST
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
- name: Прочитать полные поля существующих инстансов
|
- name: Прочитать полные поля существующих инстансов
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/get/{{ item.uuid }}"
|
url: "https://{{ opnsense_host }}/api/xray/instance/getItem/{{ item.uuid }}"
|
||||||
method: GET
|
method: GET
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
|
|
||||||
- name: Добавить новые подписки
|
- name: Добавить новые подписки
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/add"
|
url: "https://{{ opnsense_host }}/api/xray/instance/addItem"
|
||||||
method: POST
|
method: POST
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
- name: Обновить изменённые подписки
|
- name: Обновить изменённые подписки
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/set/{{ item.0.uuid }}"
|
url: "https://{{ opnsense_host }}/api/xray/instance/setItem/{{ item.0.uuid }}"
|
||||||
method: POST
|
method: POST
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
|
|
||||||
- name: Откатить переключение при нерабочем соединении
|
- name: Откатить переключение при нерабочем соединении
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/toggle/{{ item.uuid }}/1"
|
url: "https://{{ opnsense_host }}/api/xray/instance/toggleItem/{{ item.uuid }}/1"
|
||||||
method: POST
|
method: POST
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
@@ -260,7 +260,7 @@
|
|||||||
|
|
||||||
- name: Удалить лишние инстансы после успешного переключения
|
- name: Удалить лишние инстансы после успешного переключения
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ opnsense_host }}/api/xray/instance/del/{{ item.uuid }}"
|
url: "https://{{ opnsense_host }}/api/xray/instance/delItem/{{ item.uuid }}"
|
||||||
method: POST
|
method: POST
|
||||||
url_username: "{{ opnsense_api_key }}"
|
url_username: "{{ opnsense_api_key }}"
|
||||||
url_password: "{{ opnsense_api_secret }}"
|
url_password: "{{ opnsense_api_secret }}"
|
||||||
|
|||||||
Reference in new issue
Block a user