Saltstack Official Salt Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

169 行
6.1KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. {%- set py_ver_repr = salt['pillar.get']('salt:py_ver', '') %}
  5. {%- set osrelease = salt['grains.get']('osrelease', '') %}
  6. {%- set salt_release = salt['pillar.get']('salt:release', 'latest') | string %}
  7. {%- if salt_release.split('.')|length >= 3 %}
  8. {%- set salt_release = 'archive/' ~ salt_release %}
  9. {%- endif %}
  10. {%- set osfamily_lower = salt['grains.get']('os_family')|lower %}
  11. {%- set osmajorrelease = salt['grains.get']('osmajorrelease', osrelease)|string %}
  12. {%- set oscodename = salt['grains.get']('oscodename') %}
  13. {%- set opensuse_repo_suffix = 'Leap_' ~ osrelease if salt['grains.get']('osfinger', '') == 'Leap-15' else 'Tumbleweed' %}
  14. # Different salt versions have different repo's, keyrings, pubkeys and hashes.
  15. # 'latest' cannot be coerced into an integer and it's result will be int(0).
  16. {%- if salt_release.split('.')[0] | int >= 3006 or salt_release.split('.')[0] | int == 0 %}
  17. {%- set default_repo = 'https://repo.saltproject.io/salt' %}
  18. {%- set default_repo_keyring_filename = 'SALT-PROJECT-GPG-PUBKEY-2023.gpg' %}
  19. {%- set default_repo_pubkey_filename = 'SALT-PROJECT-GPG-PUBKEY-2023.pub' %}
  20. {%- set default_repo_keyring_hash = 'sha256=c6f6cbcd96fdb130b1dde8dcfc05d46a3a3f322ff0514f98e2e6473896243472' %}
  21. {%- else %}
  22. {%- set default_repo = 'https://repo.saltproject.io' %}
  23. {%- set default_repo_keyring_filename = 'salt-archive-keyring.gpg' %}
  24. {%- set default_repo_pubkey_filename = 'SALTSTACK-GPG-KEY.pub' %}
  25. {%- set default_repo_keyring_hash = 'sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47' %}
  26. {%- endif %}
  27. {%- set salt_repo = salt['pillar.get']('salt:repo', default_repo) %}
  28. {%- set salt_repo_keyring_filename = salt['pillar.get']('salt:repo_keyring_filename', default_repo_keyring_filename) %}
  29. {%- set salt_repo_pubkey_filename = salt['pillar.get']('salt:repo_keyring_filename', default_repo_pubkey_filename) %}
  30. {%- set salt_repo_keyring_hash = salt['pillar.get']('salt:repo_keyring_hash', default_repo_keyring_hash) %}
  31. #from template-formula
  32. {%- if grains.os_family == 'MacOS' %}
  33. {%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %}
  34. {%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
  35. {%- elif grains.os_family == 'Windows' %}
  36. {%- set rootuser = salt['cmd.run']("whoami").split("\\")[1] %}
  37. {%- endif %}
  38. Debian:
  39. pkgrepo: 'deb [signed-by=/usr/share/keyrings/{{ salt_repo_keyring_filename }} arch=amd64] {{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
  40. pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/{{ osfamily_lower }}/{{ osmajorrelease }}/amd64/{{ salt_release }}/{{ salt_repo_keyring_filename }}' #' <- vim syntax highlight fix
  41. pkgrepo_keyring_hash: {{ salt_repo_keyring_hash }}
  42. pkgrepo_keyring_filename: {{ salt_repo_keyring_filename }}
  43. libgit2: libgit2-22
  44. pyinotify: python-pyinotify
  45. gitfs:
  46. pygit2:
  47. install_from_source: true
  48. version: 0.22.1
  49. git:
  50. require_state: false
  51. install_from_package: git
  52. libgit2:
  53. install_from_source: false
  54. RedHat:
  55. pkgrepo_name: saltstack
  56. pkgrepo_humanname: SaltStack repo for RHEL/CentOS $releasever
  57. pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}'
  58. key_url: '{{ salt_repo }}/{{ py_ver_repr or 'py3' }}/redhat/$releasever/$basearch/{{ salt_release }}/{{ salt_repo_pubkey_filename }}'
  59. pygit2: python-pygit2
  60. python_git: GitPython
  61. gitfs:
  62. gitpython:
  63. install_from_source: false
  64. pygit2:
  65. install_from_source: false
  66. git:
  67. require_state: false
  68. install_from_package: git
  69. master:
  70. gitfs_provider: pygit2
  71. Suse:
  72. pkgrepo_humanname: 'Salt releases for SLE-based SUSE products (openSUSE_{{ opensuse_repo_suffix }})'
  73. pkgrepo: 'https://download.opensuse.org/repositories/systemsmanagement:/saltstack/openSUSE_{{ opensuse_repo_suffix }}/'
  74. key_url: 'https://download.opensuse.org/repositories/systemsmanagement:/saltstack/openSUSE_{{ opensuse_repo_suffix }}/repodata/repomd.xml.key'
  75. pygit2: python-pygit2
  76. pyinotify: python-pyinotify
  77. gitfs:
  78. pygit2:
  79. install_from_source: false
  80. git:
  81. require_state: false
  82. install_from_package: git
  83. master:
  84. gitfs_provider: pygit2
  85. Gentoo:
  86. salt_master: app-admin/salt
  87. salt_minion: app-admin/salt
  88. salt_syndic: app-admin/salt
  89. salt_api: app-admin/salt
  90. salt_cloud: app-admin/salt
  91. pyinotify: dev-python/pyinotify
  92. Arch:
  93. salt_master: salt
  94. salt_minion: salt
  95. salt_syndic: salt
  96. salt_cloud: salt
  97. salt_api: salt
  98. salt_ssh: salt
  99. python_git: python2-gitpython
  100. pygit2: python2-pygit2
  101. libgit2: libgit2
  102. pyinotify: python2-pyinotify
  103. Alpine:
  104. salt-master: salt-master
  105. salt_minion: salt-minion
  106. salt_syndic: salt-syndic
  107. salt_cloud: salt-cloud
  108. salt_api: salt-api
  109. salt_ssh: salt-ssh
  110. pygit2: py2-pygit2
  111. libgit2: libgit2
  112. FreeBSD:
  113. rootgroup: wheel
  114. salt_master: {{ py_ver_repr or 'py27' }}-salt
  115. salt_minion: {{ py_ver_repr or 'py27' }}-salt
  116. salt_syndic: {{ py_ver_repr or 'py27' }}-salt
  117. salt_cloud: {{ py_ver_repr or 'py27' }}-salt
  118. salt_api: {{ py_ver_repr or 'py27' }}-salt
  119. salt_ssh: {{ py_ver_repr or 'py27' }}-salt
  120. python_git: {{ py_ver_repr or 'py27' }}-GitPython
  121. pygit2: {{ py_ver_repr or 'py27' }}-pygit2
  122. config_path: /usr/local/etc/salt
  123. minion_service: salt_minion
  124. master_service: salt_master
  125. api_service: salt_api
  126. syndic_service: salt_syndic
  127. OpenBSD:
  128. salt_master: salt
  129. salt_minion: salt
  130. salt_syndic: salt
  131. salt_cloud: salt
  132. salt_api: salt
  133. salt_ssh: salt
  134. config_path: /etc/salt
  135. minion_service: salt_minion
  136. master_service: salt_master
  137. python_git: py-GitPython
  138. Windows:
  139. salt_minion: salt-minion{{ '-' ~ py_ver_repr if py_ver_repr else '' }}
  140. config_path: 'C:\salt\conf'
  141. minion_service: salt-minion
  142. rootuser: {{ rootuser | d('') }}
  143. MacOS:
  144. salt_master: saltstack
  145. salt_minion: salt
  146. salt_minion_pkg_source: ''
  147. salt_minion_pkg_hash: ''
  148. config_path: /private/etc/salt
  149. minion_service: com.saltstack.salt.minion
  150. ## from template-formula
  151. rootuser: {{ rootuser | d('') }}
  152. rootgroup: {{ rootgroup | d('') }}