Ansible 2.8.0 错误:模板化时发生未处理的异常

问题描述 投票:0回答:0

我是 Ansible 的新手。我有这段代码是通过 CircleCI 触发的,然后依次运行 Terraform。

我的剧本片段:

- hosts: localhost
  connection: local
  gather_facts: false
  vars:    
    tf_region: "{{ tf_region | default('eu-west-1') }}"
    env_type: "{{ tf_vars_prefix }}"
  serial: 1
    roles:
    - role: tf_init
      tags: [ 'tf_init' ]

    - role: applications
      tags: [ 'applications' ]

当这触发

applications
角色(使用区域变量的地方)时,我得到这个错误:

   "msg": "An unhandled exception occurred while templating '{{ tf_region | default('*********') }}'.
 original message: recursive loop detected in template string: {{ tf_region | default('*********') }}"

这里发生了什么?我需要通过 CircleCI 传递这个变量值吗?

ansible circleci cicd
© www.soinside.com 2019 - 2024. All rights reserved.