当前位置:网站首页>金鱼哥RHCA回忆录:DO447管理清单--章节实验
金鱼哥RHCA回忆录:DO447管理清单--章节实验
2022-06-09 18:49:00 【华为云】
个人简介:大家好,我是 金鱼哥,CSDN运维领域新星创作者,华为云·云享专家,阿里云社区·专家博主
个人资质:CCNA、HCNP、CSNA(网络分析师),软考初级、中级网络工程师、RHCSA、RHCE、RHCA、RHCI、ITIL
格言:努力不一定成功,但要想成功就必须努力
[[email protected] ~]$ lab inventory-review start
拉取实验代码
[[email protected] ~]$ cd git-repos/[[email protected] git-repos]$ git clone http://git.lab.example.com:8081/git/inventory-review.gitCloning into 'inventory-review'...remote: Enumerating objects: 56, done.remote: Counting objects: 100% (56/56), done.remote: Compressing objects: 100% (42/42), done.remote: Total 56 (delta 5), reused 0 (delta 0)Unpacking objects: 100% (56/56), done.[[email protected] git-repos]$ cd inventory-review运行剧本并验证
[[email protected] inventory-review]$ cat inventory [lb_servers]servera.lab.example.com[web_servers][web_servers:children]a_web_serversb_web_servers# Group "A" of Web Servers[a_web_servers]serverb.lab.example.com# Group "B" of Web Servers[b_web_servers]serverc.lab.example.com[[email protected] inventory-review]$ ansible-playbook site.yml[[email protected] inventory-review]$ curl http://serveraHello from serverb.lab.example.com. (version v1.1)[[email protected] inventory-review]$ curl http://serveraHello from serverc.lab.example.com. (version v1.1)按要求创建主机组变量
[[email protected] inventory-review]$ mkdir -pv group_vars/{a,b}_web_serversmkdir: created directory 'group_vars/a_web_servers'mkdir: created directory 'group_vars/b_web_servers'[[email protected] inventory-review]$ echo "webapp_version: v1.1a" > group_vars/a_web_servers/webapp.yml[[email protected] inventory-review]$ echo "webapp_version: v1.1b" > group_vars/b_web_servers/webapp.yml运行剧本并验证
[[email protected] inventory-review]$ ansible-playbook deploy_webapp.yml[[email protected] inventory-review]$ curl http://serveraHello from serverb.lab.example.com. (version v1.1a)[[email protected] inventory-review]$ curl http://serveraHello from serverc.lab.example.com. (version v1.1b)提交修改到工作区
[[email protected] inventory-review]$ git statusOn branch masterYour branch is up to date with 'origin/master'.Untracked files: (use "git add <file>..." to include in what will be committed) group_vars/a_web_servers/ group_vars/b_web_servers/nothing added to commit but untracked files present (use "git add" to track)[[email protected] inventory-review]$ git add group_vars/{a,b}_web_servers[[email protected] inventory-review]$ git statusOn branch masterYour branch is up to date with 'origin/master'.Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: group_vars/a_web_servers/webapp.yml new file: group_vars/b_web_servers/webapp.yml[[email protected] inventory-review]$ git commit -m "Created variable files for the A and B groups."[master 05c2080] Created variable files for the A and B groups. 2 files changed, 2 insertions(+) create mode 100644 group_vars/a_web_servers/webapp.yml create mode 100644 group_vars/b_web_servers/webapp.yml编写yaml清单文件并测试执行
[[email protected] inventory-review]$ cat inventory.yml lb_servers: hosts: servera.lab.example.com:web_servers: children: a_web_servers: hosts: serverb.lab.example.com: b_web_servers: hosts: serverc.lab.example.com:[[email protected] inventory-review]$ ansible-playbook site.yml -i inventory.yml改写为变量识别主机并测试运行
[[email protected] inventory-review]$ cat inventory.yml lb_servers: hosts: loadbalancer_1: ansible_host: servera.lab.example.comweb_servers: children: a_web_servers: hosts: backend_a1: ansible_host: serverb.lab.example.com b_web_servers: hosts: backend_b1: ansible_host: serverc.lab.example.com[[email protected] inventory-review]$ ansible-playbook site.yml -i inventory.yml提交修改后的代码项目
[[email protected] inventory-review]$ git add inventory.yml[[email protected] inventory-review]$ git commit -m "Added YAML inventory"[master 3fc697d] Added YAML inventory 1 file changed, 15 insertions(+) create mode 100644 inventory.yml[[email protected] inventory-review]$ git statusOn branch masterYour branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits)nothing to commit, working tree clean[[email protected] inventory-review]$ git pushEnumerating objects: 12, done.Counting objects: 100% (12/12), done.Delta compression using up to 4 threads.Compressing objects: 100% (6/6), done.Writing objects: 100% (10/10), 920 bytes | 920.00 KiB/s, done.Total 10 (delta 2), reused 0 (delta 0)To http://git.lab.example.com:8081/git/inventory-review.git e1de24a..3fc697d master -> master评测与清除实验
[[email protected] inventory-review]$ lab inventory-review grade[[email protected] inventory-review]$ lab inventory-review finish总结
RHCA认证需要经历5门的学习与考试,还是需要花不少时间去学习与备考的,好好加油,可以噶🤪。

