main.yml 1.94 KB
Newer Older
1
---
2
- name: Make HomelabOS data directory.
3
  file:
Nick Busey's avatar
Nick Busey committed
4
    path: "{{ item }}"
5
    state: directory
Nick Busey's avatar
Nick Busey committed
6 7 8 9 10 11
  loop:
    - /var/homelabos
    - /var/homelabos/telegraf
    - /var/homelabos/traefik
    - /var/homelabos/dasher
    - /var/homelabos/docker
12

13 14 15 16 17 18
- name: Configure Telegraf.
  template: src=telegraf.conf dest=/var/homelabos/telegraf/telegraf.conf

- name: Configure Traefik.
  template: src=traefik.toml dest=/var/homelabos/traefik/traefik.toml

19 20 21
- name: Configure Dasher
  template: src=dasher.config.json dest=/var/homelabos/dasher/config.json

22 23 24
- name: Configure HomelabOS systemd service.
  template: src=homelabos.service dest=/etc/systemd/system/homelabos.service

25 26 27
- name: Copy HomelabOS docker-compose.yml file into place.
  template:
    src: docker-compose.yml
Nick Busey's avatar
Nick Busey committed
28
    dest: /var/homelabos/docker/docker-compose.yml
29

Nick Busey's avatar
Nick Busey committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
# This breaks with Vagrant and seems unreliable. Let's find a better solution.
# - name: Create HomelabOS hosts file.
#   file:
#     path: /tmp/homelab_hosts
#     state: touch
#   delegate_to: localhost
#
# - name: Configure HomelabOS hosts file. You can find it at /tmp/homelabos_hosts on your machine.
#   lineinfile:
#     path: /tmp/homelab_hosts
#     line: '{{ ansible_host }} {{ item }}.{{ domain }} {{ item }}'
#   delegate_to: localhost
#   loop:
#     - irc
#     - emby
#     - money
#     - grafana
#     - homeassistant
#     - nextcloud
#     - paperless
#     - portainer
#     - terminal
#     - transmission
#     - music
#     - git
55

56
- name: Pull latest HomelabOS service docker images. (This could take a while the first time, it has to download quite a bit.)
57 58 59 60 61 62 63 64
  command: docker-compose -f /var/homelabos/docker/docker-compose.yml pull

- name: Restart HomelabOS service.
  systemd:
    name: homelabos
    enabled: yes
    daemon-reload: yes
    state: restarted
65 66

- debug:
67 68 69
    msg: "HomelabOS Installed successfully! Go to https://{{ domain }}/ to get started."

- debug:
70
    msg: "Problems? File an issue at https://gitlab.com/NickBusey/HomelabOS/issues"