Generating a token

Before we can use the Slack module in our Playbook, we need an access token to request one login to your Slack workspace; you can sign up for a workspace for free at https://slack.com/ if you don't already have one.

Once you are logged into your workspace, either using the web client or desktop application, select the Manage apps option from the Administration menu, as seen in the following screenshot: 

This will open your browser and take you to the App Directory for your workspace; from here, search for Incoming WebHooks and then click on Add Configuration.

The first part of the configuration is to choose which channel you would like the incoming Webhook to post messages to. I selected the general channel—once selected, you will be taken to a page that gives you a Webhook URL; make sure that you make a note of this URL as we will need it shortly. At the bottom of the page, you have the option to customize your Webhook.

In the Integration Settings at the bottom of the page, I entered the following information:

  • Post to Channel: I left it as #general
  • Webhook URL: This is prepopulated for you; you also have the choice of regenerating the URL here
  • Descriptive Label: I entered Ansible here
  • Customize Name: I entered Ansible here as well
  • Customize Icon: I left this as it was

Once the preceding details had been filled in, I clicked on the Save Settings button; this left me with a single incoming Webhook:

As mentioned already, I also made a note of the Webhook URL; for me, it was:

https://hooks.slack.com/services/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

Now that we have everything, we need to be configured on the Slack side to be able to start to send messages to our users using Ansible.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.219.217