install.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. - libssl-dev
  36. - portaudio19-dev
  37. - build-essential
  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