以上就是【金鱼哥】对 第二章 管理清单–章节实验 的简述和讲解。希望能对看到此文章的小伙伴有所帮助。
红帽认证专栏系列:
RHCSA专栏:戏说 RHCSA 认证
RHCE专栏:戏说 RHCE 认证
此文章收录在RHCA专栏:RHCA 回忆录
如果这篇【文章】有帮助到你,希望可以给【金鱼哥】点个赞,创作不易,相比官方的陈述,我更喜欢用【通俗易懂】的文笔去讲解每一个知识点。
如果有对【运维技术】感兴趣,也欢迎关注️️️ 【金鱼哥】️️️,我将会给你带来巨大的【收获与惊喜】!

边栏推荐
- 嵌入式软件设计(中期总结)
- STLink-V2-1烧录成CMSIS-DAP
- Pcap 文件
- 20220529 how to convert subtitles in MKS format into subtitles in SRT, ass, SSA and IDX formats txt
- 数据库:高并发下的数据字段变更
- Pro 后台子管理员 403 问题分析
- Customer information management, business scenario 1
- What is a cluster? Why use a cluster architecture?
- SQL exercise 4: string processing function
- 220609-R
猜你喜欢

Notes on ad PCB drawing

3 个注解,优雅的实现微服务鉴权

How to use wireless communication technology to optimize the fire water pipe network of iron and steel plant?

Win10安装WSL1在D、E、F盘

R|mapping. seq()

2022年开什么实体店比较赚钱?适合女性做的小成本开店,叶其芳大健康

有源差分探头在USB2.0一致性分析测试的准备工作

SQL exercise 4: string processing function

刷脸认证如何实现人脸又快又准完成校验?
![[high level knowledge] epoll implementation principle of user mode protocol stack](/img/47/1ab66811bdd90ec1365a4a1e18d940.png)
[high level knowledge] epoll implementation principle of user mode protocol stack
随机推荐
Ad delete dimension
Golang Foundation (5)
Example analysis of five data types in redis
Technology sharing | selenium multi browser processing
Database: data field change under high-speed parallel distribution
示波器电流探头的消磁与平衡调节步骤
Causes of differential probe burnout
Do your filial duty to make an old people's fall prevention alarm system for your family
上位机开发(开篇)
2022年开什么实体店比较赚钱?适合女性做的小成本开店,叶其芳大健康
【高阶知识】用户态协议栈之Epoll实现原理
选择结构程序设计
Live broadcast Preview - deploy polardb for PostgreSQL cluster on alicloud ESSD cloud disk
数据库,看着操作训练题,突然不会做了,求解
R|mapping.seq()
How to answer makes the interviewer speechless
Talk about MQ technology selection
为什么云原生数据湖值得关注?
Pro 后台子管理员 403 问题分析
What is a cluster? Why use a cluster architecture?