Ansible 不再工作 [英] Ansible is not working anymore

查看:18
本文介绍了Ansible 不再工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ansible 挂载 EC2 实例,我已经更新到 1.8,所以它可以有 get_url 的超时参数,现在它不再工作了.

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

我通过阅读this

这篇关于Ansible 不再工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