0
我已经用ubuntu系统启动了一个ec2实例。我将通过安全的方式在该系统上安装git
。下面是我的剧本文件:如何设置ec2实例?
---
- hosts: ec2
roles:
- git
下面
是我混帐的角色任务文件:
---
- name: install git
sudo: yes
yum:
pkg: git
state: latest
我得到以下错误,当我运行ansible-playbook -i hosts git.yml
:
TASK [git : install git] *********************************************************************************************************************************************************************************
fatal: [xxxxx.ap-southeast-2.compute.amazonaws.com]: FAILED! => {"changed": false, "failed": true, "msg": "python2 bindings for rpm are needed for this module. python2 yum module is needed fo
r this module"}
to retry, use: --limit @/Users/joey/dev/dbkoda/jenkins-docker-file/playbooks/git.retry
我不知道为什么我得到这个错误信息。我已经在ec2实例上安装了python。并且PATH上有python2
。
下面是Ansible版本我使用:
$ ansible-playbook --version
ansible-playbook 2.3.1.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Jul 18 2017, 09:17:00) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]