# minecraft ~~ tasks/main.yml --- - name: create minecraft user user: name: "{{ minecraft_user }}" group: "{{ minecraft_user }}" - name: create minecraft directory file: path: "{{ minecraft_dir }}" owner: "{{ minecraft_user }}" group: "{{ minecraft_user }}" mode: 0700 state: directory - name: download minecraft server get_url: url: "{{ minecraft_url }}" dest: "{{ minecraft_dir }}/{{ minecraft_bin }}" owner: "{{ minecraft_user }}" - name: enable eula lineinfile: file: "{{ minecraft_dir }}/eula.txt" regexp: "^eula=false" line: eula=true become: true become_user: "{{ minecraft_user }}"