aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jumbotron/tasks/autologin.yml
blob: f9052ba1350d71b139eb517bf14c7aef750be95e (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
---
- name: Make sure getty@tty1.service.d exists
  file:
    path: '/etc/systemd/system/getty@tty1.service.d'
    state: directory
    owner: root
    group: root
    mode: 0755

- name: Register existing getty@tty1 config
  find:
    paths: '/etc/systemd/system/getty@tty1.service.d/'
  register: getty_tty1_existing

- name: Autologin jumbotron on tty1
  copy:
    dest: '/etc/systemd/system/getty@tty1.service.d/'
    src: '{{ item }}'
    owner: root
    group: root
    mode: 0644
  with_fileglob: 'getty@tty1.service.d/*'
  register: getty_tty1_created

- name: Delete unneeded tty1 configuration
  file:
    path: '{{ item }}'
    state: absent
  with_items: "{{ getty_tty1_existing.files|map(attribute='path')|list }}"
  when: "item not in getty_tty1_created.results|map(attribute='dest')"

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