diff --git a/roles/lb/tasks/main.yml b/roles/lb/tasks/main.yml index 2bcc886..7361fe6 100644 --- a/roles/lb/tasks/main.yml +++ b/roles/lb/tasks/main.yml @@ -1,6 +1,6 @@ # 自动设置LB节点变量'LB_IF' - name: 注册变量 LB_IF_TMP - shell: "ip a|grep '{{ inventory_hostname }}/'|awk '{print $7}'" + shell: "ip a|grep '{{ inventory_hostname }}/'|awk '{print $NF}'" register: LB_IF_TMP - name: 设置变量 LB_IF