This repository was archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathparams.jinja
184 lines (149 loc) · 7.44 KB
/
params.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{# Platform information #}
{% set os = grains.get('os', '') %}
{% set os_family = grains.get('os_family', '') %}
{% set os_release = grains.get('osrelease', '') %}
{% set os_major_release = grains.get('osmajorrelease', '')|int %}
{% set os_code_name = grains.get('oscodename', '') %}
{% set os_arch = grains.get('osarch', '') %}
{# Package set information: may need to be overridden for repos having nonstandard package sets #}
{% set salt_version = pillar.get('salt_version', '') %}
{% set pkgs = ['salt-master', 'salt-minion', 'salt-api', 'salt-cloud', 'salt-ssh', 'salt-syndic'] %}
{% do pkgs.append('salt-common') if os_family == 'Debian' %}
{# if there is a patch to a package you can use repo_pkg_version to specify a different package version. ie 2015.8.8.2 #}
{% set repo_pkg_version = '-' + pillar.get('repo_pkg_version', '') %}
{# Fedora specific options #}
{% set rh_version = pillar.get('rh_version', 'fc') %}
{% set pkg_version = salt['pillar.get']('pkg_version', '1') %}
{% set fed_pkg_version = pillar.get('fed_pkg_version', '1') %}
{# Shorthand for specific platforms #}
{% set on_rhel_5 = True if os_family == 'RedHat' and os_major_release == '5' else False %}
{% set on_deb_7 = True if os_family == 'Debian' and os_major_release == '7' else False %}
{% set on_smartos = True if os == 'SmartOS' else False %}
{% set on_amazon = True if os == 'Amazon' else False %}
{% set on_amazon2 = True if os_code_name == 'Amazon Linux 2' else False %}
{% set on_rhel = True if os_family == 'RedHat' else False %}
{% set on_debian = True if os_family == 'Debian' else False %}
{# specific to fedora #}
{% set on_fedora = os == 'Fedora' %}
{% set url_base = 'https://kojipkgs.fedoraproject.org/packages/salt/' %}
{% set pkg_name = '{0}.{1}{2}'.format(pkg_version, 'fc', os_major_release) %}
{% set pkg_urls = {} %}
{% do pkgs.append('salt') if on_fedora %}
{% for pkg in pkgs %}
{% do pkg_urls.update({pkg: url_base + salt_version + '/' + pkg_name + '/noarch/' + pkg + '-' + salt_version + '-' + pkg_name + '.noarch.rpm'}) %}
{% endfor %}
{% set pkg_files = [] %}
{% for pkg in pkgs %}
{% do pkg_files.append('/tmp/' + pkg + '-' + salt_version + '-' + pkg_version + '.noarch.rpm') %}
{% endfor %}
{# FreeBSD variables #}
{% set repo_salt_fbsd = pillar.get('repo_salt_fbsd') %}
{% set use_repo_salt_fbsd = True if repo_salt_fbsd else False %}
{% set on_freebsd = True if os == 'FreeBSD' else False %}
{# Python versions #}
{% set python3 = salt['pillar.get']('python3', False) %}
{#{% set python3 = python3 if '2017' not in salt_version else False %}#}
{% set python_major_version = '3' if python3 else '2' %}
{% set python_version = 'python' %}
{% if '2016' not in salt_version %}
{% if os_major_release == 6 %}
{% set python_version = 'python2.7' %}
{% endif %}
{% endif %}
{% if python3 %}
{% set python_version = 'python3' %}
{% endif %}
{# set python repo dir #}
{% if on_rhel %}
{% set py_dir = 'py3' if python3 else 'yum' %}
{% elif on_debian %}
{% set py_dir = 'py3' if python3 else 'apt' %}
{% endif %}
{# Create a versioned package set to work around pkg.installed bugs #}
{% set version_token = '=' if os_family == 'Debian' else '-' %}
{% set versioned_pkgs = [] %}
{% set pkg_info = '' %}
{% if os_family == 'Debian' %}
{% set pkg_info = '+ds-1' %}
{% endif %}
{% if salt_version %}
{% for pkg in pkgs %}
{% do versioned_pkgs.append(pkg + version_token + salt_version + pkg_info) %}
{% endfor %}
{% endif %}
{# Used for specifying a 'dev' or 'staging' SaltStack repository #}
{% set dev = pillar.get('dev', '') %}
{% set dev = dev + '/' if dev else '' %}
{# Used for specifying a 'rc' packages SaltStack repository #}
{% set test_rc_pkgs = pillar.get('test_rc_pkgs', False) %}
{# Enable installing from EPEL testing #}
{% set testing = pillar.get('testing', False) %}
{# Allow explicitly specifying source repository SLS file with a pillar #}
{% set pkg_repo = pillar.get('pkg_repo', '') %}
{# Indicate that a SaltStack repository should be used #}
{% set use_saltstack = pillar.get('saltstack', False) %}
{# Whether to use a repository package if available to setup the repo and key #}
{% set use_repo_pkg = pillar.get('repo_pkg', False) %}
{# When using SaltStack repos, decide whether to use the 'latest' repo #}
{% set use_latest = pillar.get('latest', False) %}
{% set repo_version = 'latest' if use_latest else salt_version %}
{% set repo_user= pillar.get('repo_user', '') %}
{% set repo_passwd = pillar.get('repo_passwd', '') %}
{% set repo_auth = repo_user + ':' + repo_passwd + '@' %}
{# Set minion ID used for master<->local minion testing #}
{% set minion_id = salt['pillar.get']('minion_id', '{0}'.format(grains.get('id'))) %}
{# Smoke test the presence of these utilities #}
{% set utils = ['salt', 'salt-api', 'salt-call', 'salt-cloud', 'salt-cp', 'salt-key', 'salt-master', 'salt-minion', 'salt-proxy', 'salt-run', 'salt-ssh', 'salt-syndic', 'salt-unity', 'spm'] %}
{# Add Option to test and upgrade #}
{% set upgrade = pillar.get('upgrade', False) %}
{# Set paths for configuration files an misc variables#}
{% if on_smartos or on_freebsd %}
{% set minion_config = '/opt/local/etc/salt/minion' %}
{% set master_config = '' %}
{% set minion_id_config = '/opt/local/etc/salt/minion_id' %}
{% set pki_config = '/opt/local/etc/pki' %}
{% set service_master = 'svcadm enable salt:master' %}
{% set service_minion = 'svcadm enable salt:minion' %}
{% set file_roots = '/var/salt/file-roots/' %}
{% else %}
{% set minion_config = '/etc/salt/minion' %}
{% set master_config = '' %}
{% set minion_id_config = '/etc/salt/minion_id' %}
{% set pki_config = '/etc/salt/pki' %}
{% set service_master = 'service salt-master start' %}
{% set service_minion = 'service salt-minion start' %}
{% set file_roots = '/srv/salt' %}
{% endif %}
{# Miscellaneous options #}
{% set key_timeout = pillar.get('key_timeout', '130') %}
{# orchestration runner variables #}
{% set clean = salt['pillar.get']('clean', '') %}
{% set cloud_profile = salt['pillar.get']('cloud_profile', '') %}
{% set hosts = [] %}
{% set orch_master = salt['pillar.get']('orch_master', '') %}
{% set username = salt['pillar.get']('username', '') %}
{# orchestration runner solaris specific variables #}
{% set solarism_user = salt['pillar.get']('solarism_user') %}
{% set solarism_passwd = salt['pillar.get']('solarism_passwd') %}
{% set solarism_host = salt['pillar.get']('solarism_host') %}
{% set zone_pkgusr_passwd = salt['pillar.get']('zone_pkgusr_passwd') %}
{% set zone_root_passwd = salt['pillar.get']('zone_root_passwd') %}
{# solaris minion created in a zone variables #}
{%- set solarismin_user = salt['pillar.get']('solarismin_user') -%}
{%- set solarismin_passwd = salt['pillar.get']('solarismin_passwd') -%}
{# salt-api variables #}
{% set api_user = 'saltdev' %}
{% set api_passwd = 'saltdev' %}
{% set api_config = '/etc/salt/master.d/api.conf' %}
{# minion-only variables #}
{% set master_host = salt['pillar.get']('master_host') %}
{% set minion_utils = ['salt-call', 'salt-cp', 'salt-minion', 'salt-ssh', 'spm'] %}
{% set minion_only = salt['pillar.get']('minion_only', False) %}
{% set test_os = salt['pillar.get']('test_os', None) %}
{# windows-only variables #}
{% set linux_master_user = salt['pillar.get']('linux_master_user') %}
{% set linux_master_key = salt['pillar.get']('linux_master_key') %}
{% set win_arch = salt['pillar.get']('win_arch', '64') %}
{% set git_user = salt['pillar.get']('git_user', 'saltstack') %}
{# crypto variables #}
{% set crypto_library = salt['pillar.get']('crypto_library', 'default') %}