1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- hosts: babybuddy
  tasks:

  - file:
      path: /usr/share/babybuddy
      state: directory

  - docker_compose:
      project_name: babybuddy
      definition:
        version: "2.1"
        services:
          babybuddy:
            # https://github.com/babybuddy/babybuddy/issues/337
            image: lscr.io/linuxserver/babybuddy:v1.9.0-ls14
            container_name: babybuddy
            environment:
              - TZ=America/Los_Angeles
            volumes:
              - /usr/share/babybuddy:/config
            ports:
              - 8000:8000
            restart: unless-stopped

  - template:
      src: babybuddy.nginx
      dest: /etc/nginx/sites-available/babybuddy.conf
    notify: Restart nginx
  - file:
      src: /etc/nginx/sites-available/babybuddy.conf
      dest: /etc/nginx/sites-enabled/babybuddy.conf
      state: link
    notify: Restart nginx

  handlers:

    - name: Restart nginx
      service:
        name: nginx
        state: restarted