--- - name: create bitcoind group group: name: bitcoind state: present - name: create bitcoind user user: name: bitcoind group: bitcoind state: present shell: /bin/bash home: /home/bitcoind - name: ensure bitcoind config directory exists file: path: /home/bitcoind/.bitcoin state: directory owner: bitcoind group: bitcoind mode: '0750' - name: ensure bitcoind mount exists mount: path: /home/bitcoind/.bitcoin src: '{{ bitcoind_disk }}' fstype: ext4 opts: defaults state: present when: bitcoind_disk is defined - name: install bitcoind apt: name: bitcoind state: present - name: ensure bitcoind service file exists copy: src: files/bitcoind.service dest: /etc/systemd/system/bitcoind.service mode: 0755 owner: root group: root notify: reload systemd - name: flush handlers for systemd reloading meta: flush_handlers - name: ensure bitcoind is enabled and started systemd: name: bitcoind state: started enabled: True ...