An ansible role to setup slack team.
This is a sample of a YAML file containing the variables.
---
slack_token: XXXXXXXXXXX
slack_users:
- first_name: AAA
last_name: BBBB
email: aaabbb@example.com
channels:
- "a"
- "b"
- "c"
slack_channels:
- name: "c"
private: no
Here are the description of each variables:
slack_token
: The token generated by a user that has admin priviledge (see https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens for instructions)slack_users
: a list of dictionaries with user dataslack_channels
: a list of groups to be created (can be an empty list)
Due to the sensitive nature of the variables it's best to use ansible-vault to create the vars.yml
Steps:
$ ansible-vault create vars.yml
it will ask for a password and it will be needed when we're running the playbook later- Specify the variables in the file and save it
Important note:
- You must be running this as an Admin user in the Slack workspace.
$ ansible-playbook -e "@path/to/vars.yml" playbooks/setup_slack.yml --ask-vault-pass
and enter the password you've previously set for vars.yml
- hosts: servers
roles:
- { role: setup-slack }
Apache License 2.0
Red Hat Community of Practice & staff of the Red Hat Open Innovation Labs.