Skip to content
Snippets Groups Projects
playbook.yml 1.16 KiB
Newer Older
nimrod's avatar
nimrod committed
---
- hosts: all
  pre_tasks:
nimrod's avatar
nimrod committed
      - name: APT install Python3, Tox, Cron, Unison
nimrod's avatar
nimrod committed
        apt:
            name:
                - python3
                - tox
                - cron-daemon
nimrod's avatar
nimrod committed
                - unison
nimrod's avatar
nimrod committed
            state: present
            update_cache: True
            cache_valid_time: 3600

      - name: Get authorized keys
        become: False
        slurp:
            src: ~/.ssh/authorized_keys
        register: authorized_keys
  roles:
      - name: gitreceive
        gitreceive_public_keys: "{{ (authorized_keys['content']|b64decode).splitlines() }}"
        gitreceive_receiver_script: |
            #!/bin/sh
            set -eu
            echo '----> Unpacking ...'
            mkdir -p ~/poquita
            cd ~/poquita
            tar -xf -
            if [ -f receiver ] && [ -x receiver ]
            then
                echo '----> Running receiver ...'
                ./receiver
            fi
            echo '----> OK.'
  post_tasks:
      - name: Create Podcasts directory
        file:
            path: /srv/library/nimrod/Podcasts
            state: directory
            owner: nimrod
            group: git
            mode: 0o0775