0
は、私は次のansible脚本を持っている:python2.7を必要としない、実行可能なタスクの例?
- hosts: myhosts
gather_facts: no
tasks:
- debug:
msg: just a test message
私は、コマンドラインから、私が得ることを実行します。
PLAY RECAP ****************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0
だからだけで正常に動作しています。しかし、私は追加した場合:私はAnsibleは、その機能のほとんどのpython2.7を必要とGoogleで検索したものから
TASK [Another task] *******************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to localhost closed.\r\n", "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", "msg": "MODULE FAILURE", "rc": 0}
to retry, use: --limit @/home/user/sandbox/ansible-vps/foo.retry
PLAY RECAP ****************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1
- 私は現在インストールされていない:それはで失敗
- hosts: myhosts
gather_facts: no
tasks:
- debug:
msg: just a test message
- name: Another task
command: echo "Do whatever you want to"
。上記のエラーは、Python2.7やその他のものがないために発生しますか?
[OK]を - 代わりに、コマンドの生の使用 - テキストは、コンソールに出力されていない「あなたがしてやりたいです」それはちょうど変更されたと言う:[localhost]。ですから、リモートでbashコマンドを実行するためにrawをどのように使用しますか? – u123
私は結果を確認するためにデバッグ出力で例を更新しました。あるいは、冗長表示( '-vv')を強くして、モジュール出力を見ることができます。 –