X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=ansible%2Froles%2Fhelm%2Ftasks%2Fmain.yml;fp=ansible%2Froles%2Fhelm%2Ftasks%2Fmain.yml;h=17d4117fc875929f7efa2acdae2fc0616c116db9;hb=cf9e279cdad75e3bacaa71fb0323f1284288b73a;hp=0000000000000000000000000000000000000000;hpb=fd08a43597cef9022d3c935dffcd81afceb04267;p=ta%2Fcaas-helm.git diff --git a/ansible/roles/helm/tasks/main.yml b/ansible/roles/helm/tasks/main.yml new file mode 100644 index 0000000..17d4117 --- /dev/null +++ b/ansible/roles/helm/tasks/main.yml @@ -0,0 +1,60 @@ +--- +# 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: Add tiller manifest template manifest + template: + src: tiller.yml + dest: "{{ caas.manifests_directory }}/tiller.yml" + +- name: Add tiller service + template: + src: tiller-service.yml + dest: "{{ caas.manifests_directory }}/tiller-service.yml" + +- name: create deployment api object + kubectl: + manifest: "{{ caas.manifests_directory }}/tiller.yml" + state: present + when: nodename | search("caas_master1") + +- name: create tiller service + kubectl: + manifest: "{{ caas.manifests_directory }}/tiller-service.yml" + state: present + when: nodename | search("caas_master1") + +- name: make env vars permanent + lineinfile: + dest: /etc/profile + state: present + line: "{{ item }}" + regexp: "{{ item }}" + with_items: + - "export HELM_HOST={{ caas.tiller_ip }}:{{ caas.tiller_port }}" + - "export HELM_HOME={{ caas.helm_home }}" + become_user: "root" + +- name: make env vars permanent + lineinfile: + dest: /etc/environment + state: present + line: "{{ item }}" + regexp: "{{ item }}" + with_items: + - "HELM_HOST={{ caas.tiller_ip }}:{{ caas.tiller_port }}" + - "HELM_HOME={{ caas.helm_home }}" + become_user: "root" + +- import_tasks: config.yml