我是 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 传递这个变量值吗?