Browse Source

Fix warning of mkdir usage (#6951)

This fixes the following warning:

  [kubernetes/client : Generate admin kubeconfig with external api endpoint]
  [WARNING]: Consider using the file module with state=directory rather than
  running 'mkdir'.  If you need to use command because file is insufficient
  you can
pull/7009/head
Kenichi Omichi 4 years ago
committed by GitHub
parent
commit
33a60fe919
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions
  1. 8
      roles/kubernetes/client/tasks/main.yml

8
roles/kubernetes/client/tasks/main.yml

@ -47,10 +47,16 @@
port: "{{ kube_apiserver_port }}"
timeout: 180
- name: Create external_kubeconfig dir
file:
path: "{{ kube_config_dir }}/external_kubeconfig"
mode: "0750"
state: directory
when: kubeconfig_localhost
# NOTE(mattymo): Please forgive this workaround
- name: Generate admin kubeconfig with external api endpoint # noqa 302
shell: >-
mkdir -p {{ kube_config_dir }}/external_kubeconfig &&
{{ bin_dir }}/kubeadm
init phase
kubeconfig admin

Loading…
Cancel
Save