为了安装php7 7,我需要使用以下命令启用remi-php71 repo:
yum-config-manager --enable remi-php71
我怎样才能在 ansible 任务中做到这一点?
最佳答案
我有同样的需求(但对于 5.6)。遵循讨论中的建议 here我使用了以下内容:
- name: enable remi-php56
ini_file:
dest: /etc/yum.repos.d/remi.repo
section: remi-php56
option: enabled
value: 1
优于使用
yum_repository
是我不必维护定义 - 我从他提供的 RPM 安装 remi repos。优于shell
变体(无论如何应该是 command
)是我不需要运行命令,也不需要为此安装 yum utils
关于Ansible 2.3.1.0 : Enable repo on CENTOS 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44606514/