Skip to content

Instantly share code, notes, and snippets.

@michaellihs
Last active June 1, 2016 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaellihs/6f18827f08d82f71522f592451d537c2 to your computer and use it in GitHub Desktop.
Save michaellihs/6f18827f08d82f71522f592451d537c2 to your computer and use it in GitHub Desktop.
DevOps Meetup Karlsruhe - ChatOps

DevOps KA 2016-05-31: ChatOps

Hosted by @synyx_ka

Presenters @verschdl @cyxchris

ChatOps = Kommunikation + Kollaboration + DevOps

Klassische Admin Arbeit: Dev --> Anfrage (z.B. Telefon) nach Admin --> macht was --> Antwort

  • --> "synchrone Requests"
  • Evtl. Redundanz, weil nur die direkt an Kommunikation Beteiligten etwas mitkriegen (A ruft B an, C hat die gleiche Anfrage, kriegt aber nichts davon mit)

Erste "Verbesserung" --> Kommunikation für Teams (Chat, IRC...)

  • Anfrage (über Chat) nach Admin --> Admin erledigt Anfrage, schreibt im Chat --> alle kriegen's mit

Nächste Verbesserung: Chatbot, der über Chat-Befehle z.B. Accounts anlegt demobot: gitlab add john:cust1

  • "Seiteneffekt": Doku ohne extra Aufwand

Nächste Verbesserung: shared shell / Scriptsammlung --> Bot

  • "private Script Sammlung" --> in Git --> bei updates muss jeder pullen...
  • Script Sammlung "in Bot werfen" --> keiner muss mehr Code sehen
  • Befehle sind jetzt unabhängig vom ausführenden System (Mac Win Linux...) (weil vom Bot ausgeführt)
  • Bot reagiert nur auf "bekanntes" Befehlsset
  • User brauchen keinen Zugriff auf Server / Shell, nur Zugriff auf IRC

Wissensverteilung im Team

  • geschieht "nebenher" durch "Mitlesen" im Chat
  • "einfache Tasks" können auf User verlagert werden

Sicherheit

  • Bot ist sehr mächtig --> Sicherheitskonzept notwendig
  • ACLs notwendig, geregelt über chat-nickname und Anmeldung am Chat
  • Bot mit Befehlen anreichern, die Zugriffsrechte an Bot Kommandos vergeben können

Zukunftsvision

  • SSH Daemon abschalten
  • Zugriff auf Server nur noch über definierte APIs durch Bot

Webhooks im Bot

  • Bot hat webhooks mit denen er von "aussen" angesprochen werden kann
  • z.B. für den Versand von Jenkins-Notifications
  • Bot kann auch auf "severities" reagieren --> wichtige Nachrichten entsprechend hervorheben
  • webhook für Infos von Vorgängen, die nicht von Bot getriggert wurden

Verwendetes Tools:

Don't s:

  • offtopic scripte (z.B. Wetterdienste...)
  • offtopic chat

Commands:

set -uf -o pipefail - get exit code of first error in shell scripts

@anoff
Copy link

anoff commented Jun 1, 2016

You can also set up hubot with rocket chat if you want on premise. Rc also comes with webhooks, which we successfully used to post Jenkins updates into our chart rooms.

@cy4n
Copy link

cy4n commented Jun 1, 2016

anoff: can you link or publish your hubot rocketchat adapter? we have only found a mediocre one couple weeks ago

@anoff
Copy link

anoff commented Jun 1, 2016

cy4n atm we are using rocket chat webhooks for Jenkins one way integration.
We used the official rc adaptor for hubot scripts:
https://github.com/RocketChat/hubot-rocketchat

@anoff
Copy link

anoff commented Jun 1, 2016

Bezogen auf Security find ich diesen Punkt hier sehr interessant:

Approvals add another layer of security. In certain scenarios, before the bot will run your command, it needs to ask for approval from another team. This insures that all the details are in place (is that server ready for provisioning, is the right asset tag included) and then moves forward with the command.

Gefunden auf victorops.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment