source:engine metadata created - defaults to pkg installation, pip installation alternative addedtags/0.4
minions: | minions: | ||||
- name: 'node1.system.location.domain.com' | - name: 'node1.system.location.domain.com' | ||||
Salt master with alternative installation source and version (optional) - pip | |||||
.. code-block:: yaml | |||||
salt: | |||||
master: | |||||
enabled: true | |||||
... | |||||
source: | |||||
engine: pip | |||||
version: 2016.3.0rc2 | |||||
Salt master syndicate master of masters | Salt master syndicate master of masters | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
image: ubuntu-14-04-x64-1456128611.qcow2 | image: ubuntu-14-04-x64-1456128611.qcow2 | ||||
size: medium | size: medium | ||||
disk_profile: database | disk_profile: database | ||||
net_profile: testing | |||||
net_profile: testing |
salt: | salt: | ||||
master: | master: | ||||
enabled: true | enabled: true | ||||
source: | |||||
engine: pkg | |||||
command_timeout: 5 | command_timeout: 5 | ||||
worker_threads: 2 | |||||
worker_threads: 2 |
salt: | salt: | ||||
master: | master: | ||||
enabled: true | enabled: true | ||||
source: | |||||
engine: pkg | |||||
command_timeout: 5 | command_timeout: 5 | ||||
worker_threads: 2 | worker_threads: 2 | ||||
base_environment: ${_param:salt_master_base_environment} | |||||
base_environment: ${_param:salt_master_base_environment} |
salt: | salt: | ||||
minion: | minion: | ||||
enabled: true | enabled: true | ||||
source: | |||||
engine: pkg | |||||
masters: | masters: | ||||
- host: ${_param:salt_master_host} | - host: ${_param:salt_master_host} | ||||
- host: ${_param:salt_master_host} | - host: ${_param:salt_master_host} |
salt: | salt: | ||||
minion: | minion: | ||||
enabled: true | enabled: true | ||||
source: | |||||
engine: pkg | |||||
local: true | local: true | ||||
pillar: | pillar: | ||||
engine: reclass | engine: reclass |
salt: | salt: | ||||
minion: | minion: | ||||
enabled: true | enabled: true | ||||
source: | |||||
engine: pkg | |||||
master: | master: | ||||
host: ${_param:salt_master_host} | host: ${_param:salt_master_host} | ||||
mine: | mine: |
pkg.installed | pkg.installed | ||||
- names: {{ api.pkgs }} | - names: {{ api.pkgs }} | ||||
- require: | - require: | ||||
- pkg: salt_master_packages | |||||
- {{ master.install_state }} | |||||
salt_api_service: | salt_api_service: | ||||
service.running: | service.running: | ||||
- watch: | - watch: | ||||
- file: /etc/salt/master | - file: /etc/salt/master | ||||
{%- endif %} | |||||
{%- endif %} |
{%- load_yaml as master_common %} | {%- load_yaml as master_common %} | ||||
default: | default: | ||||
service: salt-master | service: salt-master | ||||
{%- if pillar.salt.master is defined %} | |||||
{%- if pillar.salt.master.source.engine == 'pkg' %} | |||||
install_state: "pkg: salt_master_packages" | |||||
{%- elif pillar.salt.master.source.engine == 'pip' %} | |||||
install_state: "pip: salt_master_packages" | |||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- if pillar.salt.master.source.version is defined %} | |||||
version: {{ pillar.salt.master.source.version }} | |||||
{%- endif %} | |||||
accept_policy: preseed | accept_policy: preseed | ||||
bind: {} | bind: {} | ||||
formula: {} | formula: {} | ||||
- python-yaml | - python-yaml | ||||
graph_states: False | graph_states: False | ||||
service: salt-minion | service: salt-minion | ||||
{%- if pillar.salt.minion is defined %} | |||||
{%- if pillar.salt.minion.source.engine == 'pkg' %} | |||||
install_state: "pkg: salt_minion_packages" | |||||
{%- elif pillar.salt.minion.source.engine == 'pip' %} | |||||
install_state: "pip: salt_minion_packages" | |||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- if pillar.salt.minion.source.version is defined %} | |||||
version: {{ pillar.salt.minion.source.version }} | |||||
{%- endif %} | |||||
{%- endload %} | {%- endload %} | ||||
{%- load_yaml as minion_specific %} | {%- load_yaml as minion_specific %} |
- names: | - names: | ||||
- salt-api | - salt-api | ||||
- require: | - require: | ||||
- pkg: salt_master_packages | |||||
- {{ master.install_state }} | |||||
salt_api_service: | salt_api_service: | ||||
service.running: | service.running: |
file.directory: | file.directory: | ||||
- makedirs: true | - makedirs: true | ||||
- require: | - require: | ||||
- pkg: salt_master_packages | |||||
- {{ master.install_state }} | |||||
{%- for name, environment in master.environment.iteritems() %} | {%- for name, environment in master.environment.iteritems() %} | ||||
{%- from "salt/map.jinja" import master with context %} | {%- from "salt/map.jinja" import master with context %} | ||||
{%- if master.enabled %} | {%- if master.enabled %} | ||||
{%- if master.source.get('engine', 'pkg') == 'pkg' %} | |||||
salt_master_packages: | salt_master_packages: | ||||
pkg.latest: | pkg.latest: | ||||
- names: {{ master.pkgs }} | - names: {{ master.pkgs }} | ||||
{%- if master.source.version is defined %} | |||||
- version: {{ master.source.version }} | |||||
{%- endif %} | |||||
{%- elif master.source.get('engine', 'pkg') == 'pip' %} | |||||
salt_master_packages: | |||||
pip.installed: | |||||
- name: salt{% if master.source.version is defined %}=={{ master.source.version }}{% endif %} | |||||
{%- endif %} | |||||
/etc/salt/master.d/master.conf: | /etc/salt/master.d/master.conf: | ||||
file.managed: | file.managed: | ||||
- user: root | - user: root | ||||
- template: jinja | - template: jinja | ||||
- require: | - require: | ||||
- pkg: salt_master_packages | |||||
- {{ master.install_state }} | |||||
- watch_in: | - watch_in: | ||||
- service: salt_master_service | - service: salt_master_service | ||||
- user: root | - user: root | ||||
- template: jinja | - template: jinja | ||||
- require: | - require: | ||||
- pkg: salt_master_packages | |||||
- {{ master.install_state }} | |||||
- watch_in: | - watch_in: | ||||
- service: salt_master_service | - service: salt_master_service | ||||
- mode: 755 | - mode: 755 | ||||
- makedirs: true | - makedirs: true | ||||
{%- endif %} | |||||
{%- endif %} |
- source: salt://salt/files/_pki.conf | - source: salt://salt/files/_pki.conf | ||||
- template: jinja | - template: jinja | ||||
- require: | - require: | ||||
- pkg: salt_minion_packages | |||||
- {{ minion.install_state }} | |||||
- watch_in: | - watch_in: | ||||
- service: salt_minion_service | - service: salt_minion_service | ||||
- makedirs: true | - makedirs: true | ||||
- user: root | - user: root | ||||
- require: | - require: | ||||
- pkg: salt_minion_packages | |||||
- {{ minion.install_state }} | |||||
salt_minion_grains_placeholder: | salt_minion_grains_placeholder: | ||||
file.touch: | file.touch: |
pkg.latest: | pkg.latest: | ||||
- names: {{ minion.graph_pkgs }} | - names: {{ minion.graph_pkgs }} | ||||
- require: | - require: | ||||
- pkg: salt_minion_packages | |||||
- {{ minion.install_state }} | |||||
salt_graph_states_packages: | salt_graph_states_packages: | ||||
pkg.latest: | pkg.latest: |
{%- from "salt/map.jinja" import minion with context %} | {%- from "salt/map.jinja" import minion with context %} | ||||
{%- if minion.enabled %} | {%- if minion.enabled %} | ||||
{%- if minion.source.get('engine', 'pkg') == 'pkg' %} | |||||
salt_minion_packages: | salt_minion_packages: | ||||
pkg.latest: | pkg.latest: | ||||
- names: {{ minion.pkgs }} | - names: {{ minion.pkgs }} | ||||
{%- if minion.source.version is defined %} | |||||
- version: {{ minion.source.version }} | |||||
{%- endif %} | |||||
{%- elif minion.source.get('engine', 'pkg') == 'pip' %} | |||||
salt_minion_packages: | |||||
pip.installed: | |||||
- name: salt{% if minion.source.version is defined %}=={{ minion.source.version }}{% endif %} | |||||
{%- endif %} | |||||
/etc/salt/minion.d/minion.conf: | /etc/salt/minion.d/minion.conf: | ||||
file.managed: | file.managed: | ||||
- group: root | - group: root | ||||
- template: jinja | - template: jinja | ||||
- require: | - require: | ||||
- pkg: salt_minion_packages | |||||
- {{ minion.install_state }} | |||||
- watch_in: | - watch_in: | ||||
- service: salt_minion_service | - service: salt_minion_service | ||||
- name: {{ minion.service }} | - name: {{ minion.service }} | ||||
- enable: true | - enable: true | ||||
{%- endif %} | |||||
{%- endif %} |