在 Ansible 的变量文件中使用变量
Use variables inside variable file in Ansible
我有一个 Ansible vars_file 比如:
jmeter:
version: "5.3"
name: "apache-jmeter-{{ jmeter.version }}"
archive: "{{ jmeter.name }}.zip"
url: "https://archive.apache.org/dist/jmeter/binaries/{{ jmeter.archive }}"
这是要走的路吗?我收到错误。有人有建议吗?
您需要将其展平,因为在您尝试使用它时 jmeter
尚未定义。
jmeter_version: "5.3"
jmeter_name: "apache-jmeter-{{ jmeter_version }}"
jmeter_archive: "{{ jmeter_name }}.zip"
jmeter_url: "https://archive.apache.org/dist/jmeter/binaries/{{ jmeter_archive }}"
我有一个 Ansible vars_file 比如:
jmeter:
version: "5.3"
name: "apache-jmeter-{{ jmeter.version }}"
archive: "{{ jmeter.name }}.zip"
url: "https://archive.apache.org/dist/jmeter/binaries/{{ jmeter.archive }}"
这是要走的路吗?我收到错误。有人有建议吗?
您需要将其展平,因为在您尝试使用它时 jmeter
尚未定义。
jmeter_version: "5.3"
jmeter_name: "apache-jmeter-{{ jmeter_version }}"
jmeter_archive: "{{ jmeter_name }}.zip"
jmeter_url: "https://archive.apache.org/dist/jmeter/binaries/{{ jmeter_archive }}"