私は自分の役割を別のホストで実行するつもりです。私は各ホストでファイルをダウンロードする簡単な作業をしています。私は私の役割のよう異なるホストで各役割を実行することができます
以下[groupa]
10.0.1.20
[groupb]
10.0.1.21
は私main_file.ymlファイルです
---
- hosts: local
connection: local
gather_facts: no
roles:
- oracle
- apache
構造
main_file.yml
roles
|-- oracle
| |-- tasks
| |-- main.yml
| |-- download_file.yml
|-- apache
| |-- tasks
| |-- main.yml
| |-- download_file.yml
オラクル/ main.yml
---
- name: downloading a file in groupa
hosts: groupa
tasks:
- include: tasks/download_file.yml
のように見えるホストファイルを持っています
oracle/download_file.yml
---
- name: download file
shell: wget http://dummyurl.com/random.sh
Apacheロールでは「groupb」と同じ手順に従います。私は、私は2つのレベルがあるansibleでは、以下のエラーに
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/etc/ansible/roles/oracle/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: downloading a file
^here
main.ymlには、次のようなデバッグ文がありません。あなたはすべてを含めることができますか? –
oracle/main.ymlにホストを追加せずにデバッグ・タスクを実行しても同じエラーが発生する – shwetha