From 0a705cc2f3be32f9a1e25403cbfca3e1046d0499 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mon, 27 Jun 2016 20:27:11 +0000 Subject: [PATCH] Add systemd service files for the supybots, switch prod to limnoria --- roles/supybot/files/ursabot.service | 14 +++++++++ roles/supybot/files/zodbot.service | 14 +++++++++ roles/supybot/tasks/main.yml | 45 ++++++++++++++++++----------- 3 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 roles/supybot/files/ursabot.service create mode 100644 roles/supybot/files/zodbot.service diff --git a/roles/supybot/files/ursabot.service b/roles/supybot/files/ursabot.service new file mode 100644 index 0000000000..893400febe --- /dev/null +++ b/roles/supybot/files/ursabot.service @@ -0,0 +1,14 @@ +[Unit] +Description=ursabot irc bot +After=network.target + +[Service] +Type=simple +User=daemon +Group=daemon +ExecStart=/usr/bin/supybot /var/lib/ursabot/conf/ursabot.conf +Restart=always +WorkingDirectory=/srv/web/meetbot + +[Install] +WantedBy=multi-user.target diff --git a/roles/supybot/files/zodbot.service b/roles/supybot/files/zodbot.service new file mode 100644 index 0000000000..a724541852 --- /dev/null +++ b/roles/supybot/files/zodbot.service @@ -0,0 +1,14 @@ +[Unit] +Description=zodbot irc bot +After=network.target + +[Service] +Type=simple +User=daemon +Group=daemon +ExecStart=/usr/bin/supybot /var/lib/zodbot/conf/zodbot.conf +Restart=always +WorkingDirectory=/srv/web/meetbot + +[Install] +WantedBy=multi-user.target diff --git a/roles/supybot/tasks/main.yml b/roles/supybot/tasks/main.yml index 3f74f8f269..effd58c959 100644 --- a/roles/supybot/tasks/main.yml +++ b/roles/supybot/tasks/main.yml @@ -1,16 +1,3 @@ -- name: install supybot package - yum: pkg={{ item }} state=present - with_items: - - supybot-gribble - - supybot-fedora - - supybot-koji - - supybot-notify - - supybot-pinglists - - supybot-fedmsg - - packagedb-cli - tags: supybot - when: env == "production" - - name: install limnoria package yum: pkg={{ item }} state=present enablerepo=epel-testing with_items: @@ -23,7 +10,6 @@ - packagedb-cli - python-simplejson tags: supybot - when: env == "staging" - set_fact: botname={{ botnames[env] }} @@ -74,9 +60,34 @@ - meetbot - supybot -- name: setup cron job to start {{ botname }}/ursabot on boot - cron: name={{ botname }} special_time=reboot job='cd /srv/web/meetbot; supybot -d /var/lib/{{ botname }}/conf/{{ botname }}.conf' user=daemon +- name: setup zodbot systemd service file (prod) + copy: src=zodbot.service dest=/etc/systemd/system/zodbot.service + notify: + - reload systemd + tags: + - config + - supybot + when: env =! "staging" + +- name: enable zodbot service (prod) + service: name=zodbot state=started enabled=true + when: env =! "staging" + tags: + - config + - supybot + +- name: setup ursabot systemd service file (stg) + copy: src=ursabot.service dest=/etc/systemd/system/ursabot.service + notify: + - reload systemd + tags: + - config + - supybot + when: env == "staging" + +- name: enable ursabot service (stg) + service: name=ursabot state=started enabled=true + when: env == "staging" tags: - config - - meetbot - supybot