当前位置:网站首页>Rhce ansible
Rhce ansible
2022-04-22 18:47:00 【Étudiant Z confus】
1)Installation et configurationansibleEtansibleNoeud de contrôleserver.example.comComme suit:
2)Créer un nom/home/student/ansible/inventoryLe fichier d'inventaire statique pour:
2.1)node1 - Oui.devMembres du Groupe hôte
2.2)node2- Oui.testMembres du Groupe hôte
2.3)node1Etnode2- Oui.prodMembres du Groupe hôte
2.4)node1- Oui.balancersUn membre de l'équipe principale
2.5)prodLe Groupe estwebserversMembres du Groupe hôte
3).Créer un nom/home/student/ansible/ansible.cfgProfil pour,Comme suit:
3.1Fichier d'inventaire de l'hôte/home/student/ansible/inventory
3.2La position du personnage dans le scénario est définie comme/home/student/ansible/roles
4)Connexion dans l'hôte de contrôlestudentUtilisateurs,remote_user = devops,Activer la mise à jour des privilèges
InServerInstallation de l'hôteansible,Et écrithostDocumentation
(La présence depythonModule)
[root@server ztx]# yum install ansible
server

node1

node2

Ajouter un utilisateur au contrôle student
[root@server ztx]# useradd student
[student@server ~]$ mkdir ansible
[student@server ~]$ cd ansible/
[student@server ansible]$ vim inventory

[student@server ansible]$ vim ansible.cfg
Voir si vous pouvez voir le profil
[student@server ansible]$ ansible --version

Modifier les informations

Ajouter un utilisateurdevops
[root@node1 admin]# [root@node1 admin]# passwd devops
Changing password for user devops.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
useradd devops
[root@node2 ztx]# useradd devops
[root@node2 ztx]# passwd devops
Changing password for user devops.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
Implémenter une connexion sans mot de passe
[student@server ansible]$ ssh-keygen -t rsa -f ~/.ssh/id_rsa -P "" -q
[student@server ansible]$ ssh-copy-id -i ~/.ssh/id_rsa.pub devops@node1
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/student/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
devops@node1's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'devops@node1'" and check to make sure that only the key(s) you wanted were added. [student@server ansible]$ ssh-copy-id -i ~/.ssh/id_rsa.pub devops@node2 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/student/.ssh/id_rsa.pub" The authenticity of host 'node2 (172.25.250.12)' can't be established.
ECDSA key fingerprint is SHA256:Kl2g1gJ/9cWTXV1FmBR/dPdcCIcd+GVoFLxMuNxGQ7Y.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
devops@node2's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'devops@node2'"
and check to make sure that only the key(s) you wanted were added.
Test d'ouverture de session sans secret

版权声明
本文为[Étudiant Z confus]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221847031758.html
边栏推荐
- 聊聊缓存布尔值踩到的坑
- 2022 Fujian Provincial Safety Officer a certificate (main person in charge) examination simulation 100 questions and online simulation examination
- Nodejs file operation
- General mode of deploying modern applications in kubernetes cluster
- 2022年江西省安全员A证考试练习题及模拟考试
- C# 从list 或者string中随机获取一个
- CData Drivers for Jira完整的特征和属性
- High concurrency -- Deep parsing of the source code of the scheduledthreadpoolexecutor class
- 力扣-931.下降路径最小和
- leetcode151. 颠倒字符串中的单词(思路+详解)
猜你喜欢

人气种草产品预测,猜中TOP 3得红包!

MFC原理与方法(二)

【网络安全】Duomicms的变量覆盖漏洞从白盒测试到实战

【论文泛读】Easing Embedding Learning by Comprehensive Transcription of Heterogeneous Information Networks

华为云媒体査勇:华为云在视频AI转码领域的技术实践

mysql 之 MHA

STC目前所有系列的中断列表

SegAttnGAN Text to Image Generation with Segmentation Attention

Take you to understand the principle of highly flexible spark architecture

C language precompiling (preprocessing) define
随机推荐
聊聊缓存布尔值踩到的坑
[fundamentals of interface testing] Chapter 9 | detailed explanation of postman global variables and environment variables
【接口测试基础】第十一篇 | 详解Postman关联接口及批量执行用例集
Kellerman Software . NET SFTP Library
【接口测试基础】第八篇 | PostMan常用断言及断言的工作原理
B03基于STM32单片机独立按键控制数码管秒表Proteus设计、keil程序、c语言、源码,标准库版本
旅游产品分析:要出发周边游
【手部姿态估计】【论文详读】3D Hand Pose Estimation with a Single Infrared Camera via Domain Transfer Learning
ReadLine analysis log
nodejs文件操作
【网络安全】Duomicms的变量覆盖漏洞从白盒测试到实战
如何设计 API 接口,实现统一格式返回
Detailed understanding of gaussdb and how to do data migration [play with Huawei cloud]
jsp学习(八.JDBC与文件上传处理的项目)
2022语言与智能技术竞赛再升级,推出NLP四大前沿任务
MFC原理与方法(二)
【CIcadplayer】进度条回调
今日指数项目之数据分时行情、数据备份和个股涨跌幅开发【十一】
Win10问题篇:一次性永久关闭win10系统自动更新
运行npm install命令的时候会发生什么?