Community.general.telegram(Ansible)でエラーが発生するのはなぜですか?

Community.general.telegram(Ansible)でエラーが発生するのはなぜですか?

Ansible PlayBookを設定し、いくつかのコードを追加してサービスを開始し、Telegramに通知を送信しようとすると、次のエラーが発生します。私はこれがタイプミスではなく、コミュニティの一般的なテレグラムプレイブックの他のエラーだと思います。以前はエラーなしでこれを行ったことがあります。今度は同じプロセスに沿って新しいサーバーを再インストールしようとしましたが、このエラーが発生しました。

 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

start.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 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コレクションインストールコミュニティ。一般

Process install dependency map
Starting collection install process
Skipping 'community.general' as it is already installed

ベストアンサー1

ansible-playbookあなたも一緒に走っていますかsudo? GalaxyのインストールとAnsible Playbookの実行の両方が同じユーザーを使用する必要があります。

そうでなければ、状況は正しく見えます。アップグレードを試して、役に立つかどうかを確認できます。

ansible-galaxy collection install community.general --upgrade

追加情報アンサーブルギャラクシーコミュニティで。一般文書

おすすめ記事