更多 IT 认证课程请访问 美河学习在线 www.eimhe.com
RHCE8(PM)
练习环境默认没有虚拟机,需要 reset 生成虚拟机(虚拟机会自动启动)
[root@server1 ~]# rht-vmctl reset control
[root@server1 ~]# rht-vmctl reset node1
[root@server1 ~]# rht-vmctl reset node2
[root@server1 ~]# rht-vmctl reset node3
[root@server1 ~]# rht-vmctl reset node4
[root@server1 ~]# rht-vmctl reset node5
模拟环境的所有虚拟机,可以通过 virt-manager 管理
真正考试,所有虚拟机都已经准备 OK,不需要 reset,可以直接使用虚拟机
===================================================================
考试共计 15 题,4 个小时!
第一题:
真机 ssh 远程 control 虚拟机(使用域名或 IP 地址):
[root@server1 ~]# ssh alice@control
备注:control 主机的 yum 源是提前配置 OK 的
[alice@control ~]$ sudo yum -y install ansible #安装软件包
[alice@control ~]$ pwd #确认自己的位置
/home/alice
[alice@control ~]$ mkdir -p /home/alice/ansible/roles
[alice@control ~]$ cd /home/alice/ansible/
写主配置文件,要参考/etc/ansible/ansible.cfg
[alice@control ansible]$ vim ansible.cfg #创建主配置文件
[defaults]
inventory = /home/alice/ansible/inventory
roles_path = /home/alice/ansible/roles
remote_user = alice
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=False
[alice@control ansible]$ vim inventory #创建主机清单文件
[test01]
node1
[test02]
node2
[web]
node3
node4
[test05]
评论