The invention discloses a method for automatically deploying a high-availability cluster of a service system based on ansible, which comprises the following steps: setting all servers of the cluster in a local area network, and setting a deployment IP (Internet Protocol) of each server, so that the server at the rear end accesses a deployment page at the front end through the deployment IPs respectively, and the server comprises four different types of network cards, the system comprises a monitoring network card, a service network card, a storage network card and a management network card, configuration information is input into the deployment page and a page deployment request is generated; the method comprises the steps that a server is selected as a deployment main node, an android script is generated according to a specified server list and corresponding information in configuration information, the deployment main node obtains a page deployment request and executes the deploymentstep of the android script according to the configuration information, and meanwhile an SSH protocol is used for sending execution commands of the same step to other servers in a cluster through a deployment IP. The deployment success rate is improved, maintenance of operation and maintenance personnel is facilitated, and the working efficiency is improved.