diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2018-10-02 22:26:17 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2018-10-03 21:09:55 +0200 |
commit | 7cc8370ab5e3428c24f37b7259331b10038b6acb (patch) | |
tree | 3a54b887aed7b40662b267bba5edcf82fc29464e /roles/jumbotron/tasks/autologin.yml | |
parent | 4f98942a50341c2827ace103f153374f0b351135 (diff) | |
download | labitat-ansible-7cc8370ab5e3428c24f37b7259331b10038b6acb.tar.gz labitat-ansible-7cc8370ab5e3428c24f37b7259331b10038b6acb.tar.xz labitat-ansible-7cc8370ab5e3428c24f37b7259331b10038b6acb.zip |
jumbotron: add role to set up jumbotron rpi
Diffstat (limited to 'roles/jumbotron/tasks/autologin.yml')
-rw-r--r-- | roles/jumbotron/tasks/autologin.yml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/roles/jumbotron/tasks/autologin.yml b/roles/jumbotron/tasks/autologin.yml new file mode 100644 index 0000000..f9052ba --- /dev/null +++ b/roles/jumbotron/tasks/autologin.yml @@ -0,0 +1,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: |