ansible - 错误!在 git clone ansible playbook 的任务中未检测到模块/操作
问题描述
我无法弄清楚这里发生了什么。这是我非常简单的 ansible 剧本:
---
- name: "Playing with Ansible and Git"
hosts: localhost
connection: local
tasks:
- name: "clone the repo"
- become: yes
- git:
repo: https://github.com/ansible/ansible-examples.git
dest: /opt/
clone: yes
update: yes
这是我的 ansible-playbook 版本
ansible-playbook --version
ansible-playbook 2.9.6
错误
ERROR! no module/action detected in task.
The error appears to be in 'local.yml': line 6, column 11, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- name: "clone the repo"
^ here
我跑过去ansible-playbook local.yml
我真的无法弄清楚这里出了什么问题。
解决方案
我能够弄清楚这个问题。这工作正常。我只需要-
在 git 前面删除。
---
- name: "Playing with Ansible and Git"
hosts: localhost
connection: local
tasks:
- name: "clone the repo"
git:
repo: https://github.com/ansible/ansible-examples.git
dest: /opt/
clone: yes
update: yes
推荐阅读
- python - Plotly:Dash 如何在没有导入 plotly 或 plotly express 的情况下描述数据
- javascript - 我想使用位置功能向#cart-total-remove 添加一个类我尝试了很多方法但没有奏效
- excel - 根据来自其他单元格的匹配名称填充单元格
- powershell - 外壳 | 如何以编程方式遍历变量名
- macos - 如何在 macOS 上区分 USB 硬盘和 SSD 与 USB 密钥/笔式驱动器
- python - 如何使用点积在 gurobi-python 中进行目标函数?
- c# - 找不到适合类型“System.Collections.Generic.IEnumerable`1[TeamCloud.Areas.Identity.Data.TeamCloudUser]”的构造函数
- c - 警告:循环中指针和整数之间的比较
- python - 错误构造函数参数应该是 str 使用枕头、aiohttp 和 discord.py
- python-3.x - 如何在python中的类函数中将类的实例表示为字符串?