X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcaas-kubedns.git;a=blobdiff_plain;f=ansible%2Froles%2Fkubedns%2Ftasks%2Fmain.yml;fp=ansible%2Froles%2Fkubedns%2Ftasks%2Fmain.yml;h=e258efed19d3a3a8cc08ee2194e316afff70b47b;hp=0000000000000000000000000000000000000000;hb=251c73c758e867507450126a19c703e4ab9052b0;hpb=494345f1c3d15b70d903a87f0752a0d8ce3be994 diff --git a/ansible/roles/kubedns/tasks/main.yml b/ansible/roles/kubedns/tasks/main.yml new file mode 100644 index 0000000..e258efe --- /dev/null +++ b/ansible/roles/kubedns/tasks/main.yml @@ -0,0 +1,57 @@ +--- +# Copyright 2019 Nokia +# +# 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. + +- name: template external dns configmap + template: + src: kubedns-external-dns-cm.yml + dest: /etc/kubernetes/kubeconfig/kubedns-external-dns-cm.yml + become_user: "root" + +- name: template manifest + template: + src: kubedns-deployment.yml + dest: "{{ caas.manifests_directory }}/kubedns-deployment.yml" + become_user: "root" + +- name: template manifest + template: + src: kubedns-service.yml + dest: "{{ caas.manifests_directory }}/kubedns-service.yml" + become_user: "root" + +- name: Load the external dns configmap + kubectl: + manifest: "/etc/kubernetes/kubeconfig/kubedns-external-dns-cm.yml" + state: present + when: ( nodename | search("caas_master1") ) + +- name: Load the kubedns deployment + kubectl: + manifest: "{{ caas.manifests_directory }}/kubedns-deployment.yml" + state: present + when: ( nodename | search("caas_master1") ) + +- name: Load the kubedns service + kubectl: + manifest: "{{ caas.manifests_directory }}/kubedns-service.yml" + state: present + when: ( nodename | search("caas_master1") ) + +- name: wait for container to start + shell: "kubectl get po --all-namespaces | grep kube-dns" + register: result + until: result.stdout.find("2/2") != -1 + retries: 120 + delay: 1