Browse Source

setting default path for resolver configuration file

tags/v0.1
Arnold Bechtoldt 10 years ago
parent
commit
c24e211386
4 changed files with 7 additions and 13 deletions
  1. +2
    -11
      network/defaults.yaml
  2. +2
    -0
      network/hosts.sls
  3. +3
    -1
      network/resolver.sls
  4. +0
    -1
      network/routes.sls

+ 2
- 11
network/defaults.yaml View File

@@ -1,4 +1,3 @@
# vim: sts=2 ts=2 sw=2 et ai
{% load_yaml as rawmap %}
Debian:
interfaces:
@@ -36,12 +35,8 @@ Debian:
- name: lo
proto: loopback
type: eth
resolver:
values:
path: /etc/resolv.conf
resolver: {}
hosts:
values:
path: /etc/hosts
def_entries:
- name: localhost
ip: 127.0.0.1
@@ -102,12 +97,8 @@ RedHat:
# type: eth
# netmask: 255.0.0.0
# network: 127.0.0.0
resolver:
values:
path: /etc/resolv.conf
resolver: {}
hosts:
values:
path: /etc/hosts
def_entries:
- name: localhost
ip: 127.0.0.1

+ 2
- 0
network/hosts.sls View File

@@ -1,3 +1,5 @@
#!jinja|yaml

{% from "network/defaults.yaml" import rawmap with context %}
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network:lookup')) %}


+ 3
- 1
network/resolver.sls View File

@@ -1,10 +1,12 @@
#!jinja|yaml

{% from "network/defaults.yaml" import rawmap with context %}
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network:lookup')) %}

resolver:
file:
- managed
- name: {{ datamap['resolver']['values']['path'] }}
- name: {{ datamap.resolver.path|default('/etc/resolv.conf') }}
- mode: 644
- user: root
- group: root

+ 0
- 1
network/routes.sls View File

@@ -1,5 +1,4 @@
#!jinja|yaml
# vim: sts=2 ts=2 sw=2 et ai

{% from "network/defaults.yaml" import rawmap with context %}
{% set datamap = salt['grains.filter_by'](rawmap, merge=salt['pillar.get']('network')) %}

Loading…
Cancel
Save