summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2017-08-11 17:12:27 +0200
committerPierre-Yves Chibon <pingou@pingoured.fr>2017-08-11 17:13:07 +0200
commit40e85a778a8718f44bc5fcd35797443b900cd9c5 (patch)
tree160acc479cdc1963b77c432f64e8158ddf6c01cf
parentd5317702bd7baef90ea53e03ed63e1ee770ba611 (diff)
downloadansible-40e85a778a8718f44bc5fcd35797443b900cd9c5.tar.gz
ansible-40e85a778a8718f44bc5fcd35797443b900cd9c5.tar.xz
ansible-40e85a778a8718f44bc5fcd35797443b900cd9c5.zip
Let me introduce you to the rdbsync role
-rw-r--r--roles/rdbsync/tasks/main.yml26
-rw-r--r--roles/rdbsync/templates/rdbsync.service14
2 files changed, 40 insertions, 0 deletions
diff --git a/roles/rdbsync/tasks/main.yml b/roles/rdbsync/tasks/main.yml
new file mode 100644
index 000000000..e5c56eabe
--- /dev/null
+++ b/roles/rdbsync/tasks/main.yml
@@ -0,0 +1,26 @@
+---
+# Configuration for the rbsync service
+
+- name: install needed packages
+ yum: pkg={{ item }} state=present
+ with_items:
+ - rdbsync
+ tags:
+ - packages
+ - rdbsync
+
+- name: Override the default systemd service file
+ template: src={{ item.file }}
+ dest={{ item.location }}/{{ item.file }}
+ owner=apache group=apache mode=0600
+ with_items:
+ - { file: rdbsync.service, location: /etc/systemd/system/ }
+ tags:
+ - config
+ notify:
+ - restart systemd
+
+- name: Start and enable the service
+ service: name={{ item }} state=started enabled=yes
+ with_items:
+ - rdbsync
diff --git a/roles/rdbsync/templates/rdbsync.service b/roles/rdbsync/templates/rdbsync.service
new file mode 100644
index 000000000..9b643ece7
--- /dev/null
+++ b/roles/rdbsync/templates/rdbsync.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=A script to sync CentOS CI ResultsDB to Fedora
+After=network.target
+Documentation=https://github.com/jeremycline/rdbsync
+
+[Service]
+ExecStart=/usr/bin/rdbsync run --log-level=INFO --poll-interval=30 \
+ --centos-url http://resultsdb.ci.centos.org/resultsdb_api/api \
+ --fedora-url http://localhost/resultsdb_api/
+Type=simple
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target