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