install.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ---
  2. - hosts: localhost
  3. gather_facts: no
  4. connection: local
  5. vars:
  6. - git_url: "git@github.com:kalliope-project/kalliope.git"
  7. - temp_local_repo: "/tmp/kalliope_repo"
  8. tasks:
  9. - name: clone project in /tmp as standart user
  10. git:
  11. repo: "{{ git_url }}"
  12. dest: /tmp/kalliope_repo
  13. accept_hostkey: yes
  14. - hosts: localhost
  15. gather_facts: no
  16. connection: local
  17. become: True
  18. vars:
  19. - git_url: "git@github.com:kalliope-project/kalliope.git"
  20. - temp_local_repo: "/tmp/kalliope_repo"
  21. - install_path: "/usr/lib/kalliope"
  22. tasks:
  23. - name: Install packages
  24. apt: name={{ item }} update_cache=yes
  25. with_items:
  26. - python-pip
  27. - python-dev
  28. - libsmpeg0
  29. - libttspico-utils
  30. - libsmpeg0
  31. - flac
  32. - dialog
  33. - libffi-dev
  34. - portaudio19-dev
  35. - build-essential
  36. - libssl-dev
  37. - libffi-dev
  38. - sox
  39. - libatlas3-base
  40. - mplayer
  41. - name: Copy requirement
  42. copy:
  43. src: python_requirements.txt
  44. dest: /tmp/requirements.txt
  45. - name: Upgrade pip
  46. pip:
  47. name: pip
  48. state: latest
  49. - name: Install python libs
  50. pip:
  51. requirements=/tmp/requirements.txt
  52. - name: Check that the repo has been cloned
  53. stat:
  54. path: "{{ temp_local_repo }}"
  55. register: git_repo_stat
  56. - name: Remove old version if exist
  57. file:
  58. path: "{{ install_path }}"
  59. state: absent
  60. - name: Move repo in /usr/lib
  61. command: mv "{{ temp_local_repo }}" "{{ install_path }}"
  62. when: git_repo_stat.stat.exists
  63. - name: Add entry in /usr/bin
  64. file:
  65. src: "{{ install_path }}/kalliope.py"
  66. dest: /usr/bin/kalliope
  67. state: link
  68. force: True