aboutsummaryrefslogtreecommitdiff
path: root/gerboweb/deploy/setup_clippy.yml
blob: e4416e02c74087c0d9059f8682e97742467892e3 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
- name: Clone pixelterm git
  git:
    repo: https://github.com/jaseg/pixelterm
    dest: "{{clippy_root}}/var/lib/pixelterm.git"

- name: Clone clippy git
  git:
    repo: https://github.com/jaseg/clippy
    dest: "{{clippy_root}}/var/lib/clippy.git"

- name: Setup required packages for clippy
  command: arch-chroot "{{clippy_root}}" pacman -Syu --noconfirm python3 python-pip python-numpy python-pillow

- name: Setup pixelterm
  command: arch-chroot "{{clippy_root}}" sh -c "cd /var/lib/pixelterm.git && python3 setup.py install"

- name: Setup container clippy systemd service file
  template:
    src: clippy.service.j2
    dest: "{{clippy_root}}/etc/systemd/system/clippy.service"
    owner: root
    group: root
    mode: 0664

- name: Enable systemd machines target
  systemd:
    name: machines.target
    enabled: yes

- name: Copy over clippy container auto boot service file
  copy:
    src: clippy-nspawn.service
    dest: /etc/systemd/system/clippy-nspawn.service
    owner: root
    group: root
    mode: 0664

- name: Enable clippy container auto boot
  systemd:
    daemon-reload: yes
    name: clippy-nspawn.service
    enabled: yes

- name: Restart clippy container
  shell: |
    systemctl stop clippy-nspawn
    sleep 1
    systemctl start clippy-nspawn
    for x in $(seq 0 30); do
      systemctl -M clippy is-system-running && exit
      sleep 1
    done

- name: Enable clippy systemd service in container
  command: systemctl enable -M clippy clippy.service

- name: Restart clippy systemd service in container
  command: systemctl restart -M clippy clippy.service

#- name: Enable host networkd
#  systemd:
#    name: systemd-networkd
#    enabled: yes
#    state: started

- name: Enable clippy container networkd
  command: systemctl enable -M clippy systemd-networkd