Upgrading Sipxcom cluster in DevOps style using Ansible

softwareupgradeAnsible is a configuration management tool, one of the best available. This tool doesn’t need any clients installed on remote machines and uses ssh to execute remote commands on the servers that form the sipxcom cluster.

Normally, to upgrade a sipXcom cluster you need to download the latest sipxcom.repo on each of the servers. Then starting with secondaries you needed to update the system and then reload it.

With Ansible we can execute all of these steps from the management machine which is running Ansible. In this Proof of Concept (PoC) we are using a cluster created previously with vagrant/VirtualBox on a local machine.

Let’s get hands-on:

Step 1. Copy ssh keys from your remote servers

with ssh-copy-id command. Replace the bellow IP’s with yours:

[mihai@localhost SIPXCOM_Cluster]$ ssh-copy-id root@

[mihai@localhost SIPXCOM_Cluster]$ ssh-copy-id root@

[mihai@localhost SIPXCOM_Cluster]$ ssh-copy-id root@


Step 2. Create an inventory.ini file used by ansible to identify the managed hosts and an ansible.cfg file that will instruct ansible to read the inventory file created in local path

[mihai@localhost SIPXCOM_upgrade]$ cat ansible.cfg


hostfile = inventory.ini

remote_user = root

[mihai@localhost SIPXCOM_upgrade]$ cat inventory.ini




Step 3. Download the latest repo. When this blog article was writte

n latest version was 16.04

[mihai@localhostSIPXCOM_upgrade]$wget http://download.sipxcom.org/pub/sipXecs/16.04/sipxecs-16.04.0-centos.repo


Step 4. Write a shell script that will perform yum update

#! /bin/bash

yum clean all && yum update -y && reboot


Step 5. Create ansible playbook that will upgrade sipxcom cluster


- hosts: all



    - name: Copy sipxcom.repo in /etc/yum.repos.d. Overwrite with latest repo file

     copy: src=sipxcom.repo dest=/etc/yum.repos.d/sipxcom.repo


- hosts: secondaries


    - name: Upgrading secondaries first

     shell: upgrade.sh    


- hosts: uc1


    - name: Upgrade primary now

     shell: upgrade.sh      

Step 6. Let’s add all these steps under a single setup.sh shell script. That will be executed when you want to upgrade to the latest sipXcom version

#! /bin/bash


echo "To which version you want to upgrade?? ex:add just  16.04  "


echo "You will need wget to download locally latest repo. If you don't have it installed on your management machine please install it.."

wget http://download.sipxcom.org/pub/sipXecs/$VERSION/sipxecs-$VERSION.0-centos.repo


#renaming to sipxcom.repo. This is the repo used by me on the VBox machines. You should replace the one that you have under /etc/yum.repos.d

mv sipxecs-$VERSION.0-centos.repo sipxcom.repo


#running ansible-playbook that will upgrade your cluster


ansible-playbook upgrade_sipxcom.yml


Step 7: Compare the current version of sipxcom with the old one:

rpm -qa | grep sipxconfig


Before upgrade:

-bash-4.1# rpm -qa | grep sipxconfig



After running setup.sh

-bash-4.1# rpm -qa | grep sipxconfig





You can download the PoC files with:

git clone https://github.com/Mihai-CMM/Upgrade_Sipxcom_DevOps_Style.git


If you need help configuring sipXcom you can learn more here.

Or find out more about Ansible here.

Written by Mihai Costache

Mihai Costache

Mihai is an IT enthusiast and a new technology scouter with more than 10 years of experience. His military education and background cultivated in him a strong sense of loyalty and a positive work ethic. Mihai worked in various roles for government and private corporations in area the of IT and telecommunications. After serving his country for more than 6 years, he joined Huawei Romania as an OSS Engineer. Currently he is part of eZuce family acting as Senior TAC Engineer and Solutions Architect. His motto is : "No problem can withstand the assault of sustained thinking"

Subscribe to Email Updates


Popular tags

see all
  • Our Mission
      eZuce is an innovative technology company that provides small and medium enterprises with visually integrated unified collaboration environment to improve their business processes. Intuitive adoption of technology by humans is in the forefront of all our developments. The eZuce user centric solution enables our enterprise partners to respond swiftly and accurately to their customers’ needs.
  • My Enterprise
      At eZuce, we are passionate about changing the way people collaborate within the enterprise. We believe that the consumerization of information technology has changed the status quo within the enterprise. Intuitive adoption of technology by individuals empowers a more productive workplace, my workplace, My Enterprise! Our goal is to leverage newly attained consumer skills into a “My Enterprise” attitude at work by enabling individuals and teams to collaborate on their terms.
  • Be there
      By emphasizing visual interaction, the human factor and user centricity, eZuce software and service solutions enable individuals and teams to collaborate on their terms, to be there for the business at the right time at the right place with the right device. Be there with your own insight!

eZuce, Inc.

300 Brickstone Square #104, Andover, MA 01810

Phone: (978) 296-1005

Email: contact@ezuce.com

Web: http://ezuce.com