如何使用盐堆栈从 tar 球安装软件包?例如,我想从远程 tar 球安装 Apache Tomcat - 我该如何实现?我尝试使用 file.managed,但它在 source_hash 中显示不匹配 - 如何使用源 URL 动态预测校验和?
{% set tomcat = pillar.get('tomcat', {}) -%}
{% set version = tomcat.get('version', 'x.x.x') -%}
{% set tomcat_package = source + '/tomact-' + version + '.tar.gz' -%}
file.managed:
- name: {{ tomcat_package }}
- source: http://tomcat.org/download/tomcat-{{ version }}.tar.gz
- source_hash: {{ checksum }}