# and up as it'll wipe out important files that Salt relies on. | # and up as it'll wipe out important files that Salt relies on. | ||||
clean_config_d_dir: False | clean_config_d_dir: False | ||||
# Set this to False to not have the formula install packages (in the case you | |||||
# install Salt via git/pip/etc.) | |||||
install_packages: True | |||||
# to overwrite map.jinja salt packages | # to overwrite map.jinja salt packages | ||||
lookup: | lookup: | ||||
salt-master: 'salt-master' | salt-master: 'salt-master' |
- salt.master | - salt.master | ||||
salt-api: | salt-api: | ||||
{% if salt_settings.install_packages %} | |||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_api }} | - name: {{ salt_settings.salt_api }} | ||||
{% endif %} | |||||
service.running: | service.running: | ||||
- name: {{ salt_settings.api_service }} | - name: {{ salt_settings.api_service }} | ||||
- require: | - require: |
- require: | - require: | ||||
- pkg: python-pip | - pkg: python-pip | ||||
{% if salt_settings.install_packages %} | |||||
salt-cloud: | salt-cloud: | ||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_cloud }} | - name: {{ salt_settings.salt_cloud }} | ||||
{% if grains['os_family'] not in ['Debian', 'RedHat'] %} | {% if grains['os_family'] not in ['Debian', 'RedHat'] %} | ||||
- pip: crypto | - pip: crypto | ||||
{% endif %} | {% endif %} | ||||
{% endif %} | |||||
{% for folder in salt_settings.cloud.folders %} | {% for folder in salt_settings.cloud.folders %} | ||||
{{ folder }}: | {{ folder }}: |
salt: | salt: | ||||
install_packages: 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 |
{% from "salt/map.jinja" import salt_settings with context %} | {% from "salt/map.jinja" import salt_settings with context %} | ||||
salt-master: | salt-master: | ||||
{% if salt_settings.install_packages %} | |||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_master }} | - name: {{ salt_settings.salt_master }} | ||||
{% endif %} | |||||
file.recurse: | file.recurse: | ||||
- name: {{ salt_settings.config_path }}/master.d | - name: {{ salt_settings.config_path }}/master.d | ||||
- template: jinja | - template: jinja | ||||
- enable: True | - enable: True | ||||
- name: {{ salt_settings.master_service }} | - name: {{ salt_settings.master_service }} | ||||
- watch: | - watch: | ||||
{% if salt_settings.install_packages %} | |||||
- pkg: salt-master | - pkg: salt-master | ||||
{% endif %} | |||||
- file: salt-master | - file: salt-master |
{% from "salt/map.jinja" import salt_settings with context %} | {% from "salt/map.jinja" import salt_settings with context %} | ||||
salt-minion: | salt-minion: | ||||
{% if salt_settings.install_packages %} | |||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_minion }} | - name: {{ salt_settings.salt_minion }} | ||||
{% endif %} | |||||
file.recurse: | file.recurse: | ||||
- name: {{ salt_settings.config_path }}/minion.d | - name: {{ salt_settings.config_path }}/minion.d | ||||
- template: jinja | - template: jinja | ||||
- enable: True | - enable: True | ||||
- name: {{ salt_settings.minion_service }} | - name: {{ salt_settings.minion_service }} | ||||
- watch: | - watch: | ||||
{% if salt_settings.install_packages %} | |||||
- pkg: salt-minion | - pkg: salt-minion | ||||
{% endif %} | |||||
- file: salt-minion | - file: salt-minion |
{% from "salt/map.jinja" import salt_settings with context %} | {% from "salt/map.jinja" import salt_settings with context %} | ||||
{% if salt_settings.install_packages %} | |||||
ensure salt-ssh is installed: | ensure salt-ssh is installed: | ||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_ssh }} | - name: {{ salt_settings.salt_ssh }} | ||||
{% endif %} | |||||
ensure roster config: | ensure roster config: | ||||
file.managed: | file.managed: | ||||
- source: salt://salt/files/roster.jinja | - source: salt://salt/files/roster.jinja | ||||
- template: jinja | - template: jinja | ||||
- require: | - require: | ||||
{% if salt_settings.install_packages %} | |||||
- pkg: ensure salt-ssh is installed | - pkg: ensure salt-ssh is installed | ||||
{% endif %} |
{% from "salt/map.jinja" import salt_settings with context %} | {% from "salt/map.jinja" import salt_settings with context %} | ||||
salt-minion: | salt-minion: | ||||
{% if salt_settings.install_packages %} | |||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_minion }} | - name: {{ salt_settings.salt_minion }} | ||||
{% endif %} | |||||
file.recurse: | file.recurse: | ||||
- name: {{ salt_settings.config_path }}/minion.d | - name: {{ salt_settings.config_path }}/minion.d | ||||
- template: jinja | - template: jinja | ||||
- enable: False | - enable: False | ||||
- name: {{ salt_settings.minion_service }} | - name: {{ salt_settings.minion_service }} | ||||
- require: | - require: | ||||
{% if salt_settings.install_packages %} | |||||
- pkg: salt-minion | - pkg: salt-minion | ||||
{% endif %} | |||||
- file: salt-minion | - file: salt-minion |
- salt.master | - salt.master | ||||
salt-syndic: | salt-syndic: | ||||
{% if salt_settings.install_packages %} | |||||
pkg.installed: | pkg.installed: | ||||
- name: {{ salt_settings.salt_syndic }} | - name: {{ salt_settings.salt_syndic }} | ||||
{% endif %} | |||||
service: | service: | ||||
- running | - running | ||||
- require: | - require: | ||||
- service: {{ salt_settings.syndic_service }} | - service: {{ salt_settings.syndic_service }} | ||||
- watch: | - watch: | ||||
{% if salt_settings.install_packages %} | |||||
- pkg: salt-master | - pkg: salt-master | ||||
{% endif %} | |||||
- file: {{ salt_settings.config_path }}/master | - file: {{ salt_settings.config_path }}/master |