# 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 |
#!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')) %} | ||||
#!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 |
#!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')) %} |