|
@@ -2,36 +2,76 @@
|
|
|
- hosts: localhost
|
|
|
gather_facts: no
|
|
|
connection: local
|
|
|
- become: True
|
|
|
+ vars:
|
|
|
+ - git_url: "git@gitlab.pwit.fr:millionsfortomorrow/jarvis.git"
|
|
|
+ - temp_local_repo: "/tmp/jarvis_repo"
|
|
|
+
|
|
|
+ tasks:
|
|
|
+ - name: clone project in /tmp as standart user
|
|
|
+ git:
|
|
|
+ repo: "{{ git_url }}"
|
|
|
+ dest: /tmp/jarvis_repo
|
|
|
+ accept_hostkey: yes
|
|
|
+
|
|
|
|
|
|
+- hosts: localhost
|
|
|
+ gather_facts: no
|
|
|
+ connection: local
|
|
|
+ become: True
|
|
|
+ vars:
|
|
|
+ - git_url: "git@gitlab.pwit.fr:millionsfortomorrow/jarvis.git"
|
|
|
+ - temp_local_repo: "/tmp/jarvis_repo"
|
|
|
+ - jarvis_install_path: "/usr/lib/jarvis"
|
|
|
tasks:
|
|
|
- - name: Install packages
|
|
|
- apt: name={{ item }} update_cache=yes
|
|
|
- with_items:
|
|
|
- - python-pip
|
|
|
- - python-dev
|
|
|
- - libsmpeg0
|
|
|
- - libttspico-utils
|
|
|
- - libsmpeg0
|
|
|
- - flac
|
|
|
- - dialog
|
|
|
- - libffi-dev
|
|
|
- - portaudio19-dev
|
|
|
- - build-essential
|
|
|
- - libssl-dev
|
|
|
- - libffi-dev
|
|
|
- - sox
|
|
|
-#
|
|
|
- - name: Copy requirement
|
|
|
- copy:
|
|
|
- src: python_requirements.txt
|
|
|
- dest: /tmp/requirements.txt
|
|
|
-
|
|
|
- - name: Upgrade pip
|
|
|
- pip:
|
|
|
- name: pip
|
|
|
- state: latest
|
|
|
-
|
|
|
- - name: Install python libs
|
|
|
- pip:
|
|
|
- requirements=/tmp/requirements.txt
|
|
|
+ - name: Install packages
|
|
|
+ apt: name={{ item }} update_cache=yes
|
|
|
+ with_items:
|
|
|
+ - python-pip
|
|
|
+ - python-dev
|
|
|
+ - libsmpeg0
|
|
|
+ - libttspico-utils
|
|
|
+ - libsmpeg0
|
|
|
+ - flac
|
|
|
+ - dialog
|
|
|
+ - libffi-dev
|
|
|
+ - portaudio19-dev
|
|
|
+ - build-essential
|
|
|
+ - libssl-dev
|
|
|
+ - libffi-dev
|
|
|
+ - sox
|
|
|
+
|
|
|
+ - name: Copy requirement
|
|
|
+ copy:
|
|
|
+ src: python_requirements.txt
|
|
|
+ dest: /tmp/requirements.txt
|
|
|
+
|
|
|
+ - name: Upgrade pip
|
|
|
+ pip:
|
|
|
+ name: pip
|
|
|
+ state: latest
|
|
|
+
|
|
|
+ - name: Install python libs
|
|
|
+ pip:
|
|
|
+ requirements=/tmp/requirements.txt
|
|
|
+
|
|
|
+ - name: Check that the repo has been cloned
|
|
|
+ stat:
|
|
|
+ path: "{{ temp_local_repo }}"
|
|
|
+ register: git_repo_stat
|
|
|
+
|
|
|
+ - name: Remove old version if exist
|
|
|
+ file:
|
|
|
+ path: "{{ jarvis_install_path }}"
|
|
|
+ state: absent
|
|
|
+
|
|
|
+ - name: Move repo in /usr/lib
|
|
|
+ command: mv "{{ temp_local_repo }}" "{{ jarvis_install_path }}"
|
|
|
+ when: git_repo_stat.stat.exists
|
|
|
+
|
|
|
+ - name: Add entry in /usr/bin
|
|
|
+ file:
|
|
|
+ src: "{{ jarvis_install_path }}/jarvis.py"
|
|
|
+ dest: /usr/bin/jarvis
|
|
|
+ state: link
|
|
|
+ force: True
|
|
|
+
|