Giter Site home page Giter Site logo

Comments (3)

avelis avatar avelis commented on June 6, 2024

I might be out of my league here, but have you considered upgrading Ansible to v1.8.2? I don't seem to be having any Slack notifications issues with that version of Ansible.

from ansible-modules-extras.

AndreBremer avatar AndreBremer commented on June 6, 2024

There is a workaround.

The slack module recently changed the slack service endpoint. As a result, the token itself is no longer enough to post messages. It also requires two preceding - presumably secret - path components. The final URL is of the form https://hooks.slack.com/services/XXXX/YYYY/TOKEN

You can look up the required path components in your existing configured webhook slack integration and then pass it as the 'token' value to the slack module. The slack module will simply concatenate it and create the correct URL again:

- name: Send notification message via Slack all options
  local_action:
    module: slack
    domain: xxx.slack.com
    token: XXXX/YYYY/TOKEN 
    msg: "Branch {{ build }}, is now getting build on jenkins with these options: {{params}} optimize:{{optimize}} bootstrap:{{bootstrap}} and will stay up for {{timetolive}} days. The process can be followed here : xxx"
    channel: "#ci"
    link_names: 1

The old domain-style URLs are still working but appear to be deprecated.

To maintain backwards compatibility the module should make use of the 'domain' endpoint if it's supplied.

from ansible-modules-extras.

abadger avatar abadger commented on June 6, 2024

Okay, you've probably updated your playbook for the new API already but i've implemented handling for slack's deprecated API now. The logic is: if the token is new-style ( XXX/YYY/ZZZ ) then we use the new API. If the token is old style (it doesn't contain 2 or more /'s) then we require domain to be given in the playbook and use the old old API.

I couldn't find any documentation on the slack website that said what the token was precisely so it seemed okay to document that the token was all three secret path components in the new-style API rather than make three separate ansible slack module parameters for the values.

Closing This Ticket

Hi!

We believe recent commits (likely detailed above) should resolve this question or problem for you.

This will also be included in the next major release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular
issue is resolved.

Thank you!

from ansible-modules-extras.

Related Issues (20)

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.