簡體   English   中英

Ansible ec2.py獨立運行,但在Playbook中失敗

[英]Ansible ec2.py runs standalone but fails in playbook

我看過一些關於此主題的帖子,這些帖子很難重現行為。 這是一組新的數據點。

  1. 目前有以下作品

cd ./hosts ./ec2.py --profile=dev

  1. 這失敗了

AWS_PROFILE=dev; ansible-playbook test.yml

這些都在幾天前都工作了。 我的環境發生了變化。 仍在調查中。 有什么猜想嗎?

錯誤信息:

ERROR! The file ./hosts/ec2.py is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with ERROR! The file ./hosts/ec2.py is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with chmod -x ./hosts/ec2.py進行更正. ERROR! Inventory script (./hosts/ec2.py) had an execution error: ERROR: "Error connecting to AWS backend. You are not authorized to perform this operation.", while: getting EC2 instances ERROR! ./hosts/ec2.py:3: Error parsing host definition ''''': No closing quotation . ERROR! Inventory script (./hosts/ec2.py) had an execution error: ERROR: "Error connecting to AWS backend. You are not authorized to perform this operation.", while: getting EC2 instances ERROR! ./hosts/ec2.py:3: Error parsing host definition ''''': No closing quotation

請注意,正常的憑證錯誤是:

ERROR: "Error connecting to AWS backend. You are not authorized to perform this operation.", while: getting EC2 instances

...

嗯。 錯誤消息已轉移。 AWS_PROFILE=dev; ansible-playbook test.yml ERROR! ERROR! ./hosts/tmp:2: Expected key=value host variable assignment, got: {

看來問題出在hosts文件夾中的一個臨時文件。 刪除它后,問題就消失了。 看起來好像是標准的行為:將所有文件拉入hosts文件夾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM