Added Roles for Kubeconfig file transfers. 92/3492/2
authorabhijit_onap <abhijit.das.gupta@huawei.com>
Wed, 20 May 2020 07:30:49 +0000 (13:00 +0530)
committerGaurav Agrawal <gaurav.agrawal@huawei.com>
Wed, 20 May 2020 07:41:20 +0000 (07:41 +0000)
Three roles added
1. kubeconfig
2. mepkubeconfig
3. mepconfig

Signed-off-by: abhijit_onap <abhijit.das.gupta@huawei.com>
Change-Id: Iadf6114cc1175bfd1b868db0279d18a4d83c7b52

ocd/infra/playbooks/roles/kubeconfig/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/kubeconfig/tasks/main.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/mepconfig/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/mepconfig/tasks/main.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/mepkubeconfig/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/mepkubeconfig/tasks/main.yml [new file with mode: 0644]

diff --git a/ocd/infra/playbooks/roles/kubeconfig/tasks/install.yml b/ocd/infra/playbooks/roles/kubeconfig/tasks/install.yml
new file mode 100644 (file)
index 0000000..149a776
--- /dev/null
@@ -0,0 +1,33 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+# tasks file for k8s
+- name: debug msg
+  debug:
+    msg: transfering config file to OCD Host
+
+- name: Fetch the file from the controller and edge nodes to ocd-host
+  run_once: yes
+  fetch:
+    src: /root/.kube/config
+    dest: /root/.kube/config-{{ ansible_host }}
+    flat: yes
+
+- name: Fetch the file from the edge nodes to ocd-host
+  run_once: yes
+  fetch:
+    src: /root/.kube/config
+    dest: /root/.kube/kubeconfig/{{ ansible_host }}
+    flat: yes
diff --git a/ocd/infra/playbooks/roles/kubeconfig/tasks/main.yml b/ocd/infra/playbooks/roles/kubeconfig/tasks/main.yml
new file mode 100644 (file)
index 0000000..a3fc9af
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+# tasks file for kubeconfig transfer
+- include: "install.yml"
+  when: operation == 'install'
+
+#- include: "uninstall.yml"
+  #when: operation == 'uninstall'
diff --git a/ocd/infra/playbooks/roles/mepconfig/tasks/install.yml b/ocd/infra/playbooks/roles/mepconfig/tasks/install.yml
new file mode 100644 (file)
index 0000000..7055f9d
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+# tasks file for k8s
+- name: debug msg
+  debug:
+    msg: transfering MEP kubeconfig files to MECM Server
+
+- name: Transfer kubeconfig files from all MEP Nodes to MEP Server
+  run_once: yes
+  copy:
+    src: /root/.kube/kubeconfig
+    dest: /
diff --git a/ocd/infra/playbooks/roles/mepconfig/tasks/main.yml b/ocd/infra/playbooks/roles/mepconfig/tasks/main.yml
new file mode 100644 (file)
index 0000000..a3fc9af
--- /dev/null
@@ -0,0 +1,21 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+# tasks file for kubeconfig transfer
+- include: "install.yml"
+  when: operation == 'install'
+
+#- include: "uninstall.yml"
+  #when: operation == 'uninstall'
diff --git a/ocd/infra/playbooks/roles/mepkubeconfig/tasks/install.yml b/ocd/infra/playbooks/roles/mepkubeconfig/tasks/install.yml
new file mode 100644 (file)
index 0000000..334a9e4
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+# tasks file for k8s
+- name: debug msg
+  debug:
+    msg: transfering mep config file to OCD Host
+
+- name: Fetch the file from the mep edge nodes to ocd-host
+  run_once: yes
+  fetch:
+    src: /root/.kube/config
+    dest: /root/.kube/kubeconfig/{{ ansible_host }}
+    flat: yes
diff --git a/ocd/infra/playbooks/roles/mepkubeconfig/tasks/main.yml b/ocd/infra/playbooks/roles/mepkubeconfig/tasks/main.yml
new file mode 100644 (file)
index 0000000..1f281b4
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+# tasks file for kubeconfig transfer
+- include: "install.yml"
+  when: operation == 'install'