Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ansible basic environment configuration method

2025-02-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "ansible basic environment configuration method". In daily operation, I believe many people have doubts about ansible basic environment configuration method. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "ansible basic environment configuration method". Next, please follow the editor to study!

I. basic environmental configuration

Modify the hostname and install the epel source

[root@localhost ~] # hostnamectl set-hostname ansible [root@localhost ~] # bash [root@ansible] # curl-o / etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo[root@ansible ~] # wget-O / etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo[root@ansible ~] # yum clean all & & yum makecache fast

# what I use here is Ali Source

Install ansible and configure ssh secret-free authentication

[root@ansible ~] # yum-y install ansible [root@ansible ~] # ssh-keygen-t rsa [root@ansible ~] # ssh-copy-id-I. ssh / id_rsa.pub root@10.4.7.112 [root@ansible ~] # ssh-copy-id-I. ssh / id_rsa.pub root@10.4.7.113

Declare group node members and test

[root@ansible ~] # vim / etc/ansible/hosts [web] 10.4.7.11210.4.7.113 [root@ansible ~] # ansible web-m ping

[root@ansible ~] # ansible web-a "df-Th"

At this point, the study on the "ansible basic environment configuration method" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report