rpi_kalliope_install.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. - pulseaudio
  56. - pulseaudio-utils
  57. - libav-tools
  58. - libportaudio0
  59. - libportaudio2
  60. - libportaudiocpp0
  61. - portaudio19-dev
  62. - python-yaml
  63. - python-pycparser
  64. - python-paramiko
  65. - python-markupsafe
  66. - apt-transport-https
  67. - name: Clone the project
  68. git:
  69. repo: "https://github.com/kalliope-project/kalliope.git"
  70. dest: "/home/pi/kalliope"
  71. version: "{{ kalliope_branch_to_install }}"
  72. accept_hostkey: yes
  73. - name: Install Kalliope
  74. shell: python setup.py install
  75. args:
  76. chdir: /home/pi/kalliope
  77. - name: Clone starter kits
  78. git:
  79. repo: "{{ item.repo }}"
  80. dest: "/home/pi/{{ item.name }}"
  81. version: "master"
  82. accept_hostkey: yes
  83. with_items: "{{ starter_kits }}"