summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-20 16:09:19 +0100
committerBen Brown <ben.brown@codethink.co.uk>2017-10-23 11:11:13 +0000
commitd28577c8f0f602e92e722ac0d2561b86bf618484 (patch)
treee05a6abf1944032e510da5a3ec5997cf449f5ed0
parentb4c27d66732db3851726e6ae4b0dce77c3275731 (diff)
downloadinfrastructure-d28577c8f0f602e92e722ac0d2561b86bf618484.tar.gz
Move the Gitlab bot into the baserock_webserver machine
A few changes required to get it running on Fedora, but nothing major.
-rw-r--r--README.md2
-rw-r--r--baserock_webserver/gitlab-bot/config.js (renamed from baserock_bots/config.js)0
-rw-r--r--baserock_webserver/gitlab-bot/gitlab-bst-bot.conf (renamed from baserock_bots/gitlab-bst-bot.conf)0
-rw-r--r--baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in12
-rw-r--r--baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml (renamed from baserock_bots/gitlab_buildstream_secret.yml)0
-rw-r--r--baserock_webserver/instance-gitlab-bot-config.yml (renamed from baserock_bots/gitlab-bot.yml)23
6 files changed, 27 insertions, 10 deletions
diff --git a/README.md b/README.md
index 0e327230..b4dc1892 100644
--- a/README.md
+++ b/README.md
@@ -400,6 +400,8 @@ To deploy to production:
ansible-playbook -i hosts baserock_webserver/image-config.yml
ansible-playbook -i hosts baserock_webserver/instance-config.yml
+ ansible-playbook -i hosts baserock_webserver/instance-gitlab-bot-config.yml \
+ --vault-password-file ~/vault-infra-pass
The webserver machine runs [Cherokee](http://cherokee-project.com/). You
can use the `cherokee-admin` configuration UI, by connecting to the webserver
diff --git a/baserock_bots/config.js b/baserock_webserver/gitlab-bot/config.js
index 13b66e13..13b66e13 100644
--- a/baserock_bots/config.js
+++ b/baserock_webserver/gitlab-bot/config.js
diff --git a/baserock_bots/gitlab-bst-bot.conf b/baserock_webserver/gitlab-bot/gitlab-bst-bot.conf
index b34026a8..b34026a8 100644
--- a/baserock_bots/gitlab-bst-bot.conf
+++ b/baserock_webserver/gitlab-bot/gitlab-bst-bot.conf
diff --git a/baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in b/baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in
new file mode 100644
index 00000000..cc3f5af4
--- /dev/null
+++ b/baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description = Gitlab irc notifications server
+
+[Service]
+Type = simple
+ExecStart = /usr/bin/node {{ gitlab_to_irc_install_location }}/index.js
+User = fedora
+Group = fedora
+Restart = on-failure
+
+[Install]
+WantedBy=default.target
diff --git a/baserock_bots/gitlab_buildstream_secret.yml b/baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml
index 53ae22e0..53ae22e0 100644
--- a/baserock_bots/gitlab_buildstream_secret.yml
+++ b/baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml
diff --git a/baserock_bots/gitlab-bot.yml b/baserock_webserver/instance-gitlab-bot-config.yml
index 396ac8a7..4fb7710e 100644
--- a/baserock_bots/gitlab-bot.yml
+++ b/baserock_webserver/instance-gitlab-bot-config.yml
@@ -1,13 +1,21 @@
# Instance-specific configuration for the BuildStream Gitlab IRC bot
---
-- hosts: paste
+- hosts: webserver
vars_files:
- - gitlab_buildstream_secret.yml
+ - gitlab-bot/gitlab_buildstream_secret.yml
vars:
- gitlab_to_irc_url: https://gitlab.com/palvarez89/gitlab-to-irc
- gitlab_to_irc_branch: master
- - gitlab_to_irc_install_location: /home/ubuntu/gitlab-to-irc
+ - gitlab_to_irc_install_location: /home/fedora/gitlab-to-irc
tasks:
+ - name: Install Git
+ dnf: name=git state=latest
+ become: yes
+
+ - name: Install Node.js
+ dnf: name=nodejs state=latest
+ become: yes
+
- name: Download gitlab-to-irc sources
git:
repo: "{{ gitlab_to_irc_url }}"
@@ -21,21 +29,16 @@
- name: Install bot configuration file
template:
- src: config.js
+ src: gitlab-bot/config.js
dest: "{{ gitlab_to_irc_install_location }}/config.js"
-
- name: Install service for the bot
- template:
- src: gitlab-bst-bot.conf
- dest: /etc/init/gitlab-bst-bot.conf
+ template: src=gitlab-bot/gitlab-bst-bot.service.in dest=/etc/systemd/system/gitlab-bst-bot.service
become: yes
-
- name: Restart bot service
service:
name: gitlab-bst-bot
enabled: yes
state: restarted
become: yes
-