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 option to not install packages #105

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 5 additions & 3 deletions pillar.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
salt:
# install packages, defaults to True, set to False if you install from git/pip
# install_pkgs: False

# to overwrite map.jinja salt packages
lookup:
Expand Down Expand Up @@ -27,18 +29,18 @@ salt:
ssl_key: /etc/pki/api/certs/server.key
debug: False
disable_ssl: False

# salt minion config:
minion:

# single master setup
master: salt

# multi master setup
master:
- salt_master_1
- salt_master_2

fileserver_backend:
- git
- roots
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['pillar.get']('salt:install_pkgs', True) %}
pkg.installed:
- name: {{ salt['salt-api'] }}
{% endif %}
service.running:
- name: {{ salt.get('api-service', 'salt-api') }}
- require:
Expand Down
2 changes: 2 additions & 0 deletions salt/cloud.sls
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ apache-libcloud:
- require:
- pkg: python-pip

{% if salt['pillar.get']('salt:install_pkgs', True) %}
salt-cloud:
pkg.installed:
- name: {{ salt['salt-cloud'] }}
Expand All @@ -31,6 +32,7 @@ salt-cloud:
{% if grains['os_family'] not in ['Debian', 'RedHat'] %}
- pip: crypto
{% endif %}
{% endif %}

{% for folder in cloud['folders'] %}
{{ folder }}:
Expand Down
2 changes: 2 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 with context %}

salt-master:
{% if salt['pillar.get']('salt:install_pkgs', True) %}
pkg.installed:
- name: {{ salt['salt-master'] }}
{% endif %}
file.recurse:
- name: {{ salt.get('config-path', '/etc/salt') }}/master.d
- template: jinja
Expand Down
2 changes: 2 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 with context %}

salt-minion:
{% if salt['pillar.get']('salt:install_pkgs', True) %}
pkg.installed:
- name: {{ salt['salt-minion'] }}
{% endif %}
file.recurse:
- name: {{ salt.get('config-path', '/etc/salt') }}/minion.d
- template: jinja
Expand Down
2 changes: 2 additions & 0 deletions salt/ssh.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% from "salt/map.jinja" import salt with context %}

{% if salt['pillar.get']('salt:install_pkgs', True) %}
ensure salt-ssh is installed:
pkg.installed:
- name: {{ salt['salt-ssh'] }}
{% endif %}

ensure roster config:
file.managed:
Expand Down
2 changes: 2 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 with context %}

salt-minion:
{% if salt['pillar.get']('salt:install_pkgs', True) %}
pkg.installed:
- name: {{ salt['salt-minion'] }}
{% endif %}
file.recurse:
- name: {{ salt.get('config-path', '/etc/salt') }}/minion.d
- template: jinja
Expand Down
2 changes: 2 additions & 0 deletions salt/syndic.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ include:
- salt.master

salt-syndic:
{% if salt['pillar.get']('salt:install_pkgs', True) %}
pkg.installed:
- name: {{ salt['salt-syndic'] }}
{% endif %}
service:
- running
- require:
Expand Down