This use-case is only a very small and easy one but shows a lot of the power and possibilities you have with todays tools. Here are some screenshots and outputs of my results: After playing around check on your network-devices if the base_config is ensured and if the vlans you added/deleted via chat-commands are really added/deleted to/from your devices. Go back to your Slack-team and execute some commands. Now restart st2chatops with sudo service st2chatops restart. # Slack settings (): # export HUBOT_ADAPTER =slack # Currently supported: slack, hipchat, xmpp, yammer, irc, flowdock. # Chat service adapter settings # Uncomment one of the adapter blocks below. #export ST2_WEBUI_URL= export ST2_WEBUI_URL = # Public URL of StackStorm instance: used it to offer links to execution details in a chat. # ST2 credentials export ST2_AUTH_USERNAME =st2admin (Don’t use `localhost` as it would point to the Docker container).
# StackStorm settings # StackStorm api endpoint. # Log level export HUBOT_LOG_LEVEL =debug # Hubot port - must be accessible from StackStorm export EXPRESS_PORT =8081 # Hubot settings # set if you don’t have a valid SSL certificate. For our purpose the ansible playbooks and roles will be included additionaly. Packs could contain StackStorm actions, aliases, rules and sensors. I have built two custom StackStorm packs which we will install now.
#Vagrant install slack update
Now also update the chatops pack files to the most recent version, because the one installed via apt-get includes a bug (replaces \n with setting up all those things please play around with some st2 commands on the StackStorm-VM or look at the web-interface. These things are included in the st2chatops package which gets installed with apt. In the Setup ChatOps section you will also install hubot and the StackStorm-hubot-plugin. If you have trouble installing or starting mistral please check your installed locales. SSH to your vagrant VM with vagrant ssh and follow the official install instructions for StackStorm on Ubuntu.
nfigure(VAGRANTFILE_API_VERSION) do |config|Ĭonfig.vm.network "public_network ", ip: "192.168.0.21 " Now invite your hubot to one of your team-channels (replace the bot-name with your own): We will use it as a gateway between Slack and StackStorm. Hubot is an open source bot, written in CoffeeScript on Node.js and a standardized way to share scripts between everyones robots. Also copy the API Token to a temporary text file. After creating the team go to team settings->Configure Apps, search for hubot and add it to your team. In my environment the team is named itsnetwork. Lets get started with the Slack components Summarized we have to install and configure the following components: The following picture illustrates the automation workflow. In this blog post I want to show you the possibilities and how you can get this working in your own environment. At the moment of writing this post I had build actions and aliases in StackStorm to add or delete vlans and to ensure a base config on my network switches. I started a project in my development environment with the goal to automate Cisco IOS-devices over simple chat-messages in Slack. The community-edition will still be available as open-source product at no charge. A few days before the start-up just got bought by Brocade, which let me hope about getting more networking-content within StackStorm in the future. The tool is very successful and has a big company behind. StackStorm is a tool for event-driven automation. If you are interested in network-automation networktocode is the place to go. For example there is already a blog post published by which covers a similar topic. I also got inspired by some great guys who are active in the networktocode slack-team. I thought about bringing this topic together with network-automation and the things I have learned about Ansible and Co. Or about executing task Y as soon as a special mail gets obtained. Think about executing task X when a POST-request gets fired to an application. Event-driven automation is a very interesting topic.