本文介绍了Ansible不再工作了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用ansible来挂载EC2实例,我已经完成了对1.8的更新,因此它可以具有get_url的timeout参数,现在它不再起作用了.
I have used ansible for mounting EC2 instances, I have done an update to 1.8, so it can have the timeout parameter for get_url, and now it is not working anymore.
我有以下securitygroups.yml:
I have the following securitygroups.yml:
---
# Check security group existence, create them if not existing
- name: Create security group for ssh
local_action:
module: ec2_group
name: {{ group_name }}
vpc_id: "{{ vpc_id }}"
description: Security group for ssh
region: "{{ ec2_region }}"
# inbound rules
rules:
- proto: tcp
from_port: xxx
to_port: xxx
cidr_ip: xxx
- proto: tcp
from_port: xxx
to_port: xxx
cidr_ip: xxx
- proto: tcp
from_port: xxx
to_port: xxx
cidr_ip: xxx
# outbound rules
rules_egress:
- proto: all
from_port: xxx
to_port: xxx
cidr_ip: xxx
- name: Authorize the members of this group to push logs to the syslog instance. See the syslog group
local_action:
module: ec2_group
name: logstash-shipper
vpc_id: "{{ vpc_id }}"
description: Authorize the members of this group to push logs to the syslog instance. See the syslog group
region: "{{ ec2_region }}"
# outbound rules
rules_egress:
- proto: tcp
from_port: xxx
to_port: xxx
cidr_ip: xxx
- proto: udp
from_port: xxx
to_port: xxx
cidr_ip: xxx
和main.yml中的
and in main.yml:
---
# Check security group existence, create them if not existing
- include: securitygroups.yml
tags: securitygroups
在roles/ec2-security-groups/tasks
中的
;当然在vars
start.yml是:
The start.yml is:
- hosts: local
connection: local
gather_facts: False
vars:
ec2_instance_type: XXX
instance_tag_name: XXX
instance_tag_environnement: XXX
instance_tag_applicatif: XXX
instance_tag_composant: XXX
instance_tag_bloc: XXX
roles:
- ec2-security-groups
在它起作用之前,现在出现以下错误:
Before it worked, now I get the following error:
<x.x.x.x> REMOTE_MODULE ec2_group name=XXX vpc_id=XXX region=XXX description='Security group for ssh'
fatal: [localhost -> x.x.x.x] => module ec2_group not found in /usr/share/ansible/cloud:/usr/share/ansible/packaging:/usr/share/ansible/files:/usr/share/ansible/windows:/usr/share/ansible/net_infrastructure:/usr/share/ansible/monitoring:/usr/share/ansible/system:/usr/share/ansible/web_infrastructure:/usr/share/ansible/notification:/usr/share/ansible
FATAL: all hosts have already failed -- aborting
如何解决? (我不知道以前的ansible版本是什么...)
How to fix it? (I don't know what the ansible version before was...)
推荐答案
已解决:应该使用pip进行安装,并且可以正常使用的版本为1.9.1.
Fixed it: It should be installed using pip and the version that works seems to be the 1.9.1.
sudo pip install ansible==1.9.0.1
我通过阅读此
这篇关于Ansible不再工作了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!