变量

时间:2015-11-26 22:07:37

标签: jinja2 ansible

如何在Ansible

中调用变量内的变量

所以我有以下

Meta> Main.yml

 - { role: core_nat_segment, foo: 'bar' }

任务> Main.yml

- name: Create resources for e-commerce services
  cloudformation:
    stack_name: "{{aws_environment}}-yyy"
    state: "present"
    region: "{{aws_region}}"
    template: "xx
    template_parameters:
      ECSClusterName: "{{{{segment_name}}_private_stack.stack_outputs.PrivateCluster}}"

当我运行剧本时,我收到以下错误

fatal: [localhost] => Failed to template {{{{segment_name}}_private_stack.stack_outputs.PrivateCluster}}: template error while templating string: expected token ':', got '}'

我期待的输出是

bar_private_stack.stack.stack_outputs.PrivateCluster

非常感谢任何帮助指针。

0 个答案:

没有答案