rpi_kalliope_install.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Use this playbook with ansible to install kalliope on a remote Rpi
  2. # After a fresh install of a Rpi, you only need to active ssh
  3. # sudo systemctl enable ssh
  4. # sudo systemctl start ssh
  5. # the target pi must be declared in your inventory (e.g: /etc/ansible/hosts)
  6. # e.g: kalliope_rpi ansible_host=192.0.2.50
  7. # usage:
  8. # ansible-playbook -vK rpi_kalliope_install.yml
  9. # with version
  10. # ansible-playbook -vK rpi_kalliope_install.yml -e "kalliope_branch_to_install=dev"
  11. # connect to the pi and flush history
  12. # cat /dev/null > /home/pi/.bash_history && history -c && exit
  13. - name: Install Kalliope on Rpi
  14. hosts: "{{ targets | default('rpi') }}"
  15. remote_user: pi
  16. become: True
  17. vars:
  18. kalliope_branch_to_install: "master"
  19. starter_kits:
  20. - name: "kalliope_starter_cs"
  21. repo: "https://github.com/kalliope-project/kalliope_starter_cs.git"
  22. - name: "kalliope_starter_fr"
  23. repo: "https://github.com/kalliope-project/kalliope_starter_fr.git"
  24. - name: "kalliope_starter_de"
  25. repo: "https://github.com/kalliope-project/kalliope_starter_de.git"
  26. - name: "kalliope_starter_en"
  27. repo: "https://github.com/kalliope-project/kalliope_starter_en.git"
  28. - name: "kalliope_starter_it"
  29. repo: "https://github.com/kalliope-project/kalliope_starter_it.git"
  30. tasks:
  31. - name: Set hostname
  32. hostname:
  33. name: "kalliope"
  34. - name: Install required packages
  35. apt:
  36. name: "{{item}}"
  37. state: present
  38. with_items:
  39. - git
  40. - python-dev
  41. - libsmpeg0
  42. - libttspico-utils
  43. - libsmpeg0
  44. - flac
  45. - dialog
  46. - libffi-dev
  47. - libssl-dev
  48. - portaudio19-dev
  49. - build-essential
  50. - sox
  51. - libatlas3-base
  52. - mplayer
  53. - libyaml-dev
  54. - libpython2.7-dev
  55. - libav-tools
  56. - libportaudio0
  57. - libportaudio2
  58. - libportaudiocpp0
  59. - portaudio19-dev
  60. - python-yaml
  61. - python-pycparser
  62. - python-paramiko
  63. - python-markupsafe
  64. - apt-transport-https
  65. - name: Clone the project
  66. git:
  67. repo: "https://github.com/kalliope-project/kalliope.git"
  68. dest: "/home/pi/kalliope"
  69. version: "{{ kalliope_branch_to_install }}"
  70. accept_hostkey: yes
  71. - name: Install Kalliope
  72. shell: python setup.py install
  73. args:
  74. chdir: /home/pi/kalliope
  75. - name: Clone starter kits
  76. git:
  77. repo: "{{ item.repo }}"
  78. dest: "/home/pi/{{ item.name }}"
  79. version: "master"
  80. accept_hostkey: yes
  81. with_items: "{{ starter_kits }}"