Giter Club home page Giter Club logo

showcase-ansible-chatops's Introduction

Ansible & ChatOps with Slack, Hubot and StackStorm - Vagrant demo

Part of tutorial: Ansible and ChatOps. Get started ๐Ÿš€

Introduction

This is quick demonstration of the StackStorm event-driven automation platform running with Ansible configuration management tool and Hubot ChatOps engine. The objective is to operate servers with Ansible directly from Slack chat.

Ansible and ChatOps with Slack and Hubot

It will get you up and running with chatops control VM with all St2 components prepared as well as Ansible and Hubot configured. Additionally, it installs 2 Ubuntu VMs: web server with nginx and db server with mysql.

As a result you should get 100% ready environment allowing you to execute Ansible ad-hoc commands and run Ansible playbooks against VMs directly from your Slack chat. In this showcase we already crafted some simple, but useful real world ChatOps commands.

Getting started

1. Prepare Slack

  • Create slack.com account if you don't have it yet.
  • Navigate Configure Integrations -> Filter -> Hubot and generate Slack & Hubot API Token.

2. Vagrant up

Edit Vagrantfile and add the just generated API token under HUBOT_SLACK_TOKEN constant, or just export it:

export HUBOT_SLACK_TOKEN=xoxb-1234-5678-91011-00e4dd

To provision the environment run:

vagrant up

Installation takes some time (st2 engine comes with Python, RabbitMQ, PostgreSQL, MongoDB, OpenStack Mistral).

3. Try ChatOps

You 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:

!help

Ansible ChatOps with StackStorm, Hubot and Slack. List of ChatOps commands Full list of available commands from st2_chatops_aliases pack:

Additionally check the results of performed commands in StackStorm control panel:
https://www.chatops/ username: demo password: demo

4. Don't stop!

Try it, explore the internals. For configuration see: ansible.sh, chatops.sh which are usual Vagrant shell provisioner scripts. Integrate your custom workflows and deployment mechanisms, you'll see how your work becomes more efficient during time.

Feel the power of control center and may the force will be with you!

Need Help? Want to talk?

Join our community Slack IRC

We're always ready to help, feel free to:

  • Ask questions on our public Slack or IRC
  • Report bug, provide feature request or just give us a โœฎ star at GitHub st2
  • Tell us how you use st2, share your StackStorm story. We love stories!

showcase-ansible-chatops's People

Contributors

armab avatar lindsayhill avatar pixelrebel avatar ruizink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

showcase-ansible-chatops's Issues

hosts.local permission denied

Everytime I run vagrant up I get the error:

