From b3a0e1b936e096637f6af34341ee1cf334aa01b6 Mon Sep 17 00:00:00 2001 From: lusyoe Date: Sun, 5 Aug 2018 22:52:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96storage,=E6=8A=BD=E5=8F=96tas?= =?UTF-8?q?ks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/cluster-storage/tasks/alicloud-nas.yml | 18 +++++++++++ roles/cluster-storage/tasks/main.yml | 32 ++------------------ roles/cluster-storage/tasks/nfs-client.yml | 10 ++++++ 3 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 roles/cluster-storage/tasks/alicloud-nas.yml create mode 100644 roles/cluster-storage/tasks/nfs-client.yml diff --git a/roles/cluster-storage/tasks/alicloud-nas.yml b/roles/cluster-storage/tasks/alicloud-nas.yml new file mode 100644 index 0000000..c7c0178 --- /dev/null +++ b/roles/cluster-storage/tasks/alicloud-nas.yml @@ -0,0 +1,18 @@ +- name: 准备alicloud-nas配置目录 + file: name={{ base_dir }}/manifests/storage/alicloud-nas state=directory + +- name: 生成alicloud-nas动态存储配置 + template: + src: alicloud-nas/alicloud-nas.yaml.j2 + dest: "{{ base_dir }}/manifests/storage/alicloud-nas/{{ aliyun_nas_controller_name }}.yaml" + +- name: 复制alicloud-disk配置 + copy: + src: alicloud-disk.yaml + dest: "{{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml" + +- name: 开始部署alicloud-disk存储 + shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml" + +- name: 开始部署alicloud-nas动态存储 + shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/{{ aliyun_nas_controller_name }}.yaml" diff --git a/roles/cluster-storage/tasks/main.yml b/roles/cluster-storage/tasks/main.yml index 25da8af..afa8e15 100644 --- a/roles/cluster-storage/tasks/main.yml +++ b/roles/cluster-storage/tasks/main.yml @@ -1,34 +1,6 @@ -- block: - - name: 准备nfs-client 配置目录 - file: name={{ base_dir }}/manifests/storage/nfs state=directory - - - name: 生成nfs-client动态存储配置 - template: - src: nfs/nfs-client-provisioner.yaml.j2 - dest: "{{ base_dir }}/manifests/storage/nfs/{{ nfs_provisioner_name }}.yaml" - - - name: 开始部署nfs-client动态存储 - shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/nfs/{{ nfs_provisioner_name }}.yaml" +- include: nfs-client.yml when: 'storage_nfs_enabled == "yes"' - -- block: - - name: 准备alicloud-nas配置目录 - file: name={{ base_dir }}/manifests/storage/alicloud-nas state=directory - - name: 生成alicloud-nas动态存储配置 - template: - src: alicloud-nas/alicloud-nas.yaml.j2 - dest: "{{ base_dir }}/manifests/storage/alicloud-nas/{{ aliyun_nas_controller_name }}.yaml" - - - name: 复制alicloud-disk配置 - copy: - src: alicloud-disk.yaml - dest: "{{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml" - - - name: 开始部署alicloud-disk存储 - shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml" - - - name: 开始部署alicloud-nas动态存储 - shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/{{ aliyun_nas_controller_name }}.yaml" +- include: alicloud-nas.yml when: 'storage_aliyun_nas_enabled == "yes"' diff --git a/roles/cluster-storage/tasks/nfs-client.yml b/roles/cluster-storage/tasks/nfs-client.yml new file mode 100644 index 0000000..ebc4d6e --- /dev/null +++ b/roles/cluster-storage/tasks/nfs-client.yml @@ -0,0 +1,10 @@ +- name: 准备nfs-client 配置目录 + file: name={{ base_dir }}/manifests/storage/nfs state=directory + +- name: 生成nfs-client动态存储配置 + template: + src: nfs/nfs-client-provisioner.yaml.j2 + dest: "{{ base_dir }}/manifests/storage/nfs/{{ nfs_provisioner_name }}.yaml" + +- name: 开始部署nfs-client动态存储 + shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/nfs/{{ nfs_provisioner_name }}.yaml"