瀏覽代碼

Merge 05132786d2 into f7764b10b4

pull/9/merge
Rene Jochum 9 年之前
父節點
當前提交
990c34bea6
共有 4 個檔案被更改,包括 35 行新增1 行删除
  1. +8
    -0
      network/defaults.yaml
  2. +12
    -1
      network/interfaces.sls
  3. +8
    -0
      network/packages.sls
  4. +7
    -0
      pillar.example.sls

+ 8
- 0
network/defaults.yaml 查看文件

@@ -16,6 +16,7 @@ Debian:
- stp
- maxwait
- fd
- up_cmds
- pre_up_cmds
- pre_down_cmds
- post_up_cmds
@@ -32,6 +33,10 @@ Debian:
- ipv6ipaddr
- ipv6netmask
- ipv6gateway

- pointopoint

- noifupdown
def_entries:
- name: lo
proto: loopback
@@ -78,6 +83,7 @@ RedHat:
- stp
- maxwait
- fd
- up_cmds
- pre_up_cmds
- pre_down_cmds
- post_up_cmds
@@ -94,6 +100,8 @@ RedHat:
- ipv6ipaddr
- ipv6netmask
- ipv6gateway

- noifupdown
def_entries: []
# - name: lo
# proto: none

+ 12
- 1
network/interfaces.sls 查看文件

@@ -12,7 +12,18 @@
{%- endif -%}
{%- endmacro -%}

{% if salt['pillar.get']('network:interfaces', False) %}
{%- if salt['pillar.get']('network:dhclient_conf', False) %}
dhclient_conf:
file:
- managed
- name: /etc/dhcp/dhclient.conf
- mode: 644
- user: root
- group: root
- contents_pillar: network:dhclient_conf
{% endif %}

{%- if salt['pillar.get']('network:interfaces', False) %}
{% set interfaces = interfaces + salt['pillar.get']('network:interfaces') %}
{% endif %}


+ 8
- 0
network/packages.sls 查看文件

@@ -0,0 +1,8 @@
#!jinja|yaml

{% for action, pkgs in salt['pillar.get']('network:pkgs', {}).iteritems() %}
network_pkgs_{{ action }}:
pkg:
- {{ action }}
- pkgs: {{ pkgs }}
{% endfor %}

+ 7
- 0
pillar.example.sls 查看文件

@@ -81,3 +81,10 @@ network:
netmask: 255.255.0.0
gateway: 192.168.2.1

# To add/remove packages here.
# You need to include the state network.packages in your salt.
pkgs:
purged:
- resolvconf
installed:
- isc-dhcp-client

Loading…
取消
儲存