--- # Needed for stretch as we need golang >= 1.11 (for modules), and stretch # only has 1.8 available - name: Install debian backports lineinfile: path: /etc/apt/sources.list.d/backports.list line: deb http://deb.debian.org/debian stretch-backports main create: yes # This shouldn't be needed due to update_cache line in the below install rule, # however that doesn't seem to trigger for some reason - name: Update apt apt: update_cache: yes - name: Install golang apt: name: golang-go state: present default_release: stretch-backports update_cache: yes - name: Get go repo git: dest: /home/{{ ansible_user }}/src/bookpipeline repo: https://git.rescribe.xyz/bookpipeline force: yes become: no - name: Get and build bookpipeline and dependencies command: cmd: go install ./... chdir: /home/{{ ansible_user }}/src/bookpipeline become: no - name: Install bookpipeline binary copy: remote_src: true src: /home/{{ ansible_user }}/go/bin/bookpipeline dest: /usr/local/bin/ owner: root group: root mode: 0755 - name: Install updatepipeline script template: src: updatepipeline.j2 dest: /usr/local/bin/updatepipeline owner: root group: root mode: 0755 - name: Create settings directory file: path: /home/admin/.config/bookpipeline state: directory owner: admin group: admin mode: 0755 - name: Install mail settings copy: src: mailsettings dest: /home/admin/.config/bookpipeline/mailsettings owner: admin group: admin mode: 0600 - name: Install systemd unit file copy: src=bookpipeline.service dest=/etc/systemd/system notify: reload daemons - name: Enable service service: name=bookpipeline enabled=true