# Instance-specific configuration for paste.baserock.org --- - hosts: webserver vars: - haste_server_url: https://github.com/palvarez89/haste-server - haste_server_branch: baserock - haste_server_install_location: /home/hastebin/haste-server - haste_server_service_name: haste-server tasks: - name: Install Git apt: name: git state: latest become: yes - name: Install Redis apt: name: redis state: latest become: yes - name: Start Redis service service: name: redis enabled: yes state: started become: yes - name: Install Node.js apt: pkg: - nodejs - npm state: latest become: yes - name: hastebin user user: name=hastebin become: yes become_user: root - name: Download hastebin sources git: repo: "{{ haste_server_url }}" version: "{{ haste_server_branch }}" dest: "{{ haste_server_install_location }}" become: yes become_user: hastebin - name: Update packages based on package.json to their latest version. npm: path: "{{ haste_server_install_location }}" state: latest become: yes become_user: hastebin - name: Install service for the haste server template: src: hastebin/haste-server.service.in dest: /etc/systemd/system/{{ haste_server_service_name }}.service become: yes - name: Restart haste service service: name: "{{ haste_server_service_name }}" enabled: yes state: restarted daemon_reload: yes become: yes