我已经用 ubuntu 系统启动了一个 ec2 实例。我将git
通过 ansible 在该系统上安装。下面是我的剧本文件:
---
- hosts: ec2
roles:
- git
下面是我的 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。并且python2
在 PATH 上可用。
以下是我正在使用的 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)]
Yum是 Red Hat 系列发行版上的标准包管理器。
Ubuntu 基于 Debian,使用APT。
在 Ansible 中使用apt
模块.
您也可以尝试使用package
module,但由于包名称因包管理器而异,您可能无法为不同的发行版创建共同的游戏。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句