Hi Readers, this document regarding web interface for Ansible.
As you all know ansible tower is the official product from Redhat and which is a paid software for managing ansible. Here is the one of opensource software for ansible management and orchestration.
Polemarch is a service for infrastructure orchestration based on Ansible. Simple WEB GUI for infrastructure orchestration using ansible playbooks.

Here are the steps to install Polemarch in Linux System.


Step 1: Install all the dependencies, and MariaDB server, check here to install MariaDB Server and Redis server


apt-get install python-pip python-virtualenv python-dev gcc libffi-dev libkrb5-dev libffi6 libssl-dev libyaml-dev libsasl2-dev libldap2-dev sshpass git redis-server

Red Hat/CentOS

yum install -y python openssl-devel libyaml-devel python-virtualenv krb5-devel krb5-libs openldap-devel git redis-server

Step 2: Create Enviroment for Pole march

virtualenv polemarch

cd polemarch

source bin/activate

St3p 3: Install Polemarch

pip install -U polemarch

Create database and user in MariaDB Server

SET @@global.innodb_large_prefix = 1;
create user db_user;
create database db_name default CHARACTER set utf8 default COLLATE utf8_general_ci;
grant all on db_name.* to 'db_user'@'localhost' identified by 'db_password';

Then, if you use MariaDB and you have set timezone different from “UTC” you should run next command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

The default cache system is file based cache, but RedisCache is recommended. Settings needed for correct RedisCache work:

Create a configuration file for Polemarch /etc/polemarch/settings.ini

engine = django.db.backends.mysql
name = db_name
user = db_user
password = db_password

connect_timeout = 20
init_command = SET sql_mode='STRICT_TRANS_TABLES', default_storage_engine=INNODB, NAMES 'utf8', CHARACTER SET 'utf8', SESSION collation_connection = 'utf8_unicode_ci'

backend = django_redis.cache.RedisCache
location = redis://

backend = django_redis.cache.RedisCache
location = redis://
The default celery broker is file Celery broker, but Redis is recommended. Settings needed for correct Redis work:

connection = redis://
heartbeat = 5
concurrency = 8
enable_worker = true
For running Polemarch with worker, you need to create follow sections:

processes = 4
threads = 4
harakiri = 120
vacuum = True
pidfile = /run/polemarch.pid
log_file = /var/log/{PROG_NAME}_web.log

# output will be /run/polemarch_worker.log
logfile = /var/log/{PROG_NAME}_worker.log
# output will be /run/polemarch_worker.pid
pidfile = /run/{PROG_NAME}_worker.pid
loglevel = INFO

Save and Exit

touch /var/log/polemarch/web.log


polemarchctl migrate

Start Polemarch using the following command

polemarchctl webserver

Polemarch starts with the web interface on port 8080.

If you need to restart Polemarch use following command:

polemarchctl webserver reload=/var/run/polemarch/web.pid

If you need to stop Polemarch use following command:

polemarchctl webserver stop=/run/polemarch.pid

Now you can see the WEB UI in the browser by accessing IP:8080

For more about workflow check here,

© 2018, Techrunnr. All rights reserved.

Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.