From 9e92c317b7b1dca281a0a13abbba647044420c56 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 1 Oct 2018 12:09:08 +0300 Subject: Add: ick-ui --- hosts.ick | 1 + ick-ui.yml | 37 +++++++++++++++++++++++++++++++++++++ ick.hz | 5 +++++ roles/ick_ui/tasks/main.yml | 6 ++++++ run-ickui.sh | 27 +++++++++++++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 hosts.ick create mode 100644 ick-ui.yml create mode 100644 ick.hz create mode 100644 roles/ick_ui/tasks/main.yml create mode 100755 run-ickui.sh 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 < hosts.tmp +ansible-playbook -i hosts.tmp ick-ui.yml \ + "$@" -- cgit v1.2.1