4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 - name: Create directory for kube token
18 path: "{{ caas.cert_path }}"
24 path: "{{ caas.cert_path }}/{{ caas.token_filename }}"
26 when: not nodename | search("caas_master")
28 - name: adding acl read to write cert_path
30 name: "{{ caas.cert_path }}"
31 entity: "{{ users.admin_user_name }}"
36 - name: Send kube token
38 src: "{{ caas.cert_path }}/{{ caas.token_filename }}"
39 dest: "{{ caas.cert_path }}/{{ caas.token_filename }}"
43 when: not nodename | search("caas_master") and not token_file.stat.exists
47 path: "{{ caas.cert_path }}/{{ caas.tokenscsv_filename }}"
48 register: tokencsv_file
49 when: nodename | search("caas_master") and not nodename | search("caas_master1")
51 - name: Get kube tokens.csv
53 src: "{{ caas.cert_path }}/{{ caas.tokenscsv_filename }}"
54 dest: "{{ caas.cert_path }}/{{ caas.tokenscsv_filename }}"
58 when: nodename | search("caas_master") and not nodename | search("caas_master1") and not tokencsv_file.stat.exists
60 - name: remove acl read to write cert_path
62 name: "{{ caas.cert_path }}"
63 entity: "{{ users.admin_user_name }}"