39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			YAML
		
	
	
	
---
 | 
						|
- name: Packages
 | 
						|
  apt:
 | 
						|
    name: 
 | 
						|
      - python3
 | 
						|
      - python3-pip
 | 
						|
      - python3-vlc # also in venv - but this installs vlc + deps
 | 
						|
      - samba
 | 
						|
- name: Checkout Musicmouse repo
 | 
						|
  ansible.builtin.git:
 | 
						|
    repo: 'ssh://git@git.bauer.tech:2222/martin/musicmouse.git'
 | 
						|
    dest: '/opt/musicmouse'
 | 
						|
    version: 'release/1.1'
 | 
						|
    accept_hostkey: true
 | 
						|
- name: Create and update virtual env
 | 
						|
  ansible.builtin.pip:
 | 
						|
    requirements: /opt/musicmouse/espmusicmouse/host_driver/requirements.txt
 | 
						|
    virtualenv: /opt/musicmouse_venv
 | 
						|
    virtualenv_command: "/usr/bin/python3 -m venv"
 | 
						|
- name: Create media directory
 | 
						|
  file:
 | 
						|
    path: /media/musicmouse
 | 
						|
    state: directory
 | 
						|
- name: Install config file
 | 
						|
  copy: src=config.yml dest=/media/musicmouse/config.yml
 | 
						|
- name: Install systemd service file
 | 
						|
  copy: src=musicmouse.service dest=/etc/systemd/system/
 | 
						|
- name: Add script to autostart and start now
 | 
						|
  systemd: name=musicmouse state=restarted enabled=yes daemon_reload=yes
 | 
						|
- name: Samba setup
 | 
						|
  copy: src=smb.conf dest=/etc/samba/
 | 
						|
- name: Restart samba
 | 
						|
  systemd: name=smbd state=restarted enabled=yes 
 | 
						|
# manual steps: 
 | 
						|
#    - set samba passwords with smbpasswd
 | 
						|
#    - copy music into /media/musicmouse (or via samba share)
 | 
						|
#    - upload host driver?
 | 
						|
#    - manual patching of hassclient necessary :( loop has to be passed in, to not use running_event_loop
 |