From 790fbc945c3b4ad6ec67a6bbae1ca37410bfbe15 Mon Sep 17 00:00:00 2001 From: HarrisChu <1726587+HarrisChu@users.noreply.github.com> Date: Sat, 26 Feb 2022 18:07:00 +0800 Subject: [PATCH] support ubuntu tar.gz --- README.md | 2 -- roles/install/tasks/main.yml | 26 ++++++++++++++++++++------ templates/nebula-storaged.conf.j2 | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 95b8cb0..0819873 100644 --- a/README.md +++ b/README.md @@ -87,5 +87,3 @@ ansible-playbook remove.yml ```bash ansible-playbook -i inventory.qa61 install.yml ``` - - diff --git a/roles/install/tasks/main.yml b/roles/install/tasks/main.yml index 6fac8c5..44f133e 100644 --- a/roles/install/tasks/main.yml +++ b/roles/install/tasks/main.yml @@ -4,22 +4,22 @@ state: directory mode: 0775 -- name: verify if the package is exist +- name: verify if the binary is exist stat: path: "{{ deploy_dir }}/bin" - register: stat_package + register: stat_binary -- name: verify if the rpm is exist +- name: verify if the install package is exist stat: path: "{{ deploy_dir }}/{{ nebula_packages.name }}" - register: stat_rpm + register: stat_package - name: copy nebula package from Control Machine to all machines in the cluster copy: src: "{{ packages_dir }}/{{ nebula_packages.name }}" dest: "{{ deploy_dir }}" when: - - not stat_rpm.stat.exists + - not stat_package.stat.exists - name: unzip rpm file @@ -32,8 +32,22 @@ - "mv {{ deploy_dir }}/usr/local/nebula/scripts {{ deploy_dir }}/" when: - - not stat_package.stat.exists + - not stat_binary.stat.exists + - pkg == 'rpm' + +- name: unzip tgz file + shell: "{{ item }}" + with_items: + - "cd {{ deploy_dir }} && tar zxvf {{ nebula_packages.name }}" + - "mv {{ deploy_dir }}/nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}/bin {{ deploy_dir }}/" + - "mv {{ deploy_dir }}/nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}/etc {{ deploy_dir }}/" + - "mv {{ deploy_dir }}/nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}/share {{ deploy_dir }}/" + - "mv {{ deploy_dir }}/nebula-graph-{{ nebula_version }}.{{ os_version }}.{{ arc }}/scripts {{ deploy_dir }}/" + when: + - not stat_binary.stat.exists + - pkg == 'tar.gz' + - name: config {{ module }}.conf template: src: "{{ playbook_dir}}/templates/{{ module }}.conf.j2" diff --git a/templates/nebula-storaged.conf.j2 b/templates/nebula-storaged.conf.j2 index 6c5688b..c4e32ff 100644 --- a/templates/nebula-storaged.conf.j2 +++ b/templates/nebula-storaged.conf.j2 @@ -51,7 +51,7 @@ ########## Disk ########## # Root data path. Split by comma. e.g. --data_path=/disk1/path1/,/disk2/path2/ # One path per Rocksdb instance. ---data_path=data/storage +--data_path={{ data_dir }} # The default reserved bytes for one batch operation --rocksdb_batch_size=4096