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

# vim: sts=2 ts=2 sw=2 et ai
{% load_yaml as rawmap %} {% load_yaml as rawmap %}
Debian: Debian:
interfaces: interfaces:
- name: lo - name: lo
proto: loopback proto: loopback
type: eth type: eth
resolver:
values:
path: /etc/resolv.conf
resolver: {}
hosts: hosts:
values:
path: /etc/hosts
def_entries: def_entries:
- name: localhost - name: localhost
ip: 127.0.0.1 ip: 127.0.0.1
# type: eth # type: eth
# netmask: 255.0.0.0 # netmask: 255.0.0.0
# network: 127.0.0.0 # network: 127.0.0.0
resolver:
values:
path: /etc/resolv.conf
resolver: {}
hosts: hosts:
values:
path: /etc/hosts
def_entries: def_entries:
- name: localhost - name: localhost
ip: 127.0.0.1 ip: 127.0.0.1

+ 2
- 0
network/hosts.sls View File

#!jinja|yaml

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



+ 3
- 1
network/resolver.sls View File

#!jinja|yaml

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


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

+ 0
- 1
network/routes.sls View File

#!jinja|yaml #!jinja|yaml
# vim: sts=2 ts=2 sw=2 et ai


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

Loading…
Cancel
Save