How Ansible + GlobalSSH Accelerates Multi‑Data‑Center Deployments by 32%
This article explains how UCloud integrates Ansible with GlobalSSH to streamline overseas multi‑data‑center deployments, presents step‑by‑step Playbook examples, and shows performance tests that demonstrate up to a 57% speed boost for both Playbook and Ad‑hoc operations.
What is Ansible
Ansible is a simple, agent‑less automation, orchestration, and configuration‑management tool that communicates with remote nodes via SSH.
UCloud Ansible Use Cases
UCloud heavily uses Ansible for data‑center product deployment and large‑scale gray‑release systems, improving deployment efficiency and simplifying rollback and control.
Overseas Multi‑Data‑Center Deployment
Using Ansible, UCloud centrally deploys services to overseas nodes (e.g., Lagos, Ho Chi Minh) from a management center in Beijing/Shanghai, connecting via SSH to the remote cloud hosts.
Deployments over low‑bandwidth or high‑latency networks can suffer from slow SSH channel creation and file transfer.
GlobalSSH
GlobalSSH is a UCloud PaaS product that leverages high‑performance IaaS components, intelligent DNS, and GRE/NAT forwarding to provide accelerated, low‑latency cross‑region SSH connections.
Ansible Playbook Deployment
Integration steps:
Create cloud hosts in Beijing and Lagos with GlobalSSH enabled.
Write a simple Playbook that gathers facts, copies a package, and installs it via yum.
Configure a hosts file that sets ansible_ssh_host to the GlobalSSH domain.
Run the Playbook with ansible-playbook.
---
- hosts: all
tasks:
- name: copy test
copy: src=/data/MySQL-devel-5.6.41-1.el6.x86_64.rpm dest=/data/test
- name: install mysql-devel
yum: name=/data/MySQL-devel-5.6.41-1.el6.x86_64.rpm state=present [all]
152.32.140.39 ansible_ssh_pass=example ansible_ssh_host=152.32.140.39.ipssh.netTest Comparison (Playbook)
Running the Playbook ten times shows a clear speed advantage when using GlobalSSH.
Using external IP: total 10m52.197s, average 65.20s.
Using GlobalSSH domain: total 7m21.898s, average 44.19s, 32.23% faster.
Ansible Ad‑hoc Mode
GlobalSSH also improves the performance of Ad‑hoc commands, which are similar to pssh but support all Ansible modules.
time for i in `seq 1 10`; do ansible -i hosts_nrly all -m shell -a "cat /var/log/messages"; done
time for i in `seq 1 10`; do ansible -i hosts_nrly_1 all -m shell -a "cat /var/log/messages"; doneTest Comparison (Ad‑hoc)
Using external IP: total 3m17.427s, average 19.74s.
Using GlobalSSH domain: total 1m23.983s, average 8.40s, 57.45% faster.
Conclusion
Ansible is a widely adopted DevOps tool, and integrating GlobalSSH into Ansible deployments easily eliminates SSH‑induced latency, significantly improving deployment speed and reliability across global data centers.
UCloud Tech
UCloud is a leading neutral cloud provider in China, developing its own IaaS, PaaS, AI service platform, and big data exchange platform, and delivering comprehensive industry solutions for public, private, hybrid, and dedicated clouds.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
