2
0

Remove Duplicates from defaults.yaml and map.jinja

This commit is contained in:
puneet kandhari 2015-05-26 09:41:04 -05:00
parent d16abf86b6
commit 145b58a9d3
2 changed files with 63 additions and 70 deletions

View File

@ -1,17 +1,22 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
salt: salt:
install_packages: True install_packages: True
clean_config_d_dir: True
config_path: /etc/salt config_path: /etc/salt
minion_service: salt-minion minion_service: salt-minion
master_service: salt-master master_service: salt-master
api_service: salt-api api_service: salt-api
syndic_service: salt-syndic syndic_service: salt-syndic
salt_master: salt-master salt_master: salt-master
salt_minion: salt-minion salt_minion: salt-minion
salt_syndic: salt-syndic salt_syndic: salt-syndic
salt_cloud: salt-cloud salt_cloud: salt-cloud
salt_api: salt-api salt_api: salt-api
salt_ssh: salt-ssh salt_ssh: salt-ssh
clean_config_d_dir: True
master: master:
gitfs_provider: gitpython gitfs_provider: gitpython

View File

@ -1,72 +1,60 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja
{## Start with defaults from defaults.yaml ##}
{% import_yaml "salt/defaults.yaml" as default_settings %} {% import_yaml "salt/defaults.yaml" as default_settings %}
{% set distro_map = salt['grains.filter_by']({ {##
'Debian': {'salt_master': 'salt-master', Setup variable using grains['os_family'] based logic, only add key:values here
'salt_minion': 'salt-minion', that differ from whats in defaults.yaml
'salt_syndic': 'salt-syndic', ##}
'salt_cloud': 'salt-cloud', {% set os_family_map = salt['grains.filter_by']({
'salt_api': 'salt-api', 'Debian': {},
'salt_ssh': 'salt-ssh'}, 'Ubuntu': {},
'Ubuntu': {'salt_master': 'salt-master', 'CentOS': {},
'salt_minion': 'salt-minion', 'Amazon': {},
'salt_syndic': 'salt-syndic', 'Fedora': {},
'salt_cloud': 'salt-cloud', 'RedHat': {},
'salt_api': 'salt-api', 'Suse': {},
'salt_ssh': 'salt-ssh'}, 'Gentoo': {
'CentOS': {'salt_master': 'salt-master', 'salt_master': 'app-admin/salt',
'salt_minion': 'salt-minion', 'salt_minion': 'app-admin/salt',
'salt_syndic': 'salt-syndic', 'salt_syndic': 'app-admin/salt',
'salt_cloud': 'salt-cloud', 'salt_api': 'app-admin/salt',
'salt_api': 'salt-api', 'salt_cloud': 'app-admin/salt'
'salt_ssh': 'salt-ssh'}, },
'Amazon': {'salt_master': 'salt-master', 'Arch': {
'salt_minion': 'salt-minion', 'salt_master': 'salt-zmq',
'salt_syndic': 'salt-syndic', 'salt_minion': 'salt-zmq',
'salt_cloud': 'salt-cloud', 'salt_syndic': 'salt-zmq',
'salt_api': 'salt-api', 'salt_cloud': 'salt-zmq',
'salt_ssh': 'salt-ssh'}, 'salt_api': 'salt-zmq',
'Fedora': {'salt_master': 'salt-master', 'salt_ssh': 'salt-zmq'
'salt_minion': 'salt-minion', },
'salt_syndic': 'salt-syndic', 'FreeBSD': {
'salt_cloud': 'salt-cloud', 'salt_master': 'py27-salt',
'salt_api': 'salt-api', 'salt_minion': 'py27-salt',
'salt_ssh': 'salt-ssh'}, 'salt_syndic': 'py27-salt',
'RedHat': {'salt_master': 'salt-master', 'salt_cloud': 'py27-salt',
'salt_minion': 'salt-minion', 'salt_api': 'py27-salt',
'salt_syndic': 'salt-syndic', 'config_path': '/usr/local/etc/salt',
'salt_cloud': 'salt-cloud', 'minion_service': 'salt_minion',
'salt_api': 'salt-api', 'master_service': 'salt_master',
'salt_ssh': 'salt-ssh'}, 'api_service': 'salt_api',
'Gentoo': {'salt_master': 'app-admin/salt', 'syndic_service': 'salt_syndic'
'salt_minion': 'app-admin/salt', },
'salt_syndic': 'app-admin/salt', }
'salt_api': 'app-admin/salt', , grain="os_family"
'salt_cloud': 'app-admin/salt'}, , merge=salt['pillar.get']('salt:lookup'))
'Arch': {'salt_master': 'salt-zmq', %}
'salt_minion': 'salt-zmq',
'salt_syndic': 'salt-zmq',
'salt_cloud': 'salt-zmq',
'salt_api': 'salt-zmq',
'salt_ssh': 'salt-zmq'},
'Suse': {'salt_master': 'salt-master',
'salt_minion': 'salt-minion',
'salt_syndic': 'salt-syndic',
'salt_api': 'salt-api',
'salt_cloud': 'salt-cloud',
'salt_ssh': 'salt-ssh'},
'FreeBSD': {'salt_master': 'py27-salt',
'salt_minion': 'py27-salt',
'salt_syndic': 'py27-salt',
'salt_cloud': 'py27-salt',
'salt_api': 'py27-salt',
'config_path': '/usr/local/etc/salt',
'minion_service': 'salt_minion',
'master_service': 'salt_master',
'api_service': 'salt_api',
'syndic_service': 'salt_syndic'},
}, merge=salt['pillar.get']('salt:lookup')) %}
{% do default_settings.salt.update(distro_map) %} {## Merge the flavor_map to the default settings ##}
{% do default_settings.salt.update(os_family_map) %}
{% set salt_settings = salt['pillar.get']('salt', default=default_settings.salt,
merge=True) %} {## Merge in salt:lookup pillar ##}
{% set salt_settings = salt['pillar.get'](
'salt',
default=default_settings.salt,
merge=True
)
%}