C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.3.0/fileutils.rb:1394:in `initialize': Permission
denied @ rb_sysopen - C:/Users/trahloff/.vagrant.d/tmp/hosts.local (Errno::EACCES)

The Vagrantfile wasn't altered in any way.

Visited Links:

System:

  • Windows 10
  • Ruby: 2.3.4
  • Vagrant: 1.9.6
  • Vagrant-Hostmanager: 1.8.7

ERROR: 400 Client Error: Bad Request

Hi,

I have installed latest st2 on centos 7 version 2.1.1, while installing st2-ansible-chatops pack I am getting below error.

Its working fine for me on RHEL-7 with st2 version 2.0.1

[root@chatops]# st2 run packs.install packs=st2-ansible-chatops repo_url=armab/st2-ansible-chatops
ERROR: 400 Client Error: Bad Request
MESSAGE: Additional properties are not allowed ('repo_url' was unexpected) for url: http://127.0.0.1:9101/v1/executions

Please let me know, if there any configuration which i am missing.

-Rohit

packs.setup_virtualenv fails when installing w/ bionic64 the original trusty64 and focal64 also fails

Getting an error installing with Vagrant, trusty64 and focal64 failed, trying with bionic64 and got further

[2:11](https://stackstorm-community.slack.com/archives/C066APT88/p1649797918452639)
    chatops: +--------------------------+------------------------+--------------------------+--------------------------+--------------------------+
    chatops: | id                       | status                 | task                     | action                   | start_timestamp          |
    chatops: +--------------------------+------------------------+--------------------------+--------------------------+--------------------------+
    chatops: | 6255e90f7317de5932471e7c | succeeded (0s elapsed) | init_task                | core.noop                | Tue, 12 Apr 2022         |
    chatops: |                          |                        |                          |                          | 21:03:11 UTC             |
    chatops: | 6255e9107317de5932471e8c | succeeded (3s elapsed) | download_pack            | packs.download           | Tue, 12 Apr 2022         |
    chatops: |                          |                        |                          |                          | 21:03:11 UTC             |
    chatops: | 6255e9127317de5932471e9c | succeeded (1s elapsed) | make_a_prerun            | packs.virtualenv_prerun  | Tue, 12 Apr 2022         |
    chatops: |                          |                        |                          |                          | 21:03:14 UTC             |
    chatops: | 6255e9137317de5932471eac | succeeded (1s elapsed) | get_pack_dependencies    | packs.get_pack_dependenc | Tue, 12 Apr 2022         |
    chatops: |                          |                        |                          | ies                      | 21:03:15 UTC             |
    chatops: | 6255e9147317de5932471ebc | succeeded (0s elapsed) | check_dependency_and_con | core.noop                | Tue, 12 Apr 2022         |
    chatops: |                          |                        | flict_list               |                          | 21:03:16 UTC             |
    chatops: | 6255e9147317de5932471ecc | failed (9s elapsed)    | install_pack_requirement | packs.setup_virtualenv   | Tue, 12 Apr 2022         |
    chatops: |                          |                        | s                        |                          | 21:03:16 UTC             |
    chatops: +--------------------------+------------------------+--------------------------+--------------------------+--------------------------+

failed pack dependency installation

my setup is running into the same error each time, can't figure out why it is failing on the Ansible installation pack

==> chatops: id: 59ad556e0a84b422cb842b77
==> chatops: action.ref: packs.install
==> chatops: parameters: 
==> chatops:   packs:
==> chatops:   - ansible
==> chatops: status: failed
==> chatops: result_task: install pack dependencies
==> chatops: result: 
==> chatops:   exit_code: 1
==> chatops:   result: None
==> chatops:   stderr: "st2.actions.python.SetupVirtualEnvironment

------

==> chatops: traceback: None
==> chatops: failed_on: install pack dependencies
==> chatops: start_timestamp: 2017-09-04T13:30:22.129460Z
==> chatops: end_timestamp: 2017-09-04T13:30:55.177667Z
==> chatops: +--------------------------+------------------------+------+--------+-----------------+
==> chatops: | id                       | status                 | task | action | start_timestamp |
==> chatops: +--------------------------+------------------------+------+--------+-----------------+
==> chatops: | 59ad556e0a84b41f320e2bcc | succeeded (4s elapsed) | down | packs. | Mon, 04 Sep     |
==> chatops: |                          |                        | load | downlo | 2017 13:30:22   |
==> chatops: |                          |                        | pack | ad     | UTC             |
==> chatops: | 59ad55720a84b41f320e2bcf | succeeded (2s elapsed) | make | packs. | Mon, 04 Sep     |
==> chatops: |                          |                        | a pr | virtua | 2017 13:30:26   |
==> chatops: |                          |                        | erun | lenv_p | UTC             |
==> chatops: |                          |                        |      | rerun  |                 |
==> chatops: | 59ad55740a84b41f320e2bd2 | failed (26s elapsed)   | inst | packs. | Mon, 04 Sep     |
==> chatops: |                          |                        | all  | setup_ | 2017 13:30:28   |
==> chatops: |                          |                        | pack | virtua | UTC             |
==> chatops: |                          |                        | depe | lenv   |                 |
==> chatops: |                          |                        | nden |        |                 |
==> chatops: |                          |                        | cies |        |                 |
==> chatops: +--------------------------+------------------------+------+--------+-----------------+
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

I think it have to do something with .h:17:27: fatal error: gssapi/gssapi.h: No such file or directory but don't know for sure

CSS/Form Field Render Issue

Dropdowns on Form fields has the default css attribute .st2-auto-form__field option value was color: white wasn't sure if this was an already tweaked fix upstream.

image

image

*From daily release of Chrome .deb on Ubuntu 14.04

Compatibility with v2.1 Pack Management

With the New Pack Management https://stackstorm.com/2016/12/06/2-1-new-pack-management/ introduced in StackStorm v2.1 a lot of things changed, including command syntax and chatops.

The following resources needs updating:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.