From 91a84330494b100ac9077652c910fb248f737717 Mon Sep 17 00:00:00 2001 From: leonwang Date: Tue, 7 Aug 2018 14:49:27 +0800 Subject: Update the latest version of ansible script This patch is proposed for merging the latest version of ansible code according to opensds-installer project. From the latest version code, we change the default installation way from source code to release, which means there is no need for golang environment prepare and long-time building work. Change-Id: I93d7d24f29e61979bc8fda7125ae753063eda423 Signed-off-by: leonwang --- ci/ansible/roles/nbp-installer/scenarios/csi.yml | 4 +-- .../roles/nbp-installer/scenarios/flexvolume.yml | 33 +++++++++++++++++++++- .../roles/nbp-installer/scenarios/release.yml | 8 ++++-- .../roles/nbp-installer/scenarios/repository.yml | 2 +- 4 files changed, 40 insertions(+), 7 deletions(-) (limited to 'ci/ansible/roles/nbp-installer') diff --git a/ci/ansible/roles/nbp-installer/scenarios/csi.yml b/ci/ansible/roles/nbp-installer/scenarios/csi.yml index 93fff88..ef86967 100644 --- a/ci/ansible/roles/nbp-installer/scenarios/csi.yml +++ b/ci/ansible/roles/nbp-installer/scenarios/csi.yml @@ -19,14 +19,14 @@ regexp: '^ opensdsendpoint' line: ' opensdsendpoint: {{ opensds_endpoint }}' backup: yes - + - name: Configure opensds auth strategy in opensds csi plugin lineinfile: dest: "{{ nbp_work_dir }}/csi/deploy/kubernetes/csi-configmap-opensdsplugin.yaml" regexp: '^ opensdsauthstrategy' line: ' opensdsauthstrategy: {{ opensds_auth_strategy }}' backup: yes - + - name: Configure keystone os auth url in opensds csi plugin lineinfile: dest: "{{ nbp_work_dir }}/csi/deploy/kubernetes/csi-configmap-opensdsplugin.yaml" diff --git a/ci/ansible/roles/nbp-installer/scenarios/flexvolume.yml b/ci/ansible/roles/nbp-installer/scenarios/flexvolume.yml index 52ec16d..2117411 100644 --- a/ci/ansible/roles/nbp-installer/scenarios/flexvolume.yml +++ b/ci/ansible/roles/nbp-installer/scenarios/flexvolume.yml @@ -21,5 +21,36 @@ - name: Copy opensds flexvolume plugin binary file into flexvolume plugin dir copy: - src: "{{ nbp_work_dir }}/flexvolume/opensds" + src: "{{ nbp_work_dir }}/bin/flexvolume.server.opensds" dest: "{{ flexvolume_plugin_dir }}/opensds" + mode: 0755 + +- name: Configure opensds endpoint IP in opensds external provisioner plugin + lineinfile: + dest: "{{ nbp_work_dir }}/provisioner/deploy/configmap.yaml" + regexp: '^ opensdsendpoint' + line: ' opensdsendpoint: {{ opensds_endpoint }}' + backup: yes + +- name: Configure opensds auth strategy in opensds external provisioner plugin + lineinfile: + dest: "{{ nbp_work_dir }}/provisioner/deploy/configmap.yaml" + regexp: '^ opensdsauthstrategy' + line: ' opensdsauthstrategy: {{ opensds_auth_strategy }}' + backup: yes + +- name: Configure keystone os auth url in opensds external provisioner plugin + lineinfile: + dest: "{{ nbp_work_dir }}/provisioner/deploy/configmap.yaml" + regexp: '^ osauthurl' + line: ' osauthurl: {{ keystone_os_auth_url }}' + backup: yes + when: opensds_auth_strategy == "keystone" + +- name: Prepare and deploy opensds external provisioner plugin + shell: | + . /etc/profile + kubectl create -f deploy/ + args: + chdir: "{{ nbp_work_dir }}/provisioner" + ignore_errors: yes diff --git a/ci/ansible/roles/nbp-installer/scenarios/release.yml b/ci/ansible/roles/nbp-installer/scenarios/release.yml index 89429d7..b528724 100644 --- a/ci/ansible/roles/nbp-installer/scenarios/release.yml +++ b/ci/ansible/roles/nbp-installer/scenarios/release.yml @@ -21,14 +21,15 @@ - name: download and extract the nbp release tarball if not exists unarchive: - src={{ nbp_download_url }} - dest=/tmp/ + src: "{{ nbp_download_url }}" + dest: /tmp/ + remote_src: yes when: - nbpreleasesexisted.stat.exists is undefined or nbpreleasesexisted.stat.exists == false - name: change the mode of all binary files in nbp release file: - path: "{{ nbp_tarball_dir }}/flexvolume" + path: "{{ nbp_tarball_dir }}/bin" mode: 0755 recurse: yes @@ -36,3 +37,4 @@ copy: src: "{{ nbp_tarball_dir }}/" dest: "{{ nbp_work_dir }}" + mode: 0755 diff --git a/ci/ansible/roles/nbp-installer/scenarios/repository.yml b/ci/ansible/roles/nbp-installer/scenarios/repository.yml index fb8059b..0c323d2 100644 --- a/ci/ansible/roles/nbp-installer/scenarios/repository.yml +++ b/ci/ansible/roles/nbp-installer/scenarios/repository.yml @@ -15,7 +15,7 @@ --- - set_fact: go_path: "{{ lookup('env', 'GOPATH') }}" - + - name: check go_path shell: "{{ item }}" with_items: -- cgit 1.2.3-korg