Skip to content

Commit a399ab2

Browse files
authored
Merge branch 'master' into version
2 parents 550f81b + cb0219d commit a399ab2

File tree

16 files changed

+92
-23
lines changed

16 files changed

+92
-23
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ env:
1717
matrix:
1818
- INSTANCE: v2019-2-py3-debian-9
1919
- INSTANCE: v2019-2-py3-ubuntu-1804
20-
- INSTANCE: v2019-2-py2-centos-7
20+
# - INSTANCE: v2019-2-py2-centos-7
2121
- INSTANCE: v2019-2-py2-fedora-29
2222

2323
- INSTANCE: v2018-3-py2-debian-8
2424
- INSTANCE: v2018-3-py2-ubuntu-1604
2525
- INSTANCE: v2018-3-py2-bootstrap-centos-6
2626
- INSTANCE: v2018-3-py2-forced-version-fedora-28
27-
- INSTANCE: v2018-3-py2-opensuse-423
27+
# - INSTANCE: v2018-3-py2-opensuse-423
2828

2929
- INSTANCE: v2017-7-py2-debian-8
3030
- INSTANCE: v2017-7-py2-ubuntu-1604

AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ Avatar|Contributor|Contributions
105105

106106
---
107107

108-
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-06-13.
108+
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-08-01.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.58.1](https://github.com/saltstack-formulas/salt-formula/compare/v0.58.0...v0.58.1) (2019-08-01)
4+
5+
6+
### Bug Fixes
7+
8+
* **travis:** disable two failing platforms until they can be fixed ([5fcadcd](https://github.com/saltstack-formulas/salt-formula/commit/5fcadcd))
9+
310
# [0.58.0](https://github.com/saltstack-formulas/salt-formula/compare/v0.57.1...v0.58.0) (2019-06-13)
411

512

FORMULA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: salt
22
os: Debian, Redhat, Suse, Arch, Gentoo, FreeBSD, Windows
33
os_family: Debian, Redhat, Suse, Arch, Gentoo, FreeBSD, Windows
4-
version: 0.58.0
4+
version: 0.58.1
55
release: 1
66
minimum_version: 2015.8
77
summary: Formula for install Saltstack

docs/AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,4 @@ This list is sorted by the number of commits per contributor in *descending* ord
311311

312312
----
313313

314-
Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-06-13.
314+
Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-08-01.

docs/CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Changelog
33
=========
44

5+
`0.58.1 <https://github.com/saltstack-formulas/salt-formula/compare/v0.58.0...v0.58.1>`_ (2019-08-01)
6+
---------------------------------------------------------------------------------------------------------
7+
8+
Bug Fixes
9+
^^^^^^^^^
10+
11+
12+
* **travis:** disable two failing platforms until they can be fixed (\ `5fcadcd <https://github.com/saltstack-formulas/salt-formula/commit/5fcadcd>`_\ )
13+
514
`0.58.0 <https://github.com/saltstack-formulas/salt-formula/compare/v0.57.1...v0.58.0>`_ (2019-06-13)
615
---------------------------------------------------------------------------------------------------------
716

salt/defaults.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# vim: ft=yaml
33
salt:
44
version: ''
5+
rootuser: root
6+
rootgroup: root
57
install_packages: True
68
use_pip: False
79
clean_config_d_dir: True

salt/formulas.sls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
{%- from "salt/formulas.jinja" import formulas_git_opt with context %}
77
{%- from "salt/formulas.jinja" import formulas_opts_for_git_latest with context %}
88
9+
## from template-formula
10+
{%- set tplroot = tpldir.split('/')[0] %}
11+
{%- from tplroot ~ "/map.jinja" import salt_settings with context %}
12+
913
# Loop over all formulas listed in pillar data
1014
{%- for env, entries in salt['pillar.get']('salt_formulas:list', {}).items() %}
1115
{%- for entry in entries %}
@@ -31,6 +35,8 @@
3135
{%- for key, value in salt['pillar.get']('salt_formulas:basedir_opts',
3236
{'makedirs': True}).items() %}
3337
- {{ key }}: {{ value }}
38+
- user: {{ salt_settings.rootuser }}
39+
- group: {{ salt_settings.rootgroup }}
3440
{%- endfor %}
3541
{%- endif %}
3642

salt/minion.sls

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
{%- from tplroot ~ "/map.jinja" import salt_settings with context %}
33
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
44
5-
{% if salt_settings.install_packages and grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source != '' and salt_settings.version != '' %}
6-
{# only download IF we know where to get the pkg from and if we know what version to check the current install (if installed) against #}
7-
{# e.g. don't download unless it appears as though we're about to try and upgrade the minion #}
5+
{% if salt_settings.install_packages and grains.os == 'MacOS' %}
86
download-salt-minion:
7+
{% if salt_settings.salt_minion_pkg_source %}
8+
{# only download IF we know where to get the pkg from and what version to check the current install (if installed) against #}
9+
{# e.g. don't download unless it appears as though we're about to try and upgrade the minion #}
910
file.managed:
1011
- name: '/tmp/salt.pkg'
1112
- source: {{ salt_settings.salt_minion_pkg_source }}
12-
{% if salt_settings.salt_minion_pkg_hash != '' %}
13+
{%- if salt_settings.salt_minion_pkg_hash %}
1314
- source_hash: {{ salt_settings.salt_minion_pkg_hash }}
1415
{% else %}
1516
- skip_verify: True
@@ -18,27 +19,36 @@ download-salt-minion:
1819
- group: wheel
1920
- mode: 0644
2021
- unless:
21-
- '/opt/salt/bin/salt-minion --version | grep {{ salt_settings.version }}'
22+
- test -n "{{ salt_settings.version }}" && '/opt/salt/bin/salt-minion --version=.*{{ salt_settings.version }}.*'
2223
- require_in:
2324
- macpackage: salt-minion
25+
{%- elif "workaround https://github.com/saltstack/salt/issues/49348" %}
26+
cmd.run:
27+
- name: /usr/local/bin/brew install {{ salt_settings.salt_minion }}
28+
- onlyif: test -x /usr/local/bin/brew
29+
- runas: {{ salt_settings.rootuser }}
30+
{%- endif %}
2431
{% endif %}
2532
2633
salt-minion:
2734
{% if salt_settings.install_packages %}
28-
{%- if grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source != '' and salt_settings.version != '' %}
35+
{%- if grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source %}
2936
macpackage.installed:
3037
- name: '/tmp/salt.pkg'
3138
- target: /
3239
{# macpackage.installed behaves weirdly with version_check; version_check detects difference but fails to actually complete install. #}
3340
{# use force == True as workaround #}
3441
- force: True
35-
- version_check: /opt/salt/bin/salt-minion --version=.*{{ salt_settings.version }}.*
42+
- unless:
43+
- test -n "{{ salt_settings.version }}" && '/opt/salt/bin/salt-minion --version=.*{{ salt_settings.version }}.*'
3644
- require_in:
3745
- service: salt-minion
38-
{%- else %}
46+
- onchanges_in:
47+
- cmd: remove-macpackage-salt
48+
{%- elif grains.os != 'MacOS' and "workaround https://github.com/saltstack/salt/issues/49348" %}
3949
pkg.installed:
4050
- name: {{ salt_settings.salt_minion }}
41-
{%- if salt_settings.version is defined %}
51+
{%- if salt_settings.version %}
4252
- version: {{ salt_settings.version }}
4353
{%- endif %}
4454
- require_in:
@@ -89,8 +99,10 @@ salt-minion:
8999
{%- endif %}
90100
- onchanges:
91101
{%- if salt_settings.install_packages %}
92-
{%- if grains.os == 'MacOS' %}
102+
{%- if grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source %}
93103
- macpackage: salt-minion
104+
{%- elif grains.os == 'MacOS' %}
105+
- cmd: download-salt-minion
94106
{%- else %}
95107
- pkg: salt-minion
96108
{%- endif %}
@@ -113,11 +125,13 @@ restart-salt-minion:
113125
- pkg: at
114126
- onchanges:
115127
{%- if salt_settings.install_packages %}
116-
{%- if grains.os == 'MacOS' %}
128+
{%- if grains.os == 'MacOS' and salt_settings.salt_minion_pkg_source %}
117129
- macpackage: salt-minion
118-
{%- else %}
130+
{%- elif grains.os == 'MacOS' %}
131+
- cmd: download-salt-minion
132+
{%- else %}
119133
- pkg: salt-minion
120-
{%- endif %}
134+
{%- endif %}
121135
{%- endif %}
122136
- file: salt-minion
123137
- file: remove-old-minion-conf-file
@@ -146,8 +160,7 @@ remove-old-minion-conf-file:
146160
147161
{% if grains.os == 'MacOS' %}
148162
remove-macpackage-salt:
149-
cmd.run:
150-
- name: 'rm -f /tmp/salt.pkg'
151-
- onchanges:
152-
- macpackage: salt-minion
163+
file.absent:
164+
- name: /tmp/salt.pkg
165+
- force: True
153166
{% endif %}

salt/osfamilymap.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
{% set osmajorrelease = salt['grains.get']('osmajorrelease', osrelease)|string %}
1515
{% set oscodename = salt['grains.get']('oscodename') %}
1616

17+
#from template-formula
18+
{%- if grains.os == 'MacOS' %}
19+
{%- set macos_rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %}
20+
{%- set macos_rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
21+
{%- endif %}
22+
1723
Debian:
1824
pkgrepo: 'deb http://repo.saltstack.com/{{ py_ver_repr }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
1925
key_url: 'https://repo.saltstack.com/{{ py_ver_repr }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
@@ -90,6 +96,7 @@ Alpine:
9096
libgit2: libgit2
9197

9298
FreeBSD:
99+
rootgroup: wheel
93100
salt_master: py27-salt
94101
salt_minion: py27-salt
95102
salt_syndic: py27-salt
@@ -122,8 +129,11 @@ Windows:
122129
minion_service: salt-minion
123130

124131
MacOS:
125-
salt_minion: com.saltstack.salt
132+
salt_minion: salt
126133
salt_minion_pkg_source: ''
127134
salt_minion_pkg_hash: ''
128135
config_path: /private/etc/salt
129136
minion_service: com.saltstack.salt.minion
137+
## from template-formula
138+
rootuser: {{ macos_rootuser | d('') }}
139+
rootgroup: {{ macos_rootgroup | d('') }}

0 commit comments

Comments
 (0)