尝试构建与属性匹配的服务器列表(在本例中为ec2_tag),以便为特定任务调度特定服务器.
我正在尝试与selectattr匹配:
servers: "{{ hostvars[inventory_hostname]|selectattr('ec2_tag_Role','match','cassandra_db_seed_node') | map(attribute='inventory_hostname') |list}}"
虽然我从Ansible得到了类似错误:
fatal: [X.X.X.X]: Failed! => {"Failed": true,"msg": "Unexpected templating type error occurred on ({{ hostvars[inventory_hostname]|selectattr('ec2_tag_Role','cassandra_db_seed_node') | map(attribute='inventory_hostname') |list}}): expected string or buffer"}
我在这里错过了什么?
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。