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. #
  57. # - name: Remove old version if exist
  58. # file:
  59. # path: "{{ install_path }}"
  60. # state: absent
  61. #
  62. # - name: Move repo in /usr/lib
  63. # command: mv "{{ temp_local_repo }}" "{{ install_path }}"
  64. # when: git_repo_stat.stat.exists
  65. #
  66. # - name: Add entry in /usr/bin
  67. # file:
  68. # src: "{{ install_path }}/kalliope.py"
  69. # dest: /usr/bin/kalliope
  70. # state: link
  71. # force: True