From eb39acaa06424d38671337a9d9592ec8f6265c79 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Sun, 21 Nov 2021 04:53:42 -0600 Subject: [PATCH] Adding a role for TheRaven --- roles/TheRaven/README.md | 25 +++++++++++++++ roles/TheRaven/tasks/main.yml | 35 ++++++++++++++++++++ roles/TheRaven/templates/raven.conf.j2 | 44 ++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 roles/TheRaven/README.md create mode 100644 roles/TheRaven/tasks/main.yml create mode 100644 roles/TheRaven/templates/raven.conf.j2 diff --git a/roles/TheRaven/README.md b/roles/TheRaven/README.md new file mode 100644 index 0000000..2c48da1 --- /dev/null +++ b/roles/TheRaven/README.md @@ -0,0 +1,25 @@ +We run a copy of [TheRaven ircbot](https://foundation.aninix.net/AniNIX/TheRaven) as a service on AniNIX/Core. + +# Etymology + +Ravens are smart, ubiquitous birds. [DarkFeather](https://foundation.aninix.net/DarkFeather) has chosen them as his avatar, and this bot serves as his IRC emissary and minion. + +# Development + +You can deploy this service directly with the following invocation: + +``` +ansible-playbook -i core, -e '{ "role": "TheRaven", "raven": { "ircnetwork": "localhost", "ircport": "6667", "serviceport": "8373" } }' playbooks/one-role.yml +``` + +# Configuration + +Most of the configuration is controlled through the [configuration files](https://foundation.aninix.net/AniNIX/TheRaven/src/branch/main/sample-confs) provided by the package. + +Some configuration comes from [the local template](./templates/raven.conf.j2) -- it expects the vault to have a `password.TheRaven` value. The rest of the variables are provided in the -e flag above. These can be set at the host or site level in the inventory. + +# Clients + +TheRaven can be accessed through any [IRC](../IRC) client -- start with `r.help` to see what commands are available. + + diff --git a/roles/TheRaven/tasks/main.yml b/roles/TheRaven/tasks/main.yml new file mode 100644 index 0000000..5b54d37 --- /dev/null +++ b/roles/TheRaven/tasks/main.yml @@ -0,0 +1,35 @@ +--- + + - name: TheRaven package + become: yes + register: theravenpkg + package: + name: TheRaven + state: present + + - name: TheRaven config directory + become: yes + file: + path: /usr/local/etc/TheRaven + owner: raven + group: raven + mode: 0750 + state: directory + + - name: TheRaven config + become: yes + register: theravenconfig + template: + src: raven.conf.j2 + dest: /usr/local/etc/TheRaven/raven.conf + owner: raven + group: raven + mode: 0640 + + - name: TheRaven service + when: theravenpkg.changed or theravenconfig.changed + become: yes + service: + name: raven.service + state: restarted + enabled: yes diff --git a/roles/TheRaven/templates/raven.conf.j2 b/roles/TheRaven/templates/raven.conf.j2 new file mode 100644 index 0000000..99d6210 --- /dev/null +++ b/roles/TheRaven/templates/raven.conf.j2 @@ -0,0 +1,44 @@ +[ Login ] +host={{ raven.ircnetwork }} +port={{ raven.ircport }} +username=TheRaven +password={{ passwords.TheRaven }} +netListenerPort={{ raven.serviceport }} + +[ Whitelist ] +DarkFeather +DF|Away +Connor + +[ Blacklist ] + +[ Notifications ] +#lobby=Connor +#lobby=DarkFeather + +[ Rooms ] +lobby +martialarts +mapuzzle +maworkouts +fencing +bjj +ccw +sharingan +foundation + +[ Searches ] +r.google|http://google.com/search?q=|+|Google +r.image|http://images.google.com/search?tbm=isch&q=|+|Google Images +r.wiki|http://en.wikipedia.org/wiki/|_|Wikipedia +r.sound|http://www.soundcloud.com/search?q=|%20|SoundCloud +r.dict|http://www.merriam-webster.com/dictionary/|+|Dictionary +r.tropes|http://tvtropes.org/pmwiki/search_result.php?cx=partner-pub-6610802604051523%3Aamzitfn8e7v&cof=FORID%3A10&ie=ISO-8859-1&siteurl=&ref=&ss=&siteurl=tvtropes.org%2F&ref=www.google.com%2F&ss=5135j1581675j28&q=|+|Tropes +r.yt|https://www.youtube.com/results?search_query=|+|YouTube +r.urban|http://www.urbandictionary.com/define.php?term=|+|UrbanDictionary +r.man|http://www.die.net/search/?q=|+|Man-page +r.hoogle|https://www.haskell.org/hoogle/?hoogle=|+|Hoogle +r.so|http://stackoverflow.com/search?q=|+|Stack Overflow +r.aninix|https://aninix.net/|_|AniNIX +r.map|https://www.google.com/maps/search/|+|Google Maps +r.translate|https://translate.google.com/?source=osdd/en/|%20|Google Translate