minecraft/tasks/main.yaml
changeset 19 31de177274a1
child 20 9cacee5eec83
equal deleted inserted replaced
18:ea20908c3904 19:31de177274a1
       
     1 ---
       
     2 
       
     3 - name: add minecract user
       
     4   become: yes
       
     5   user: name="{{minecraft_user}}" home="{{minecraft_dir}}"
       
     6 
       
     7 - name: install jre
       
     8   become: yes
       
     9   apt: name="default-jre-headless"
       
    10 
       
    11 - name: download minecraft
       
    12   become: yes
       
    13   get_url:
       
    14     url: "{{minecraft_url}}"
       
    15     dest: "{{minecraft_dir}}/server.jar"
       
    16     mode: "0755"
       
    17   notify: restart minecraft
       
    18 
       
    19 - name: configure eula
       
    20   become: yes
       
    21   copy:
       
    22     src: "eula.txt"
       
    23     dest: "{{minecraft_dir}}/eula.txt"
       
    24 
       
    25 - name: configure minecraft
       
    26   become: yes
       
    27   template:
       
    28     src: "server.properties.j2"
       
    29     dest: "{{minecraft_dir}}/server.properties"
       
    30     owner: "{{minecraft_user}}"
       
    31     group: "{{minecraft_user}}"
       
    32   notify: restart minecraft
       
    33 
       
    34 - name: install systemd service
       
    35   become: yes
       
    36   template:
       
    37     src: "minecraft.service.j2"
       
    38     dest: "/lib/systemd/system/minecraft.service"
       
    39 
       
    40 - name: ensure service is started
       
    41   become: yes
       
    42   systemd: name="minecraft.service" enabled="yes" state="started"