aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/tasks/blackhole.yml
blob: 7c3b510bc86b698db2c0c600f24185fd10078a23 (plain) (blame)
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
---
- name: Create /etc/systemd/scripts
  file:
    dest: '/etc/systemd/scripts'
    state: directory
    owner: root
    group: root
    mode: 0755
- name: Install blackhole script
  copy:
    dest: '/etc/systemd/scripts/blackhole.sh'
    src: blackhole/blackhole.sh
    owner: root
    group: root
    mode: 0755
  notify:
  - restart blackhole

- name: Install blackhole service
  copy:
    dest: '/etc/systemd/system/blackhole.service'
    src: blackhole/blackhole.service
    owner: root
    group: root
    mode: 0644

- name: Enable blackhole service
  systemd:
    name: blackhole.service
    enabled: yes
    masked: no
    state: started
  when: not chroot
- name: '- when in chroot'
  command: systemctl enable blackhole.service
  args:
    creates: '/etc/systemd/system/multi-user.target.wants/blackhole.service'
  when: chroot

# vim: set ts=2 sw=2 et: