Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting to not install packages #108

Merged
merged 1 commit into from
Mar 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ salt:
# and up as it'll wipe out important files that Salt relies on.
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
lookup:
salt-master: 'salt-master'
Expand Down
2 changes: 2 additions & 0 deletions salt/api.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ include:
- salt.master

salt-api:
{% if salt_settings.install_packages %}
pkg.installed:
- name: {{ salt_settings.salt_api }}
{% endif %}
service.running:
- name: {{ salt_settings.api_service }}
- require:
Expand Down
2 changes: 2 additions & 0 deletions salt/cloud.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ apache-libcloud:
- require:
- pkg: python-pip

{% if salt_settings.install_packages %}
salt-cloud:
pkg.installed:
- name: {{ salt_settings.salt_cloud }}
Expand All @@ -29,6 +30,7 @@ salt-cloud:
{% if grains['os_family'] not in ['Debian', 'RedHat'] %}
- pip: crypto
{% endif %}
{% endif %}

{% for folder in salt_settings.cloud.folders %}
{{ folder }}:
Expand Down
1 change: 1 addition & 0 deletions salt/defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
salt:
install_packages: True
config_path: /etc/salt
minion_service: salt-minion
master_service: salt-master
Expand Down
4 changes: 4 additions & 0 deletions salt/master.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% from "salt/map.jinja" import salt_settings with context %}

salt-master:
{% if salt_settings.install_packages %}
pkg.installed:
- name: {{ salt_settings.salt_master }}
{% endif %}
file.recurse:
- name: {{ salt_settings.config_path }}/master.d
- template: jinja
Expand All @@ -12,5 +14,7 @@ salt-master:
- enable: True
- name: {{ salt_settings.master_service }}
- watch:
{% if salt_settings.install_packages %}
- pkg: salt-master
{% endif %}
- file: salt-master
4 changes: 4 additions & 0 deletions salt/minion.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% from "salt/map.jinja" import salt_settings with context %}

salt-minion:
{% if salt_settings.install_packages %}
pkg.installed:
- name: {{ salt_settings.salt_minion }}
{% endif %}
file.recurse:
- name: {{ salt_settings.config_path }}/minion.d
- template: jinja
Expand All @@ -14,5 +16,7 @@ salt-minion:
- enable: True
- name: {{ salt_settings.minion_service }}
- watch:
{% if salt_settings.install_packages %}
- pkg: salt-minion
{% endif %}
- file: salt-minion
4 changes: 4 additions & 0 deletions salt/ssh.sls
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{% from "salt/map.jinja" import salt_settings with context %}

{% if salt_settings.install_packages %}
ensure salt-ssh is installed:
pkg.installed:
- name: {{ salt_settings.salt_ssh }}
{% endif %}

ensure roster config:
file.managed:
- name: {{ salt_settings.config_path }}/roster
- source: salt://salt/files/roster.jinja
- template: jinja
- require:
{% if salt_settings.install_packages %}
- pkg: ensure salt-ssh is installed
{% endif %}
4 changes: 4 additions & 0 deletions salt/standalone.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% from "salt/map.jinja" import salt_settings with context %}

salt-minion:
{% if salt_settings.install_packages %}
pkg.installed:
- name: {{ salt_settings.salt_minion }}
{% endif %}
file.recurse:
- name: {{ salt_settings.config_path }}/minion.d
- template: jinja
Expand All @@ -14,5 +16,7 @@ salt-minion:
- enable: False
- name: {{ salt_settings.minion_service }}
- require:
{% if salt_settings.install_packages %}
- pkg: salt-minion
{% endif %}
- file: salt-minion
4 changes: 4 additions & 0 deletions salt/syndic.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ include:
- salt.master

salt-syndic:
{% if salt_settings.install_packages %}
pkg.installed:
- name: {{ salt_settings.salt_syndic }}
{% endif %}
service:
- running
- require:
- service: {{ salt_settings.syndic_service }}
- watch:
{% if salt_settings.install_packages %}
- pkg: salt-master
{% endif %}
- file: {{ salt_settings.config_path }}/master