我需要同步(rsync)一些Dockerfile,以及其他.yml到远程计算机。
这些文件位于"host_vars/“文件夹下。
运行简单的“同步”命令时,读取Dockerfile并引发错误,因为Dockerfile不是yml格式.(戏剧!)
此外,如果我需要部署一个docker-come.yml,则会引发另一个错误。
有一种方法可以告诉ansible不加载某些选定的文件?
设置不同的名称,它不起作用。
Dockerfile错误:
ERROR! Syntax Error while loading YAML.
did not find expected <document start>
The error appears to have been in '/.../Dockerfile line 4, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
RUN apt update && apt install -y graphite-carbon graphite-web nginx supervisor && apt-get autoclean
^ heredocker-compose.yml错误
ERROR! failed to combine variables, expected dicts but got a 'dict' and a 'list':
....谢谢你的帮助。
发布于 2020-04-12 21:17:57
我需要同步(rsync)一些Dockerfile,以及其他.yml到远程计算机。这些文件位于"host_vars/“文件夹下。
将非vars文件放入名为host_vars的文件夹是不合适的。Ansible希望在host_vars和vars中找到的所有文件都是JSON或yaml格式的键值对,它们将用来创建隐式变量。
如果您想打包文件以便随角色一起旅行,请将它们放在files文件夹中;如果它们是参数化的,则将它们放在templates文件夹中,就像人们从精细手册中可以看到的那样。
https://stackoverflow.com/questions/61177867
复制相似问题