Commit 80e01cdd by tingweiwang

Update main.yml

1 parent 67a5a70f
- name: 在tmp目录创建渲染目标目录 - name: 在tmp目录创建渲染目标目录
file: path=/tmp/configmap-kpl/{{ item }} state=directory file: path=/tmp/configmap-kpl/{{ item }} state=directory
with_items: with_items:
- autodl-core - autodl-core
- autodl
- kpl - kpl
- name: 渲染分发autodl-core的configmap配置文件 - name: 渲染分发autodl-core的configmap配置文件
...@@ -11,10 +9,6 @@ ...@@ -11,10 +9,6 @@
with_fileglob: with_fileglob:
- "{{ TMP_RESOURCE }}/configmap-kpl/autodl-core/*.j2" - "{{ TMP_RESOURCE }}/configmap-kpl/autodl-core/*.j2"
- name: 渲染分发autodl的configmap配置文件
template: src={{ item }} dest=/tmp/configmap-kpl/autodl/{{ item | basename | regex_replace('.j2','') }}
with_fileglob:
- "{{ TMP_RESOURCE }}/configmap-kpl/autodl/*.j2"
- name: 渲染分发kpl的configmap配置文件 - name: 渲染分发kpl的configmap配置文件
template: src={{ item }} dest=/tmp/configmap-kpl/kpl/{{ item | basename | regex_replace('.j2','') }} template: src={{ item }} dest=/tmp/configmap-kpl/kpl/{{ item | basename | regex_replace('.j2','') }}
...@@ -23,6 +17,13 @@ ...@@ -23,6 +17,13 @@
- name: 执行kubectl apply创建configmap配置文件 - name: 执行kubectl apply创建configmap配置文件
shell: kubectl apply -f {{ item }} shell: kubectl apply -f {{ item }}
register: configmap_result
with_items: with_items:
- /tmp/configmap-kpl/autodl-core - /tmp/configmap-kpl/autodl-core
- /tmp/configmap-kpl/kpl - /tmp/configmap-kpl/kpl
- name: 显示apply configmap后输出信息
debug: msg={{ item.stdout_lines }}
with_items:
- "{{ configmap_result.results }}"
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!