community.general.catapult module – Send a sms / mms using the catapult bandwidth api

Note

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

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.

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

Synopsis

  • Allows notifications to be sent using sms / mms via the catapult bandwidth api.

Parameters

Parameter

Comments

api_secret

string / required

Api Secret from Api account page.

api_token

string / required

Api Token from Api account page.

dest

list / elements=string / required

The phone number or numbers the message should be sent to (must be in E.164 format, like +19195551212).

media

string

For MMS messages, a media url to the location of the media to be sent with the message.

msg

string / required

The contents of the text message (must be 2048 characters or less).

src

string / required

One of your catapult telephone numbers the message should come from (must be in E.164 format, like +19195551212).

user_id

string / required

User Id from Api account page.

Attributes

Attribute

Support

Description

check_mode

Support: none

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

  • Will return changed even if the media url is wrong.

  • Will return changed if the destination number is invalid.

Examples

- name: Send a mms to multiple users
  community.general.catapult:
    src: "+15035555555"
    dest:
      - "+12525089000"
      - "+12018994225"
    media: "http://example.com/foobar.jpg"
    msg: "Task is complete"
    user_id: "{{ user_id }}"
    api_token: "{{ api_token }}"
    api_secret: "{{ api_secret }}"

- name: Send a sms to a single user
  community.general.catapult:
    src: "+15035555555"
    dest: "+12018994225"
    msg: "Consider yourself notified"
    user_id: "{{ user_id }}"
    api_token: "{{ api_token }}"
    api_secret: "{{ api_secret }}"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

changed

boolean

Whether the api accepted the message.

Returned: always

Sample: true

Authors

  • Jonathan Mainguy (@Jmainguy)