- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想配置 ansible playbook,放置一些代码来启动服务并向电报发送通知,但我收到了这个错误。我认为这不是打字错误,而是社区通用电报有一些错误。在此之前我已经运行了相同的过程但没有错误。现在我尝试重新安装新服务器并执行相同的过程,但出现此错误。
ERROR! couldn't resolve module/action 'community.general.telegram'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/etc/ansible/playbook/start.yml': line 10, column 6, but maybe elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: send notify to telegram
^ here
开始.yml
---
- name: testing playbook
hosts: server
tasks:
- name: start apache service
service:
name: apache2
state: started
- name: send notify to telegram
community.general.telegram:
token: 'telegram token'
api_args:
chat_id: telegramid
parse_mode: "markdown"
text: "Apache Web service has been started!"
disable_web_page_preview: True
disable_notification: True
安装流程
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
sudo apt install dirmngr -y
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
sudo apt update
sudo apt install -y ansible
sudo ansible-galaxy collection install community.general
Ansible 版本
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
sudo ansible-galaxy collection install community.general
Process install dependency map
Starting collection install process
Skipping 'community.general' as it is already installed
最佳答案
根据documentation您需要添加 collection
关键词
但也来自 2.9 版本模块的文档 telegram你可以在没有收集的情况下做到这一点。
所以,要么使用:
collections:
- community.general
或者
- name: send notify to telegram
telegram:
token: 'telegram token'
api_args:
chat_id: telegramid
parse_mode: "markdown"
text: "Apache Web service has been started!"
disable_web_page_preview: True
disable_notification: True
它应该工作。
关于ubuntu - 为什么社区通用电报ansible会出现这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72283066/
如何使用 Facebook API 查找 Facebook 网址是社区网址或个人资料网址 例如 http://www.facebook.com/adelphi.panthers http://www.
我正在寻找 Erlang 问答平台/社区进行讨论和澄清。我现在使用 StackOverflow 和 erlangforums.com。两个社区都很棒。有没有其他的问答平台? 我检查了以下维护 Erla
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 4 年前。 Improve this qu
我可以使用下面的代码来生成和绘制社区: wc <- walktrap.community(subgraph) modularity(wc) membership(wc) layout <-la
我对 Chef 有点陌生,并且已经完成了教程,但我开始认为我不是错的人: 我正在尝试在 CentOS 7.2 上安装 Java。它无法安装(显然) - 但将 tarball 提取到正确的位置,但添加了
我做了很多 XSLT 编程。我也做 Java、PL/SQL、JavaScript 和其他一些。我可以通过网络轻松找到 Java 和 JavaScript 程序员社区。 PL/SQL 稍微难一点,但介于
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 7 年前。 Improve this qu
我想了解带有实际信息的 python 资源 - 新闻、文章、论坛(英语/美国 - 讲)。我现在学习了python(我已经有很好的c/c++知识),我需要的不仅仅是官方文档/教程。我想了解Python编
我需要了解 Postgresql。我正在尝试分支一个依赖于 Oracle 的应用程序框架来使用 Postgresql。我可以通过网络轻松找到 Java 和 JavaScript 程序员社区。 Orac
我正在使用 AgGrid 社区版本和 React。我试图在标题中的每一列上显示一个复选框。选择时应突出显示所选列下的单元格。此外,我需要记录所选列的更改。 我的columnDefs是基于后端数据构建的
有点好奇实际上有多少人使用 C++/CLI?那么有多少人在使用它呢?人们是否只在托管环境下寻找程序员的特定工作?围绕 c++/cli 的社区有多大?从我目前看到的情况来看,有不少语法变化,作为 C++
我在 Odoov9 社区模块上有一个选择字段 但是,每次我点击它,选择一个记录时,它都会抛出这个错误: Error: No conversion for undefined http://localh
我在cashflow_report模型上有这个方法: class cashflow_report(models.Model): _name = 'cashflow.report' _d
我正在尝试通过模块将一个表中的字段添加到另一个表中。 具体来说,尝试从 product.product 继承一个字段,即 price 字段,将其添加到 stock.move 模型中。 所以,我在我正在
我继承了 res.partner 模型,现在,我想将 vat 字段设置为 required 和 unique . 我知道如何正常执行此操作,例如在新模型上,但我希望原始字段具有这些属性。 我怎样才能实
我需要做什么才能让 Idea 在未打开的文件中发现错误? 两个示例场景可以更好地了解我的想法: 使用现有源添加新模块。模块已加载,后台扫描任务已完成,所有文件看起来都很好。直到打开。 Idea 会将文
我注意到 Stack Overflow 上有一些类似的问题,但它们要么不是我想要做的,要么是过时的答案。 我是 Google Plus 社区的所有者,我希望将该社区嵌入我们的网站,类似于将 Twitt
所以我将我的 Steamworks SDK 导入到我的虚幻引擎项目中。它构建并运行时,我得到了 Steam 覆盖。太棒了! 但是,我现在正在尝试获取用户的好友列表,这需要 Steam Communit
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 1 年前。 Improve
我正在 Pycharm Community Edition 2017.2.3 中开发 Python 3.6 项目。 我的项目中有多个运行配置。每个不同的运行配置将打开不同的 'Run tool win
我是一名优秀的程序员,十分优秀!