Skip to content

Instantly share code, notes, and snippets.

@s-schumann
Last active February 6, 2020 11:19
Show Gist options
  • Save s-schumann/eaa221c938795d1d3495139ecc6a54b4 to your computer and use it in GitHub Desktop.
Save s-schumann/eaa221c938795d1d3495139ecc6a54b4 to your computer and use it in GitHub Desktop.
Install latest Homer from repo with Ansible
---
- hosts: all
become: yes
pre_tasks:
- name: System update
apt:
update_cache: yes
cache_valid_time: 3600
- name: Update all packages to the latest version
apt:
upgrade: safe
- name: Set timezone to Europe/Berlin
timezone:
name: Europe/Berlin
- name: Ensure a locale exists
locale_gen:
name: en_US.UTF-8
state: present
tasks:
- name: Get essentials
apt:
pkg:
- curl
- wget
- git
- lsb-release
- build-essential
- dpkg-dev
- tshark
- postgresql-client
state: present
update_cache: yes
- name: Download heplify-server release
get_url:
url: https://github.com/sipcapture/heplify-server/releases/download/1.15/heplify-server
dest: /usr/local/bin/heplify-server
mode: '0555'
- name: Set homer-app destination
set_fact:
homerapp_dst: "/usr/local/src/homer-app"
- name: Clone homer-app
git:
repo: "https://github.com/sipcapture/homer-app"
dest: "{{ homerapp_dst }}"
clone: yes
version: "master"
- name: Copy homer-app
copy:
src: /usr/local/src/homer-app/homer-app
remote_src: yes
dest: /usr/local/bin/homer-app
mode: u=rx,g=rx,o=rx
- name: Copy heplify-server configuration
copy:
src: ./heplify-server.toml
dest: /usr/local/etc/heplify-server.toml
- name: Set homer-app config
set_fact:
homercfg_dst: "/usr/local/homer"
- name: Create directory for homer-app config
file:
path: "{{ homercfg_dst }}/etc"
state: directory
mode: u=rwx,g=rx,o=rx
recurse: yes
- name: Copy homer-app config
copy:
src: ./webapp_config.json
dest: "{{ homercfg_dst }}/etc/webapp_config.json"
- name: Create directory for homer-app log
file:
path: "{{ homercfg_dst }}/log"
state: directory
mode: u=rwx,g=rx,o=rx
recurse: yes
- name: Copy dist files
copy:
src: /usr/local/src/homer-app/dist
dest: "{{ homercfg_dst }}"
remote_src: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment