ff
This commit is contained in:
@@ -23,7 +23,6 @@
|
|||||||
phy_int2: 10.1.10.3
|
phy_int2: 10.1.10.3
|
||||||
# Имя lte модема для настройки NetworkManager
|
# Имя lte модема для настройки NetworkManager
|
||||||
LTE_con_name: "LTE"
|
LTE_con_name: "LTE"
|
||||||
|
|
||||||
phy_int1_name: "physical_1"
|
phy_int1_name: "physical_1"
|
||||||
phy1_iface_name: "enp89s0"
|
phy1_iface_name: "enp89s0"
|
||||||
phy_int2_name: "physical_2"
|
phy_int2_name: "physical_2"
|
||||||
|
|||||||
@@ -80,6 +80,14 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
nmcli_failed: "{{ nmcli_result.rc != 0 }}"
|
nmcli_failed: "{{ nmcli_result.rc != 0 }}"
|
||||||
|
|
||||||
|
- name: Run nmcli to check if LTE access point connection has already been added
|
||||||
|
shell: /usr/bin/nmcli c | grep {{ LTE_con_name }}
|
||||||
|
register: lte_result
|
||||||
|
ignore_errors: True
|
||||||
|
|
||||||
|
- name: Check result nmcli {{ wifi_ssid }}
|
||||||
|
set_fact:
|
||||||
|
lte_failed: "{{ lte_result.rc != 0 }}"
|
||||||
# - name: Run nmcli to check if phy1 connection has already been added
|
# - name: Run nmcli to check if phy1 connection has already been added
|
||||||
# shell: /usr/bin/nmcli c | grep {{ phy_int1_name }}
|
# shell: /usr/bin/nmcli c | grep {{ phy_int1_name }}
|
||||||
# register: phy1_result
|
# register: phy1_result
|
||||||
@@ -102,16 +110,17 @@
|
|||||||
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ wifi_ssid }} ifname {{ wifi_int.stdout }} type wifi ssid {{ wifi_ssid }} mode ap ip4 {{ wifi_int_ip }}
|
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ wifi_ssid }} ifname {{ wifi_int.stdout }} type wifi ssid {{ wifi_ssid }} mode ap ip4 {{ wifi_int_ip }}
|
||||||
when: nmcli_failed
|
when: nmcli_failed
|
||||||
|
|
||||||
# - name: Configure physical interface 1
|
# - name: Configure physical interface {{ phy_int1_name }}
|
||||||
# command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ phy_int1_name }} ifname {{ phy1_iface_name }} type ethernet ipv4.method shared ipv4.address {{ phy_int1 }}
|
# command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ phy_int1_name }} ifname {{ phy1_iface_name }} type ethernet ipv4.method shared ipv4.address {{ phy_int1 }}
|
||||||
# when: phy1_failed
|
# when: phy1_failed
|
||||||
|
|
||||||
- name: Configure physical interface 1
|
- name: Configure physical interface {{ phy_int2_name }}
|
||||||
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ phy_int2_name }} ifname {{ phy2_iface_name }} type ethernet ipv4.method shared ipv4.address {{ phy_int2 }}
|
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ phy_int2_name }} ifname {{ phy2_iface_name }} type ethernet ipv4.method shared ipv4.address {{ phy_int2 }}
|
||||||
when: phy2_failed
|
when: phy2_failed
|
||||||
|
|
||||||
- name: Run nmcli to add a connection LTE
|
- name: Run nmcli to add a connection LTE
|
||||||
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ LTE_con_name }} ifname cdc-wdm0 type gsm apn "internet"
|
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ LTE_con_name }} ifname cdc-wdm0 type gsm apn "internet"
|
||||||
|
when: lte_failed
|
||||||
|
|
||||||
- name: Run nmcli to add WPA-PSK security to the wifi connection
|
- name: Run nmcli to add WPA-PSK security to the wifi connection
|
||||||
command: /usr/bin/nmcli c mod {{ wifi_ssid }} \
|
command: /usr/bin/nmcli c mod {{ wifi_ssid }} \
|
||||||
@@ -129,9 +138,15 @@
|
|||||||
- name: Run nmcli to activate wifi access point connection
|
- name: Run nmcli to activate wifi access point connection
|
||||||
command: /usr/bin/nmcli c up {{ wifi_ssid }}
|
command: /usr/bin/nmcli c up {{ wifi_ssid }}
|
||||||
|
|
||||||
- name: Run nmcli to activate LTE access point connection
|
- name: Run nmcli to activate {{ LTE_con_name }}
|
||||||
command: /usr/bin/nmcli c up {{ LTE_con_name }}
|
command: /usr/bin/nmcli c up {{ LTE_con_name }}
|
||||||
|
|
||||||
|
- name: Run nmcli to activate {{ phy_int1_name }}
|
||||||
|
command: /usr/bin/nmcli c up {{ LTE_con_name }}
|
||||||
|
|
||||||
|
- name: Run nmcli to activate {{ phy_int2_name }}
|
||||||
|
command: /usr/bin/nmcli c up {{ LTE_con_name }}
|
||||||
|
|
||||||
- name: Apply tags to tasks within included file
|
- name: Apply tags to tasks within included file
|
||||||
include_tasks: iptables.yaml
|
include_tasks: iptables.yaml
|
||||||
args:
|
args:
|
||||||
|
|||||||
Reference in New Issue
Block a user