--- - name: Install required packages for building ansible.builtin.apt: name: "{{ build_packages }}" state: present update_cache: yes when: ansible_os_family == "Debian" - name: Check if BuildTools already exists ansible.builtin.stat: path: "{{ minecraft_sources_dir }}/{{ buildtools_jar }}" register: buildtools_exists - name: Download BuildTools ansible.builtin.get_url: url: "{{ minecraft_build_tools_url }}" dest: "{{ minecraft_sources_dir }}/{{ buildtools_jar }}" owner: "{{ minecraft_user }}" group: "{{ minecraft_group }}" mode: '0644' force: yes when: not buildtools_exists.stat.exists or force_download | default(false) - name: Create work directory for compilation ansible.builtin.file: path: "{{ minecraft_sources_dir }}/work" state: directory owner: "{{ minecraft_user }}" group: "{{ minecraft_group }}" mode: '0755'