# Set hostname. - name: set hostname hostname: name={{ hostname }} - name: add hostname to /etc/hosts lineinfile: dest: /etc/hosts regexp: '^127\.0\.0\.1' line: "127.0.0.1 localhost {{ hostname }}" owner: root group: root mode: 0644 # Configure the main sources.list using a Jinja2 template, because # there's a whole bunch of repos and there's some conditional repos # involved. - name: configure main sources.list template: src: sources.list.j2 dest: /etc/apt/sources.list # Update lists, upgrade packages. - name: update apt package lists apt: update_cache: yes cache_valid_time: 0 - name: upgrade packages apt: upgrade: dist - name: free up disk space by removing apt package cache shell: | apt"-get" clean # Install/configure packages that are always needed. - name: install acpi-support-base apt: name=acpi-support-base - name: install ntp apt: name=ntp - name: install locales apt: name=locales - name: create en_GB.UTF-8 locale locale_gen: state=present name=en_GB.UTF-8 - name: create fi_FI.UTF-8 locale locale_gen: state=present name=fi_FI.UTF-8 # Get rid of bash-completion. It tends to irritate me more than it is # ever helpful. - name: REMOVE bash-completion apt: name: bash-completion state: absent purge: yes