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 >= 3005 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-archive-keyring.gpg 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. libgit2: libgit2-22
  43. pyinotify: python-pyinotify
  44. gitfs:
  45. pygit2:
  46. install_from_source: true
  47. version: 0.22.1
  48. git:
  49. require_state: false
  50. install_from_package: git
  51. libgit2:
  52. install_from_source: false
  53. RedHat:
  54. pkgrepo_name: saltstack
  55. pkgrepo_humanname: SaltStack repo for RHEL/CentOS $releasever
  56. pkgrepo: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/redhat/$releasever/$basearch/{{ salt_release }}'
  57. key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/redhat/$releasever/$basearch/{{ salt_release }}/{{ salt_repo_pubkey_filename }}'
  58. pygit2: python-pygit2
  59. python_git: GitPython
  60. gitfs:
  61. gitpython:
  62. install_from_source: false
  63. pygit2:
  64. install_from_source: false
  65. git:
  66. require_state: false
  67. install_from_package: git
  68. master:
  69. gitfs_provider: pygit2
  70. Suse:
  71. pkgrepo_humanname: 'Salt releases for SLE-based SUSE products (openSUSE_{{ opensuse_repo_suffix }})'
  72. pkgrepo: 'https://download.opensuse.org/repositories/systemsmanagement:/saltstack/openSUSE_{{ opensuse_repo_suffix }}/'
  73. key_url: 'https://download.opensuse.org/repositories/systemsmanagement:/saltstack/openSUSE_{{ opensuse_repo_suffix }}/repodata/repomd.xml.key'
  74. pygit2: python-pygit2
  75. pyinotify: python-pyinotify
  76. gitfs:
  77. pygit2:
  78. install_from_source: false
  79. git:
  80. require_state: false
  81. install_from_package: git
  82. master:
  83. gitfs_provider: pygit2
  84. Gentoo:
  85. salt_master: app-admin/salt
  86. salt_minion: app-admin/salt
  87. salt_syndic: app-admin/salt
  88. salt_api: app-admin/salt
  89. salt_cloud: app-admin/salt
  90. pyinotify: dev-python/pyinotify
  91. Arch:
  92. salt_master: salt
  93. salt_minion: salt
  94. salt_syndic: salt
  95. salt_cloud: salt
  96. salt_api: salt
  97. salt_ssh: salt
  98. python_git: python2-gitpython
  99. pygit2: python2-pygit2
  100. libgit2: libgit2
  101. pyinotify: python2-pyinotify
  102. Alpine:
  103. salt-master: salt-master
  104. salt_minion: salt-minion
  105. salt_syndic: salt-syndic
  106. salt_cloud: salt-cloud
  107. salt_api: salt-api
  108. salt_ssh: salt-ssh
  109. pygit2: py2-pygit2
  110. libgit2: libgit2
  111. FreeBSD:
  112. rootgroup: wheel
  113. salt_master: {{ py_ver_repr or 'py27' }}-salt
  114. salt_minion: {{ py_ver_repr or 'py27' }}-salt
  115. salt_syndic: {{ py_ver_repr or 'py27' }}-salt
  116. salt_cloud: {{ py_ver_repr or 'py27' }}-salt
  117. salt_api: {{ py_ver_repr or 'py27' }}-salt
  118. salt_ssh: {{ py_ver_repr or 'py27' }}-salt
  119. python_git: {{ py_ver_repr or 'py27' }}-GitPython
  120. pygit2: {{ py_ver_repr or 'py27' }}-pygit2
  121. config_path: /usr/local/etc/salt
  122. minion_service: salt_minion
  123. master_service: salt_master
  124. api_service: salt_api
  125. syndic_service: salt_syndic
  126. OpenBSD:
  127. salt_master: salt
  128. salt_minion: salt
  129. salt_syndic: salt
  130. salt_cloud: salt
  131. salt_api: salt
  132. salt_ssh: salt
  133. config_path: /etc/salt
  134. minion_service: salt_minion
  135. master_service: salt_master
  136. python_git: py-GitPython
  137. Windows:
  138. salt_minion: salt-minion{{ '-' ~ py_ver_repr if py_ver_repr else '' }}
  139. config_path: 'C:\salt\conf'
  140. minion_service: salt-minion
  141. rootuser: {{ rootuser | d('') }}
  142. MacOS:
  143. salt_master: saltstack
  144. salt_minion: salt
  145. salt_minion_pkg_source: ''
  146. salt_minion_pkg_hash: ''
  147. config_path: /private/etc/salt
  148. minion_service: com.saltstack.salt.minion
  149. ## from template-formula
  150. rootuser: {{ rootuser | d('') }}
  151. rootgroup: {{ rootgroup | d('') }}