--- - name: Copy Ubuntu dotfiles tags: [dotfiles, dotfiles:common] ansible.builtin.copy: src: "{{ playbook_dir }}/../dotfiles/ubuntu/{{ item.src }}" dest: "{{ effective_user_home }}/{{ item.dest }}" owner: "{{ effective_username }}" group: "{{ effective_user_group }}" mode: "{{ item.mode }}" loop: "{{ ubuntu_dotfiles | default([]) }}" loop_control: label: "{{ item.dest }}" - name: Ensure Docker apt keyrings directory exists tags: [packages] ansible.builtin.file: path: /etc/apt/keyrings state: directory owner: root group: root mode: "0755" when: ubuntu_manage_docker_repo | default(false) - name: Download Docker apt repository signing key tags: [packages] ansible.builtin.get_url: url: https://download.docker.com/linux/ubuntu/gpg dest: /etc/apt/keyrings/docker.asc owner: root group: root mode: "0644" when: ubuntu_manage_docker_repo | default(false) - name: Configure Docker apt repository tags: [packages] ansible.builtin.apt_repository: repo: >- deb [arch={{ 'amd64' if ansible_facts['architecture'] == 'x86_64' else 'arm64' if ansible_facts['architecture'] in ['aarch64', 'arm64'] else ansible_facts['architecture'] }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_facts['distribution_release'] }} stable filename: docker state: present update_cache: true when: ubuntu_manage_docker_repo | default(false) - name: Refresh apt package cache tags: [packages] ansible.builtin.apt: update_cache: true cache_valid_time: 3600 - name: Install packages on Ubuntu tags: [packages] ansible.builtin.apt: name: >- {{ ( (common_packages | default([])) + (ubuntu_packages_base | default([])) + (ubuntu_docker_packages | default([])) + (profile_packages | default([])) + ( (ubuntu_emacs_packages | default([])) if (emacs_enabled | default(false) | bool) else [] ) + (host_packages | default([])) ) | unique }} state: present - name: Add user to docker group tags: [packages] ansible.builtin.user: name: "{{ effective_username }}" groups: docker append: true when: (ubuntu_docker_packages | default([])) | length > 0