Use epiphani to Share and Execute your Ansible Playbooks easily on Slack

Pawan Uberoy
epiphani
Published in
3 min readAug 24, 2020
How to share Ansible playbooks via Slack

You have really awesome playbooks that you created for your consumers to use. They may be to:

  • Spin up & spin down complex environments for sales teams
  • Recreate customer issues
  • Do health-checks or remediations

One of the major issues is that when you want others to use them, the team members have a learning curve running the playbooks on their own. They may not know how to configure the environment, or which playbook is the right one to run. They may not even know about shell sessions.

With Epiphani Playbooks, it is super easy for the consumers to execute the playbooks right from slack, even when they are mobile. They can even run your playbooks by specifying intent in simple english.

Step 1: Install e3 (epiphani execution engine)

Install e3 where you run Ansible today

$ virtualenv e3
$ source e3/bin/activate
$ pip install epiphani-ecube

Configure the credentials you will use for your epiphani account in ~/.e3.ini:

[DEFAULT]
username = <epiphani username>
password = <epiphani password>

Step 2: Login and setup your account: https://alpha.epiphani.ai

Please create an account; support for google login accounts is coming soon.

The epiphani bot can now be added to your Slack workspace. Click the Add to Slack option in the top-right gear icon menu. Select the correct Slack workspace and authorize access.

Step 3: Launch e3 and create a playbook

On the host where you installed e3, launch e3 from the directory where you run ansible.

e3 runcli --name pawanLaptop 

You can then create a playbook and run it.

On https://alpha.epiphani.ai, go to the playbook editor

Drag the “Add Node” icon and select to configure it.

From the left hand connector list pick the name you gave e3 when you executed it. In my case, it was pawanLaptop

In the command tab, add the name of the ansible command you want to execute for your playbook.

Click Next and give the node a name.

Then connect the start and end with the connectors. Give the playbook a name and description and click Save.

You can run this playbook by clicking the Run button.

Step 4: Enable the playbooks to run from Slack.

After confirming your playbook runs successfully, go to slack, invite the epiphani bot to the room where you want to execute your playbooks, then enable playbooks in that room by typing this on the slack window.

/epiphani update-channel-list 

At this point anyone in that channel can run your playbook from Slack!

Learn more @ https://epiphani.ai

--

--