RHCE之路--05使用 Ansible Galaxy 安装角色

RHCE之路–05使用 Ansible Galaxy 安装角色

1. 考题

使用 Ansible Galaxy 和要求文件 /home/student/ansible/roles/requirements.yml 。从以下
URL 下载角色并安装到 /home/student/ansible/roles :

  1. http://materials.example.com/cd/exam_rhce8/haproxy.tar 此角色的名称应当为
    balancer http://materials.example.com/cd/exam_rhce8/haproxy.tar

  2. http://materials.example.com/cd/exam_rhce8/phpinfo.tar 此角色的名称应当为
    phpinfo http://materials.example.com/cd/exam_rhce8/phpinfo.tar

2. 解题

2.1 编辑/home/student/ansible/roles/requirements.yml

vi  /home/student/ansible/roles/requirements.yml 
---
- src: http://materials.example.com/cd/exam_rhce8/haproxy.tar
  name: balancer
- src: http://materials.example.com/cd/exam_rhce8/phpinfo.tar
  name: phpinfo

2.2 安装requirements.yml

ansible-galaxy install -r /home/student/ansible/roles/requirements.yml -p roles

3. 确认本题是否成功

在这里插入图片描述
确认roles是否生成

ansible-galaxy list

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_29974229/article/details/125328503
今日推荐