【问题标题】:Ansible is not working anymoreAnsible 不再工作了
【发布时间】:2015-07-28 12:46:52
【问题描述】:

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

我有以下 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 中:

---
# Check security group existence, create them if not existing 

- include: securitygroups.yml
  tags: securitygroups

roles/ec2-security-groups/tasks;当然vars中有一个main.yml

start.yml 是:

- 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

在它工作之前,现在我收到以下错误:

<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版本是什么……)

【问题讨论】:

  • 您是如何安装/更新 Ansible 的? “找不到模块”问题可能意味着 git 存储库没有被递归克隆。
  • 直接使用 sudo apt-get install ansible :s
  • 现在,我已经像here 一样删除它并像here 一样重新安装它,但仍然是同样的错误

标签: ubuntu ansible


【解决方案1】:

修复它:它应该使用 pip 安装,并且工作的版本似乎是 1.9.1。

sudo pip install ansible==1.9.0.1

我通过阅读this解决了这个问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-21
    • 2016-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-18
    • 1970-01-01
    相关资源
    最近更新 更多