summaryrefslogtreecommitdiff
path: root/roles/ick-worker/tasks/main.yml
blob: e31919a19a8d434c0f1319a0a1fb2c0aae07bb0a (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
- name: install ick worker manager
  apt:
    name: "{{ item }}"
  with_items:
    - ick2
    - debootstrap
    - jq
    - less
    - htop
    - locales-all
    - systemd-container

- name: create config dirs
  file:
    state: directory
    path: "{{ item }}"
    owner: root
    group: root
    mode: 0755
  with_items:
    - /etc/ick

- name: install worker-manager config
  template:
    src: worker_manager.yaml.j2
    dest: /etc/ick/worker_manager.yaml
    owner: root
    group: root
    mode: 0644

- name: install token signing private key
  copy:
    content: "{{ token_private_key }}"
    dest: /etc/ick/token_key
    owner: _ickwm
    group: _ickwm
    mode: 0600

- name: install token signing public key
  copy:
    content: "{{ token_public_key }}"
    dest: /etc/ick/token_key.pub
    owner: _ickwm
    group: _ickwm
    mode: 0644

- name: enable and start units
  service:
    name: "{{ item }}"
    state: restarted
    enabled: yes
  with_items:
    - ick-worker

- name: configure ssh client with StrictHostKeyChecking=no
  lineinfile:
    dest: /etc/ssh/ssh_config
    state: present
    line: "StrictHostKeyChecking no"