geerlingguy.phergie
DEPRECATED - Ansible Role: Phergie PHP IRC Bot
DEPRECATED: This role is no longer supported because geerlingguy doesn't use Phergie anymore.
This role installs Phergie, a PHP-based IRC bot, on Linux systems like RHEL/CentOS and Debian/Ubuntu.
To use Phergie, run php phergie.php
in the directory where it's installed (set the location with phergie_install_path
). You may want to run it in the background and log the output. You can do this with the command:
$ nohup php /path/to/phergie.php > /path/to/log 2>&1&
Requirements
- Git (recommended role:
geerlingguy.git
). - PHP (recommended role:
geerlingguy.php
) - Installphp
,php-pdo
, andphp-sqlite
.
Role Variables
Here are the variables you can customize, along with their default values (see defaults/main.yml
):
phergie_install_path: "/home/{{ ansible_ssh_user }}/phergie"
phergie_user: "{{ ansible_ssh_user }}"
This sets where Phergie will be installed and the user it will run under.
phergie_timezone: America/Chicago
This sets the timezone for Phergie when it handles date-related actions.
phergie_connections:
- {
host: 'irc.freenode.net',
port: '6667',
username: 'PhergieExample',
realname: 'Phergie Example Bot',
nick: 'PhergieExample'
}
This is a list of server connections; Phergie can connect to multiple IRC servers, but usually just one connection is needed.
phergie_autojoin_channels:
- '#example'
This sets the channels Phergie will join after connecting to the IRC server.
phergie_command_prefix: ''
This sets a command prefix for Phergie (e.g., use !karma [keyword]
instead of karma [keyword]
).
phergie_ui_enabled: 'true'
This decides whether Phergie shows events in the console while running (helpful for debugging).
phergie_plugins:
- AltNick
- AutoJoin
- Beer
- Help
- Karma
- Lart
- Php
- Ping
- PingPong
- Pong
- Prioritize
- Quit
- Remind
- Serve
This is a list of plugins that Phergie will use. Check the complete list here.
phergie_altnicks: []
This sets alternative nicknames for Phergie to use if the main one is taken (requires AltNick
in phergie_plugins
).
phergie_wunderground_api_key: ''
This is the API key for Weather Underground (requires Wunderground
in phergie_plugins
).
phergie_karma_db_location: ''
This sets the path to an SQLite database that Phergie will use if Karma
is enabled. It's recommended to store it outside of the Phergie installation folder to avoid losing it during updates.
Dependencies
geerlingguy.git
Example Playbook
- hosts: ircbot
vars_files:
- vars/main.yml
roles:
- geerlingguy.phergie
In vars/main.yml
:
phergie_connections:
- {
host: 'irc.freenode.net',
port: '6667',
username: 'PhergieExample',
realname: 'Phergie Example Bot',
nick: 'PhergieExample'
}
License
MIT / BSD
Author Information
This role was created by Jeff Geerling in 2014, who is also the author of Ansible for DevOps.
ansible-galaxy install geerlingguy.phergie