当前位置:网站首页>Related operations of ansible and Playbook
Related operations of ansible and Playbook
2022-06-25 00:06:00 【qq_ fifty-two million one hundred and seventy-eight thousand fi】
1、 Deploy to the managed host yum Warehouse , Examples are as follows :
Warehouse 1 : Name: base
Description: baseos
Base url: Index of /centos-vault/8.5.2111/BaseOS/x86_64/os/
Need to validate the package GPG Signature GPG key stay /etc/pki/rpm-gpg/RPM-GPG-KEY-*
Enable this software repository
Warehouse 2: Name: app
Description: appstream
Base url: Index of /centos-vault/8.5.2111/AppStream/x86_64/os/
Need to validate the package GPG Signature GPG key stay : /etc/pki/rpm-gpg/RPM-GPG-KEY-*
Enable this software repository
[[email protected] test01]$ vim creat_yum.yml
---
- name: play1
hosts: all
tasks:
- name: create base
yum_repository:
name: base
description: baseos
baseurl: https://mirrors.aliyun.com/centos-vault/8.2.2004/BaseOS/x86_64/os/
gpgcheck: yes
- name: create appstream
yum_repository:
name: app
description: appstream
baseurl: https://mirrors.aliyun.com/centos-vault/8.2.2004/AppStream/x86_64/os/
gpgcheck: yes
- name: install vsftpd
yum:
name: vsftpd
state: latestnotes : Check your own linux System version , And select the corresponding version warehouse .
After successful deployment, install on the managed host vsftpd software package
2、 to web Host group write one playbook, The playbook There are two play, first play It can be guaranteed in web Install on host group httpd and php, Make sure web Of the host group /var/www/html/ There is a file under the directory named index.php, The contents are as follows :
$ cat /var/www/html/index.php <?php phpinfo();
The playbook The second one play Used to test the web Of the host group web Whether the service can be successfully accessed index.php Content .
[[email protected] test01]$ vim inventory
[[email protected] test01]$ vim 1.yml


3、 Add a normal user on the controlled node xiaohong, Users who configure the current control node can log in without secret xiaohong user , also xiaohong Sure sudo.
[[email protected] test01]$ vim 2.yml
---
- name: play1
hosts: node01
tasks:
- name: useradd xiaohong
user:
name: xiaohong
state: present
- name: xiaohong sudoers
lineinfile:
line: "xiaohong ALL=(ALL) NOPASSWD:ALL"
path: /etc/sudoers
- authorized_key:
state: present
user: xiaohong
key: "{
{ lookup('file', '/home/admin/.ssh/id_rsa.pub') }}"
边栏推荐
- Do280openshift access control -- encryption and configmap
- SAP PA certificate for no birds, which can be tested by new peers
- Printf redirection of serial port under sw4stm32 (SW4)
- canvas螺旋样式的动画js特效
- 在滴滴和字节跳动干了 5年软件测试,太真实…
- Scala IO writes data to a text file
- Overview of medium and low speed aerospace electronic bus
- Power application of 5g DTU wireless communication module
- Investment analysis and prospect forecast report of global and Chinese octadecyl cyclopentanoate industry from 2022 to 2028
- [figure database performance and scenario test sharp tool ldbc SNB] series I: introduction to data generator & Application to ges service
猜你喜欢

JPA learning 2 - core annotation, annotation addition, deletion, modification and query, list query result return type, one to many, many to one, many to many

svg线条动画背景js特效

Hello C (I) -- basics of C language

Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181

JPA学习2 - 核心注解、注解进行增删改查、List查询结果返回类型、一对多、多对一、多对多

Wx applet jump page

UE4 WebBrowser图表不能显示问题

Power application of 5g DTU wireless communication module

Time unified system

颜色渐变梯度颜色集合
随机推荐
It's 2022, and you still don't know what performance testing is?
Reservoir dam safety monitoring
5年,从“点点点”到现在的测试开发,我的成功值得每一个借鉴。
机器学习自学成才的十条戒律
ArcGIS loads free online historical images as the base map (no plug-ins are required)
无人驾驶: 对多传感器融合的一些思考
Hello C (two) -- use of bit operation
C程序设计专题 15-16年期末考试习题解答(上)
Opengauss kernel: simple query execution
微搭低代码中实现增删改查
软件测试与游戏测试文章合集录
openGauss内核:简单查询的执行
Difficult and miscellaneous problems: A Study on the phenomenon of text fuzziness caused by transform
VR全景怎么赚钱?结合市场从两个方面客观分析下
Leetcode No.10 regular expression matching
Hello C (VII) - structure
Why do more and more physical stores use VR panorama? What are the advantages?
Hibernate learning 2 - lazy loading (delayed loading), dynamic SQL parameters, caching
Report on operation mode and future development trend of global and Chinese propenyl isovalerate industry from 2022 to 2028
【图数据库性能和场景测试利器LDBC SNB】系列一:数据生成器简介 & 应用于GES服务