{"id":19601473,"url":"https://github.com/stackstorm/showcase-ansible-chatops","last_synced_at":"2025-04-27T17:31:58.803Z","repository":{"id":33223510,"uuid":"36866776","full_name":"StackStorm/showcase-ansible-chatops","owner":"StackStorm","description":"Vagrant Demo showing ChatOps with Ansible","archived":false,"fork":false,"pushed_at":"2018-12-19T22:33:15.000Z","size":60,"stargazers_count":77,"open_issues_count":2,"forks_count":22,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-08-03T09:04:50.009Z","etag":null,"topics":["ansible","chatops","demo","hubot","showcase","slack","st2","stackstorm","vagrant"],"latest_commit_sha":null,"homepage":"https://stackstorm.com/2015/06/24/ansible-chatops-get-started-%f0%9f%9a%80/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StackStorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-04T11:38:37.000Z","updated_at":"2024-01-23T04:46:51.000Z","dependencies_parsed_at":"2022-07-29T18:50:00.477Z","dependency_job_id":null,"html_url":"https://github.com/StackStorm/showcase-ansible-chatops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackStorm%2Fshowcase-ansible-chatops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackStorm%2Fshowcase-ansible-chatops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackStorm%2Fshowcase-ansible-chatops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackStorm%2Fshowcase-ansible-chatops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StackStorm","download_url":"https://codeload.github.com/StackStorm/showcase-ansible-chatops/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224076188,"owners_count":17251704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","chatops","demo","hubot","showcase","slack","st2","stackstorm","vagrant"],"created_at":"2024-11-11T09:18:34.770Z","updated_at":"2024-11-11T09:18:36.074Z","avatar_url":"https://github.com/StackStorm.png","language":"Shell","readme":"Ansible \u0026 ChatOps with Slack, Hubot and StackStorm - Vagrant demo\n===========\n\u003e Part of tutorial: [Ansible and ChatOps. Get started :rocket:](https://stackstorm.com/2015/06/24/ansible-chatops-get-started-%f0%9f%9a%80/)\n\n### Introduction\nThis is quick demonstration of the [StackStorm](http://stackstorm.com/) event-driven automation platform running with [Ansible](http://ansible.com/) configuration management tool and [Hubot](https://hubot.github.com/) ChatOps engine. The objective is to operate servers with Ansible directly from [Slack](http://slack.com/) chat.\n\n[![Ansible and ChatOps with Slack and Hubot](http://i.imgur.com/HWN8T78.png)](https://stackstorm.com/2015/06/24/ansible-chatops-get-started-%f0%9f%9a%80/)\n\nIt will get you up and running with `chatops` control VM with all St2 components prepared as well as Ansible and Hubot configured.\nAdditionally, it installs 2 Ubuntu VMs: `web` server with nginx and `db` server with mysql.\n\nAs a result you should get 100% ready environment allowing you to execute [Ansible ad-hoc commands](http://docs.ansible.com/intro_adhoc.html) and run [Ansible playbooks](http://docs.ansible.com/playbooks.html) against VMs directly from your Slack chat. In this showcase we already crafted some simple, but useful real world ChatOps commands.\n\n### Getting started\n\n#### 1. Prepare Slack\n* Create [slack.com](http://slack.com/) account if you don't have it yet.\n* Navigate `Configure Integrations -\u003e Filter -\u003e Hubot` and generate Slack \u0026 Hubot API Token.\n\n#### 2. Vagrant up\nEdit [`Vagrantfile`](Vagrantfile#L5) and add the just generated API token under `HUBOT_SLACK_TOKEN` constant, or just export it:\n```sh\nexport HUBOT_SLACK_TOKEN=xoxb-1234-5678-91011-00e4dd\n```\n\nTo provision the environment run:\n```sh\nvagrant up\n```\nInstallation takes some time (st2 engine comes with Python, RabbitMQ, PostgreSQL, MongoDB, OpenStack Mistral).\n\n#### 3. Try ChatOps\nYou should see your bot online in Slack and now you're ready to type some chat commands. Don't forget to invite your bot into the Slack channel: `/invite @stanley`. Your first ChatOps command is: \n```\n!help\n```\n![Ansible ChatOps with StackStorm, Hubot and Slack. List of ChatOps commands](https://i.imgur.com/LGLey2m.png)\nFull list of available commands from [st2_chatops_aliases](https://github.com/armab/st2_chatops_aliases) pack:\n* [`!ansible \u003ccommand\u003e`](https://i.imgur.com/9xEgfP6.png) - Run ansible command on local machine\n* [`!status \u003chosts\u003e`](https://i.imgur.com/ZOZgGnz.png) - Show status for hosts (ansible ping module)\n* [`!show nginx stats on \u003chosts\u003e`](https://i.imgur.com/Wsvdx3W.png) - Show sorted http status codes from nginx on hosts\n* [`!show mysql processlist \u003chosts=db\u003e`](https://i.imgur.com/RxePho1.png) - Show MySQL processlist\n* [`!service restart \u003cservice_name\u003e on \u003chosts\u003e`](https://i.imgur.com/rNsHdtK.png) - Restart service on remote hosts\n* [`!show version \u003cpackage\u003e on \u003chosts\u003e`](https://i.imgur.com/M8hTv9W.png) - Show package versions on hosts\n* [`!update \u003cpackage\u003e on \u003chosts\u003e`](https://i.imgur.com/aOEApkR.png) - Update package on remote hosts\n* [`!cowsay \u003cmessage\u003e`](https://i.imgur.com/mCYHFM6.png) - Draws a cow that says what you want\n\n\u003e Additionally check the results of performed commands in StackStorm control panel:  \nhttps://www.chatops/\nusername: `demo`\npassword: `demo`\n\n#### 4. Don't stop!\nTry it, explore the internals. For configuration see: [`ansible.sh`](ansible.sh), [`chatops.sh`](chatops.sh) which are usual Vagrant shell provisioner scripts.\nIntegrate your custom workflows and deployment mechanisms, you'll see how your work becomes more efficient during time.\n\nFeel the power of control center and may the force will be with you!\n\n#### Need Help? Want to talk?\n[![Join our community Slack](https://stackstorm-community.herokuapp.com/badge.svg)](https://stackstorm.com/community-signup) [![IRC](https://img.shields.io/irc/%23stackstorm.png)](http://webchat.freenode.net/?channels=stackstorm)\n\nWe're always ready to help, feel free to:\n* Ask questions on our public Slack or IRC\n* Report bug, provide feature request or just give us a ✮ star at [GitHub st2](https://github.com/StackStorm/st2)\n* Tell us how you use st2, share your StackStorm story. We love stories!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackstorm%2Fshowcase-ansible-chatops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackstorm%2Fshowcase-ansible-chatops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackstorm%2Fshowcase-ansible-chatops/lists"}