community / community.general / 3.8.10 / module / irc Send a message to an IRC channel or a nick Authors: Jan-Piet Mens (@jpmens), Matt Martz (@sivel)community.general.irc (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Send a message to an IRC channel or a nick. This is a very simplistic implementation.
- name: Send a message to an IRC channel from nick ansible community.general.irc: server: irc.example.net channel: #t1 msg: Hello world
- name: Send a message to an IRC channel local_action: module: irc port: 6669 server: irc.example.net channel: #t1 msg: 'All finished at {{ ansible_date_time.iso8601 }}' color: red nick: ansibleIRC
- name: Send a message to an IRC channel local_action: module: irc port: 6669 server: irc.example.net channel: #t1 nick_to: - nick1 - nick2 msg: 'All finished at {{ ansible_date_time.iso8601 }}' color: red nick: ansibleIRC
key: description: - Channel key type: str msg: description: - The message body. required: true type: str nick: default: ansible description: - Nickname to send the message from. May be shortened, depending on server's NICKLEN setting. type: str part: default: 'yes' description: - Designates whether user should part from channel after sending message or not. Useful for when using a faux bot and not wanting join/parts between messages. type: bool port: default: 6667 description: - IRC server port number type: int color: aliases: - colour choices: - none - white - black - blue - green - red - brown - purple - orange - yellow - light_green - teal - light_cyan - light_blue - pink - gray - light_gray default: none description: - Text color for the message. ("none" is a valid option in 1.6 or later, in 1.6 and prior, the default color is black, not "none"). Added 11 more colors in version 2.0. type: str style: choices: - bold - underline - reverse - italic - none default: none description: - Text style for the message. Note italic does not work on some clients type: str topic: description: - Set the channel topic type: str passwd: description: - Server password type: str server: default: localhost description: - IRC server name/address type: str channel: description: - Channel name. One of nick_to or channel needs to be set. When both are set, the message will be sent to both of them. type: str nick_to: description: - A list of nicknames to send the message to. One of nick_to or channel needs to be set. When both are defined, the message will be sent to both of them. elements: str type: list timeout: default: 30 description: - Timeout to use while waiting for successful registration and join messages, this is to prevent an endless loop type: int use_ssl: default: 'no' description: - Designates whether TLS/SSL should be used when connecting to the IRC server type: bool