Ansible:[不建议使用警告]:不建议使用裸变量

编程入门 行业动态 更新时间:2024-10-22 05:04:54
本文介绍了Ansible:[不建议使用警告]:不建议使用裸变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我认为这是剧本中产生错误的部分.我应该如何重写这一部分?

I think this is the part of the playbook that is generating the error. How should I be re-writing this part?

roles: - role: json-transform json_transforms: '{{ clientValidation.json_transforms}}'

它会引发以下警告:

[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{json_transforms}}'). This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

推荐答案

顶层似乎没有任何问题-可能是您的角色内部存在某些问题.不推荐使用的裸变量通常在with_xxx循环上发生;例如:

It doesn't look like there's anything wrong with your top level- it's probably something inside your role. Deprecated bare variables usually occur on a with_xxx loop; eg:

- hosts: blar vars: items: - one - two tasks: - debug: msg="hi from {{ item }}" with_items: items

在这种情况下,它告诉您with_items: items应该是with_items: "{{ items }}".

In this case, it's telling you that with_items: items should be with_items: "{{ items }}".

更多推荐

Ansible:[不建议使用警告]:不建议使用裸变量

本文发布于:2023-11-24 23:05:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627251.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:建议   变量   Ansible

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!