Fetch kubernetes admin.conf for test 03/50203/3
authorwutianwei <wutianwei1@huawei.com>
Mon, 8 Jan 2018 08:34:30 +0000 (16:34 +0800)
committerwutianwei <wutianwei1@huawei.com>
Thu, 11 Jan 2018 10:45:04 +0000 (10:45 +0000)
from kube_master fetch the admin.conf
to the directory /opt/admin.conf of compass-tasks docker

Change-Id: I1c236414c968f721d04fb6da0dc7a9514c892f93
Signed-off-by: wutianwei <wutianwei1@huawei.com>
deploy/adapters/ansible/kubernetes/ansible-kubernetes.yml [changed mode: 0644->0755]
deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml [new file with mode: 0644]

old mode 100644 (file)
new mode 100755 (executable)
index 9f20cdb..eb80066
@@ -30,3 +30,9 @@
   max_fail_percentage: 0
   roles:
     - kargo
+
+- hosts: kube_master
+  remote_user: root
+  max_fail_percentage: 0
+  roles:
+    - post-k8s
diff --git a/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/post-k8s/tasks/main.yml
new file mode 100644 (file)
index 0000000..3feca3e
--- /dev/null
@@ -0,0 +1,16 @@
+##############################################################################
+# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+
+- name: fetch admin.conf
+  fetch:
+    src: /etc/kubernetes/admin.conf
+    dest: /opt/admin.conf
+    flat: "yes"
+  when: inventory_hostname == groups['kube_master'][0]