papermc/tasks/main.yaml
changeset 33 ad75fc2d2853
parent 27 8fddefdd948b
child 42 edb53dfadfb5
equal deleted inserted replaced
32:78242f9f4010 33:ad75fc2d2853
       
     1 ---
       
     2 
       
     3 - name: add papermc user
       
     4   become: yes
       
     5   user: name="{{papermc_user}}" home="{{papermc_dir}}"
       
     6 
       
     7 - name: install jre
       
     8   become: yes
       
     9   apt: name="default-jre-headless"
       
    10 
       
    11 - name: download papermc
       
    12   become: yes
       
    13   get_url:
       
    14     url: "{{papermc_url}}"
       
    15     dest: "{{papermc_dir}}/server.jar"
       
    16     mode: "0755"
       
    17   notify: restart papermc
       
    18 
       
    19 - name: configure eula and ops
       
    20   become: yes
       
    21   copy:
       
    22     src: "{{item}}"
       
    23     dest: "{{papermc_dir}}/{{item}}"
       
    24     owner: "{{papermc_user}}"
       
    25     group: "{{papermc_user}}"
       
    26   loop:
       
    27     - "eula.txt"
       
    28     - "ops.json"
       
    29   notify: restart papermc
       
    30 
       
    31 - name: set motd
       
    32   become: yes
       
    33   lineinfile:
       
    34     path: "{{papermc_dir}}/server.properties"
       
    35     regexp: "^motd="
       
    36     line: "motd={{papermc_motd}}"
       
    37   notify: restart papermc
       
    38 
       
    39 - name: create world file directory
       
    40   become: yes
       
    41   file:
       
    42     path: "{{papermc_world_dir}}"
       
    43     state: "directory"
       
    44     owner: "{{papermc_user}}"
       
    45     group: "{{papermc_user}}"
       
    46     mode: "0755"
       
    47 
       
    48 - name: set world files
       
    49   become: yes
       
    50   lineinfile:
       
    51     path: "{{papermc_dir}}/bukkit.yml"
       
    52     regexp: "^  world-container:"
       
    53     line: "  world-container: {{papermc_world_dir}}"
       
    54     insertbefore: "^  permissions-file:"
       
    55   notify: restart papermc
       
    56 
       
    57 - name: install systemd service
       
    58   become: yes
       
    59   template:
       
    60     src: "papermc.service.j2"
       
    61     dest: "/lib/systemd/system/papermc.service"
       
    62   notify: restart papermc
       
    63 
       
    64 - name: ensure service is started
       
    65   become: yes
       
    66   systemd: name="papermc.service" enabled="yes" state="started"