X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=ansible%2Froles%2Fbase%2Ftasks%2Fmain.yml;h=919b2aa451d531f19c6e1dae63b2c277f7b47f48;hb=e3a7398390a724363c49e8426b50cdfa28cb8142;hp=f209fe4bc5b9d217b9beedc6bd9c2d1c36018db2;hpb=dd82fdd89e6982c6c44092cd1d015965c35eee11;p=noc.git diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml index f209fe4..919b2aa 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/base/tasks/main.yml @@ -47,7 +47,7 @@ - name: Set authorized keys for root user authorized_key: user: root - key: "{{ lookup('pipe','cat ssh/noc/*.pub') }}" + key: "{{ noc_ssh_keys | join('\n') }}" exclusive: yes - name: disable apt suggests and recommends @@ -76,6 +76,7 @@ - unp - ca-certificates - file + - nano - zsh - python-apt state: present @@ -104,6 +105,21 @@ when: ansible_service_mgr == "systemd" +- block: + - name: workaround console-setup race condition (1/2) + file: + path: /etc/systemd/system/console-setup.service.d/ + state: directory + + - name: workaround console-setup race condition (2/2) + copy: + content: "[Unit]\nAfter=systemd-tmpfiles-setup.service\n" + dest: /etc/systemd/system/console-setup.service.d/override.conf + mode: 0644 + # no need to relaod systemd here, it is only there to fix a boot-time race-condition + + when: ansible_distribution == "Ubuntu" + - name: install zshrc with_items: - src: "zprofile" @@ -123,10 +139,9 @@ shell: /bin/zsh - name: set default shell for adduser - with_items: - - regexp: "^DSHELL" - line: "DSHELL=/bin/zsh" + with_dict: + DSHELL: /bin/zsh lineinfile: dest: /etc/adduser.conf - regexp: "{{ item.regexp }}" - line: "{{ item.line }}" + regexp: "^#?{{ item.key }}=" + line: "{{ item.key }}={{ item.value }}"