install.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. - libffi-dev
  36. - libssl-dev
  37. - portaudio19-dev
  38. - build-essential
  39. - libssl-dev
  40. - libffi-dev
  41. - sox
  42. - libatlas3-base
  43. - mplayer
  44. - name: Copy requirement
  45. copy:
  46. src: python_requirements.txt
  47. dest: /tmp/requirements.txt
  48. - name: Upgrade pip
  49. pip:
  50. name: pip
  51. state: latest
  52. - name: Install python libs
  53. pip:
  54. requirements=/tmp/requirements.txt
  55. # - name: Check that the repo has been cloned
  56. # stat:
  57. # path: "{{ temp_local_repo }}"
  58. # register: git_repo_stat
  59. #
  60. # - name: Remove old version if exist
  61. # file:
  62. # path: "{{ install_path }}"
  63. # state: absent
  64. #
  65. # - name: Move repo in /usr/lib
  66. # command: mv "{{ temp_local_repo }}" "{{ install_path }}"
  67. # when: git_repo_stat.stat.exists
  68. #
  69. # - name: Add entry in /usr/bin
  70. # file:
  71. # src: "{{ install_path }}/kalliope.py"
  72. # dest: /usr/bin/kalliope
  73. # state: link
  74. # force: True