aboutsummaryrefslogtreecommitdiff
path: root/roles/pterodactyl_wings/tasks/main.yml
blob: 8641971fc74c2df7609e8c3552a05509bb51737e (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
---
- name: Install GnuPG
  apt:
    name: gnupg2
  become: yes

- name: Docker APT Key
  apt_key:
    url: 'https://download.docker.com/linux/debian/gpg'
    state: present
  become: yes

- name: Install Docker APT Repository
  template:
    src: docker.list.j2
    dest: /etc/apt/sources.list.d/docker.list
  become: yes
  register: install_repo

- name: Update cache
  apt:
    update_cache: yes
  become: yes
  when: install_repo.changed

- name: Install packages
  apt:
    name: docker-ce docker-ce-cli containerd.io
  become: yes

- name: Create dirs
  file:
    state: directory
    path: /etc/pterodactyl
  become: yes

- name: Check for changed cert
  command: /bin/true
  when: '{{ cert_changed | default(False) }}'
  notify:
    - Handle systemd

- name: Enable docker
  systemd:
    name: docker
    enabled: yes
    state: started
  become: yes

- name: Download Wings
  get_url:
    url: 'https://github.com/pterodactyl/wings/releases/download/{{ wings_version }}/wings_linux_amd64'
    checksum: 'sha256:{{ wings_checksum }}'
    dest: /usr/local/bin/wings
    owner: root
    group: root
    mode: '755'
  become: yes
  notify:
    - Handle systemd

- name: Install unit file
  copy:
    src: 'wings.service'
    dest: '/etc/systemd/system/wings.service'
  become: yes
  notify: Handle systemd