2017-04-02 8 views
0

私が追加したモジュールをピックアップしているAnsibleに問題があります。カスタムモジュールをピックアップできない可能性

  1. このモジュールは、「passwordstore」https://github.com/morphje/ansible_pass_lookup/と呼ばれます。
  2. 私はAnsibleを使用しています。2.2
  3. 私のプレイブックでは、「ライブラリ」フォルダを追加し、そのGitHubディレクトリの内容をそのフォルダに追加しました。私もlibrary = /usr/share/ansible/modulesのコメントを外してみましたが、そこにモジュールファイルを追加してもまだ取り上げられません。
  4. も私のAnsible脚本はこのようになりますANSIBLE_LIBRARY=/usr/share/ansible/modules

に環境変数を設定しようとしたことがあり:

--- 

- name: example play 
    hosts: all 
    gather_facts: false 

    tasks: 
    - name: set password 
     debug: msg="{{ lookup('passwordstore', 'files/test create=true')}}" 

そして、私はこれを実行すると、私はこのエラーを取得します。

ansible-脚本main.yml

PLAY [example play] ****************************************************** 

TASK [set password] ************************************************************ 
fatal: [backend.example.name]: FAILED! => {"failed": true, "msg": "lookup plugin (passwordstore) not found"} 
fatal: [mastery.example.name]: FAILED! => {"failed": true, "msg": "lookup plugin (passwordstore) not found"} 
     to retry, use: --limit @/etc/ansible/roles/test-role/main.retry 

私が欠けているものを上の任意の指導?それはちょうど私がカスタムモジュールを追加しようとしている方法かもしれませんが、どんな指針も認められます。

答えて

2

ルックアッププラグイン(モジュールではない)なので、lookup_pluginslibraryではなく)というディレクトリに移動する必要があります。

lookup-plugins settingを使用して、ansible.cfgに複製されたリポジトリへのパスを追加します。

関連する問題