community.general.irc module – Send a message to an IRC channel or a nick
Note
This module is part of the community.general collection (version 4.8.3).
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
.
To use it in a playbook, specify: community.general.irc
.
Parameters
Parameter |
Comments |
---|---|
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. |
|
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. Choices:
|
|
Channel key |
|
The message body. |
|
Nickname to send the message from. May be shortened, depending on server’s NICKLEN setting. Default: “ansible” |
|
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. |
|
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. Choices:
|
|
Server password |
|
IRC server port number Default: 6667 |
|
IRC server name/address Default: “localhost” |
|
Text style for the message. Note italic does not work on some clients Choices:
|
|
Timeout to use while waiting for successful registration and join messages, this is to prevent an endless loop Default: 30 |
|
Set the channel topic |
|
Designates whether TLS/SSL should be used when connecting to the IRC server Choices:
|
Examples
- 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
Authors
Jan-Piet Mens (@jpmens)
Matt Martz (@sivel)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication