[英]Ansible ec2.py runs standalone but fails in playbook
我看過一些關於此主題的帖子,這些帖子很難重現行為。 這是一組新的數據點。
cd ./hosts ./ec2.py --profile=dev
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.