• About Us
  • Contact
  • Trang chủ
  • Code
  • Linux
  • Virtualization
  • Mail
  • Tools
No Result
View All Result
System Zone
No Result
View All Result
Home Linux

[Ansible] Hướng dẫn cấu hình ansible server

admin by admin
23 Tháng 9, 2025
in Linux
1
0
SHARES
2
VIEWS
Share on FacebookShare on Twitter

Các bước cài đặt ansible server trên centos 7.

Related Posts

Cài đặt sử dụng Rclone trên Centos 7

Lỗi service mysql không thể start:[ERROR] mysqld: Table ‘./mysql/global_priv’ is marked as crashed

Hướng dẫn viết script sync dữ liệu giữa 2 VPS linux qua SSH key

Hướng dẫn cài đặt MongoDB 5 trên centos 7

Đầu tiên ta tạo 2 host : server vs client (server chứa các lệnh thực thi client)
Server: 10.10.100.100
Client 10.10.100.200

Bước này ta triển khai lệnh trên cả 2 máy Server và Client

yum install epel-release
yum install ansible

Cấu hình file hosts trong đường dẫn /etc/ansible/hosts trong máy Server

vi /etc/ansible/hosts
[ten group]
tenhost ansible_ssh_host=your_server_ip

Triển khai trên máy Server

ssh-keygen -t rsa
ssh-copy-id -i id_rsa.pub username@remote_host

 

từ server add public key tới các client
từ server add public key vào chính nó

Lệnh thực hiện trên máy Server

ansible -m ping all
ansible -m ping ten-host-client

Thực hiện trên máy Server

ansible -m shell -a 'free -m' tên-host-client-trong-config

Với config file host trong ansible thì nó hỗ trợ 2 định dạng ini hoặc yml
– Cách viết theo ini

//Group nhỏ chứa các host
[tengroup1]
tenhost1 ansible_host=IP1 ansible_user=tenuserSSH ansible_password="Password"

//Group nhỏ chứa các host
[tengroup2]
tenhost2 ansible_host=IP2 ansible_user=tenuserSSH ansible_password="Password"

//Group cha chứa các group nhỏ
[server:children]
tengroup1
tengroup2

 

– Cách viết dạng YML

all:
children:
TenGroupNho:
hosts:
IP1
ansible_user: tenuserSSH
anible_password: passwordSSH

 

Tags: ansibleansible clientansible serveransilehướng dẫn cài đặt ansiblehướng dẫn cài đặt ansible serverHướng dẫn cấu hình ansibleHướng dẫn cấu hình ansible server
Next Post

[Ansible] Hướng dẫn cài đặt Wordpress trên nhiều host

0 0 đánh giá
Đánh giá bài viết
Theo dõi
Đăng nhập
Thông báo của
guest
guest
1 Bình luận
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
trackback
Hướng dẫn cài đặt WordPress trên nhiều host bằng Ansible – Tạp hóa công nghệ
4 năm trước

[…] Xem hướng dẫn cài đặt : Hướng dẫn cài đặt ansile Server Client […]

0
Trả lời

Danh mục

  • Cpanel (8)
  • Directadmin (4)
  • Gsuite (1)
  • Kiss Daily Talk (3)
  • Lập trình web (7)
  • Linux (20)
  • Mail (2)
  • MDaemon (1)
  • Mongo DB (1)
  • Plesk (1)
  • Windows (2)
  • Xâm nhập thế giới hacker (4)
  • Zimbra (2)

Bài viết mới

  • Cài đặt sử dụng Rclone trên Centos 7
  • Điều chỉnh daily report trong Zimbra
  • Phân quyền user trong Zimbra
  • Fix lỗi Misdirected Request trên Plesk
  • Lỗi service mysql không thể start:[ERROR] mysqld: Table ‘./mysql/global_priv’ is marked as crashed
  • Mail
  • Virtualization
  • Lập trình web
  • Linux Administrator
  • Learning More

© 2025 SystemZone - Premium WordPress news & magazine theme by Aitemat.

No Result
View All Result
  • About Us
  • About Us
  • blog
  • Campaign
  • Cart
  • Checkout
  • Cửa hàng
  • Giỏ hàng
  • Giới thiệu
  • Home 2
  • IT STORY
  • Lập trình web
  • Learning More
  • Linux Administrator
  • Mail
  • My account
    • Wishlist
  • Privacy Policy
  • Sample Page
  • Thanh toán
  • Track your order
  • Trang chủ
  • Trang Mẫu
  • Virtualization
  • Sections
  • Rows / Columns
  • Sliders
  • Buttons
  • Titles / Dividers
  • Blog Posts
  • Mega Shop
  • Simple Slider
  • Banner Grids
  • Icon Box
  • Lightbox
  • Scroll To
  • Pages
    • About
    • Contact
    • FAQ
    • Portfolio
  • Map
  • Message box
  • Product Categories
  • Products
  • Share / follow icons
  • Tabs
  • Team Member
  • Testimonials

© 2025 SystemZone - Premium WordPress news & magazine theme by Aitemat.

wpDiscuz
1
0
Rất thích suy nghĩ của bạn, hãy bình luận.x
()
x
| Trả lời