Using register inside a role and user the registered output in another role...working?

Hi Guys,

I’ve got 2 and more roles.

Role1:

`

  • name: App is deployed msg
    sudo: yes
    debug: msg=“App is deployed to domain.tld”
    register: slack
    `

Role2:

`

  • name: Send notification message via Slack
    local_action:
    module: slack
    domain: domain.slack.com
    channel: “#blaaaa
    token: supersecrettoken
    msg: “{{slack.stdout}}”

`

How can i reference in Role2 the slack.stdout from the Role1 register? I don’t get it. Or is there another solution to handle this? Can i write the output from register in Role1 to a variable? So i could call this in Role2 ?

Cheers
Christian

That should 'just work', registered vars are attached to the host
after that task is run, as long as that role runs first the variable
should be available.