community.general.heroku_collaborator module – Add or delete app collaborators on Heroku

Note

This module is part of the community.general collection (version 9.5.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.general.heroku_collaborator.

Synopsis

  • Manages collaborators for Heroku apps.

  • If set to present and heroku user is already collaborator, then do nothing.

  • If set to present and heroku user is not collaborator, then add user to app.

  • If set to absent and heroku user is collaborator, then delete user from app.

Requirements

The below requirements are needed on the host that executes this module.

  • heroku3

Parameters

Parameter

Comments

api_key

string

Heroku API key

apps

list / elements=string / required

List of Heroku App names

state

string

Create or remove the heroku collaborator

Choices:

  • "present" ← (default)

  • "absent"

suppress_invitation

boolean

Suppress email invitation when creating collaborator

Choices:

  • false ← (default)

  • true

user

string / required

User ID or e-mail

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • HEROKU_API_KEY and TF_VAR_HEROKU_API_KEY environment variables can be used instead setting api_key.

  • If you use check_mode, you can also pass the -v flag to see affected apps in msg, e.g. [“heroku-example-app”].

Examples

- name: Create a heroku collaborator
  community.general.heroku_collaborator:
    api_key: YOUR_API_KEY
    user: [email protected]
    apps: heroku-example-app
    state: present

- name: An example of using the module in loop
  community.general.heroku_collaborator:
    api_key: YOUR_API_KEY
    user: '{{ item.user }}'
    apps: '{{ item.apps | default(apps) }}'
    suppress_invitation: '{{ item.suppress_invitation | default(suppress_invitation) }}'
    state: '{{ item.state | default("present") }}'
  with_items:
    - { user: '[email protected]' }
    - { state: 'absent', user: '[email protected]', suppress_invitation: false }
    - { user: '[email protected]', apps: ["heroku-example-app"] }

Authors

  • Marcel Arns (@marns93)