# Ansible playbook to install stuff for a standard install with v-i. # You should inspect the user_* variables at the end, and override # them with "ansible_vars" in the system spec file. v-i sets the # hostname variable automatically. - hosts: image tasks: - name: "set /etc/hostname" copy: content: | {{ hostname }} dest: /etc/hostname - name: "lock root password" shell: | passwd -l root - name: "create ~root/.ssh" file: state: directory path: /root/.ssh owner: root group: root mode: 0700 - name: "set ~root/.ssh/authorized keys" copy: content: | {{ user_pub }} dest: /root/.ssh/authorized_keys owner: root group: root mode: 0600 - name: "configure keyboard layout" copy: content: | XKBMODEL="{{ user_keyboard_model }}" XKBLAYOUT="{{ user_keyboard_layout }}" XKBVARIANT="" XKBOPTIONS="" BACKSPACE="guess" dest: /etc/default/keyboard - name: "configure console" copy: content: | ACTIVE_CONSOLES="/dev/tty[1-6]" CHARMAP="UTF-8" CODESET="{{ user_console_codeset }}" FONTFACE="Fixed" FONTSIZE="8x16" VIDEOMODE= dest: /etc/default/console-setup - name: "set default locales for all users" copy: content: | {{ user_locale }} dest: /etc/profile.d/locale.sh - name: "remove ifupdown" apt: name: ifupdown state: absent - name: "configure networkd" copy: content: | [Match] Name=eth0 [Network] DHCP=yes dest: /etc/systemd/network/external.network - name: "enable networkd" systemd: name: systemd-networkd enabled: yes vars: ansible_python_interpreter: /usr/bin/python3 # You may want to override these. user_locale: | export LC_CTYPE=fi_FI.UTF8 user_keyboard_model: pc105 user_keyboard_layout: fi user_console_codeset: Lat15