Ansible:调用Python对象时超出了最大递归深度

时间:2019-07-12 14:05:27

标签: ansible

我在group_vars/all/jira.yml中具有以下定义:

jira:
  package: "atlassian-jira-software-7.13.0.tar.gz"
  download_url: "https://product-downloads.atlassian.com/software/jira/downloads/{{jira.package}}"
  install_file: "/opt/atlassian/{{jira.package}}"

我在剧本中使用了定义:

- name: Jira-Download
  get_url:
    url: "{{jira.download_url}}"
    dest:  "{{jira.install_file}}"
  environment: "{{proxy}}"

运行剧本时,出现以下错误:

fatal: [devel]: FAILED! => {"msg": "An unhandled exception occurred while templating '{u'install_file': u'/opt/atlassian/{{jira.package}}', u'package': u'atlassian-jira-software-7.13.0.tar.gz', u'download_url': u'https://product-downloads.atlassian.com/software/jira/downloads/{{jira.package}}', u'database': {u'password': u'2hPSxC1mTeeZozU8jwl1'}}'. Error was a , original message: An unhandled exception occurred while templating '{u'install_file': u'/opt/atlassian/{{jira.package}}', u'package': u'atlassian-jira-software-7.13.0.tar.gz', u'download_url': u'https://product-downloads.atlassian.com/software/jira/downloads/{{jira.package}}', u'database': {u'password': u'2hPSxC1mTeeZozU8jwl1'}}'. Error was a , original message: An unhandled exception occurred while templating '{u'install_file': u'/opt/atlassian/{{jira.package}}', u'package': u'atlassian-jira-software-7.13.0.tar.gz', u'download_url': u'https://product-downloads.atlassian.com/software/jira/downloads/{{jira.package}}', u'database': {u'password': u'2hPSxC1mTeeZozU8jwl1'}}'. Error was a , original message: 

最后是:

  

调用Python对象时超出了最大递归深度

我在错误消息中看到了递归,但是我不明白我的定义是如何导致这种递归的。有人可以解释吗?

更新

这是一个MCVE:

- hosts: localhost
  connection: local

  vars:
    x:
      a: "1"
      b: "{{x.a}}"

  tasks:
    - debug: var=x

0 个答案:

没有答案