summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-10-01 12:09:08 +0300
committerLars Wirzenius <liw@liw.fi>2018-10-01 12:09:08 +0300
commit9e92c317b7b1dca281a0a13abbba647044420c56 (patch)
tree8049d6a999949d4725f9c357a8eaac4dc5221f30
parentd11a62e5168560db31816e0c51adca73ce6770fd (diff)
downloadick2-ansible-9e92c317b7b1dca281a0a13abbba647044420c56.tar.gz
Add: ick-ui
-rw-r--r--hosts.ick1
-rw-r--r--ick-ui.yml37
-rw-r--r--ick.hz5
-rw-r--r--roles/ick_ui/tasks/main.yml6
-rwxr-xr-xrun-ickui.sh27
5 files changed, 76 insertions, 0 deletions
diff --git a/hosts.ick b/hosts.ick
new file mode 100644
index 0000000..9b8cbe5
--- /dev/null
+++ b/hosts.ick
@@ -0,0 +1 @@
+ui ansible_ssh_host=ick-ui.vm.liw.fi
diff --git a/ick-ui.yml b/ick-ui.yml
new file mode 100644
index 0000000..eba69b8
--- /dev/null
+++ b/ick-ui.yml
@@ -0,0 +1,37 @@
+- hosts: ui
+ remote_user: root
+ become: yes
+ roles:
+ - sane_debian_system
+ - unix_users
+ - comfortable
+ - apache_server
+ - ick_ui
+ vars:
+ hostname: ick
+
+ wm_ssh_key_pub: "{{ lookup('pipe', 'pass show ick2/wm_ssh_key_pub') }}"
+
+ unix_users:
+ - username: root
+ authorized_keys: |
+ {{ wm_ssh_key_pub }}
+ {{ demo_wm_ssh_key_pub }}
+ {{ liw_ssh_key_pub }}
+ - username: ivan
+ sudo: yes
+ authorized_keys: |
+ {{ ivan_ssh_key_pub }}
+
+ letsencrypt: yes
+ letsencrypt_email: liw@liw.fi
+
+ static_sites:
+ - domain: ick-ui.vm.liw.fi
+ owner: root
+ ownermail: liw@liw.fi
+ letsencrypt: yes
+
+ sources_lists:
+ - repo: "deb https://deb.nodesource.com/node_10.x stretch main"
+ signing_key: "{{ nodesource_signing_key }}"
diff --git a/ick.hz b/ick.hz
new file mode 100644
index 0000000..71294ff
--- /dev/null
+++ b/ick.hz
@@ -0,0 +1,5 @@
+defaults:
+ type: cx11
+ image: debian-9
+hosts:
+ - name: ui
diff --git a/roles/ick_ui/tasks/main.yml b/roles/ick_ui/tasks/main.yml
new file mode 100644
index 0000000..571c25f
--- /dev/null
+++ b/roles/ick_ui/tasks/main.yml
@@ -0,0 +1,6 @@
+- name: "install packages for ickui"
+ apt:
+ name: "{{ item }}"
+ with_items:
+ - build-essential
+ - nodejs
diff --git a/run-ickui.sh b/run-ickui.sh
new file mode 100755
index 0000000..8c5a80e
--- /dev/null
+++ b/run-ickui.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -eu
+
+
+getaddr()
+{
+ awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" |
+ sed 's/ansible_ssh_host=//'
+}
+
+
+mkhosts()
+{
+ cat <<EOF
+ui ansible_ssh_host=$(getaddr ui)
+
+[ickhost]
+ui
+EOF
+}
+
+hosts_in="$1"
+shift 1
+mkhosts > hosts.tmp
+ansible-playbook -i hosts.tmp ick-ui.yml \
+ "$@"