소스 검색

restart interface after ip flush / remove cloud init interface file / kill dhclient

PROD-15584

Change-Id: I48ec8a4dd3f6d3a9477c03c218591d42b68f0bab
pull/133/head
Jiri Broulik 7 년 전
부모
커밋
b333d2841b
2개의 변경된 파일15개의 추가작업 그리고 1개의 파일을 삭제
  1. +7
    -0
      linux/network/dhclient.sls
  2. +8
    -1
      linux/network/interface.sls

+ 7
- 0
linux/network/dhclient.sls 파일 보기

@@ -8,4 +8,11 @@ dhclient_conf:
- source: salt://linux/files/dhclient.conf
- template: jinja

{%- elif network.dhclient.enabled is defined and network.dhclient.enabled == False %}

kill_dhcp_client:
cmd.run:
- name: "pkill dhclient"
- onlyif: "pgrep dhclient"

{%- endif %}

+ 8
- 1
linux/network/interface.sls 파일 보기

@@ -45,6 +45,13 @@ remove_iface_file_{{ f }}:

{%- endfor %}

{%- if network.interface is defined %}

remove_cloud_init_file:
file.absent:
- name: /etc/network/interfaces.d/50-cloud-init.cfg

{%- endif %}

{%- for interface_name, interface in network.interface.iteritems() %}

@@ -218,7 +225,7 @@ linux_interface_{{ interface_name }}:

linux_interface_ipflush_onchange_{{ interface_name }}:
cmd.run:
- name: "/sbin/ip address flush dev {{ interface_name }}"
- name: "/sbin/ip address flush dev {{ interface_name }}; ifdown {{ interface_name }} ;ifup {{ interface_name }};"
- onchanges:
- network: linux_interface_{{ interface_name }}


Loading…
취소
저장