Prometheus and WriteFreely roles are work in progress.
authorLuke Hoersten <luke@hoersten.org>
Sun, 09 Feb 2020 11:59:05 -0600
changeset 1 fd351734f007
parent 0 df042396074e
child 2 2556522a2a45
Prometheus and WriteFreely roles are work in progress.
roles/prometheus/client/tasks/main.yaml
roles/prometheus/server/tasks/main.yaml
roles/writefreely/defaults/main.yaml
roles/writefreely/tasks/main.yaml
roles/writefreely/templates/config.ini.j2
roles/writefreely/templates/writefreely.service.j2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/prometheus/client/tasks/main.yaml	Sun Feb 09 11:59:05 2020 -0600
@@ -0,0 +1,4 @@
+---
+
+- name: install prometheus node exporter
+  apt: name="prometheus-node-exportery"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/prometheus/server/tasks/main.yaml	Sun Feb 09 11:59:05 2020 -0600
@@ -0,0 +1,19 @@
+---
+
+- name: add grafana apt key
+  become: yes
+  apt_key: url="https://packages.grafana.com/gpg.key"
+
+- name: add grafana apt repo
+  become: yes
+  apt_repository: repo="deb https://packages.grafana.com/oss/deb stable main"
+
+- name: install prometheus and grafana
+  become: yes
+  apt: name="{{item}}" state="latest"
+  with_items:
+    - "prometheus"
+    - "grafana"
+
+# /etc/prometheus/prometheus.yml
+# /etc/grafana/grafana.ini
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/writefreely/defaults/main.yaml	Sun Feb 09 11:59:05 2020 -0600
@@ -0,0 +1,9 @@
+---
+
+writefreely_version: "0.11.2"
+writefreely_release: "https://github.com/writeas/writefreely/releases/download/v{{writefreely_version}}/writefreely_{{writefreely_version}}_linux_arm7.tar.gz"
+
+writefreely_install_path: "/opt/writefreely"
+
+writefreely_apt_packages:
+  - "mysql"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/writefreely/tasks/main.yaml	Sun Feb 09 11:59:05 2020 -0600
@@ -0,0 +1,8 @@
+---
+
+- name: install apt packages
+  apt: name="{{writefreely_apt_packages}}"
+
+- name: download writefreely
+  archive:
+    src: "{{writefreely_release}}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/writefreely/templates/config.ini.j2	Sun Feb 09 11:59:05 2020 -0600
@@ -0,0 +1,44 @@
+[server]
+hidden_host          =
+port                 = {{writefreely_server_port}}
+bind                 = localhost
+tls_cert_path        =
+tls_key_path         =
+autocert             = true
+templates_parent_dir =
+static_parent_dir    =
+pages_parent_dir     =
+keys_parent_dir      =
+
+[database]
+type     = sqlite3
+filename = {{writefreely_db_name}}.db
+username =
+password =
+database =
+host     = localhost
+port     = 3306
+
+[app]
+site_name          = {{writefreely_site_name}}
+site_description   = {{writefreely_site_desc}}
+host               = {{writefreely_site_host}}
+theme              = write
+editor             =
+disable_js         = false
+webfonts           = true
+landing            =
+simple_nav         = false
+wf_modesty         = false
+chorus             = false
+disable_drafts     = false
+single_user        = true
+open_registration  = false
+min_username_len   = 3
+max_blogs          = 1
+federation         = true
+public_stats       = true
+private            = false
+local_timeline     = false
+user_invites       =
+default_visibility =
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/writefreely/templates/writefreely.service.j2	Sun Feb 09 11:59:05 2020 -0600
@@ -0,0 +1,11 @@
+[Unit]
+Description=WriteFreely %I Instance
+After=syslog.target network.target
+
+[Service]
+WorkingDirectory=/run/writefreely/%i
+ExecStart=/usr/local/bin/writefreely -c /etc/writefreely/%i.conf
+Restart=always
+
+[Install]
+WantedBy=multi-user.target