summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorSimon Hrabos <s.hrabos@partner.samsung.com>2018-12-19 14:11:27 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-19 14:11:27 +0000
commite928b555085a44efe23c54e7cd43db303f6016fc (patch)
treea6d34e159924e24b71b3c35f45dd2ff8fe1ff75d /ansible
parentbc15ad522630c703be0e7e1368205e5ea88d9b69 (diff)
parent5ea00a9db0e47f97f938d4ed649feaff2ebda017 (diff)
Merge "Add application-install role"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/application-install/defaults/main.yml1
-rw-r--r--ansible/roles/application-install/tasks/install.yml34
-rw-r--r--ansible/roles/application-install/tasks/main.yml5
3 files changed, 40 insertions, 0 deletions
diff --git a/ansible/roles/application-install/defaults/main.yml b/ansible/roles/application-install/defaults/main.yml
new file mode 100644
index 00000000..473fbb80
--- /dev/null
+++ b/ansible/roles/application-install/defaults/main.yml
@@ -0,0 +1 @@
+phase: install
diff --git a/ansible/roles/application-install/tasks/install.yml b/ansible/roles/application-install/tasks/install.yml
new file mode 100644
index 00000000..54b64439
--- /dev/null
+++ b/ansible/roles/application-install/tasks/install.yml
@@ -0,0 +1,34 @@
+---
+- name: Helm init and upgrade
+ command: |
+ {{ helm_bin_dir }}/helm init
+ --upgrade
+ --skip-refresh
+
+- name: Wait for helm
+ wait_for: timeout=10
+ delegate_to: localhost
+
+- name: Get all helm repos
+ command: "{{ helm_bin_dir }}/helm repo list"
+ register: repos
+
+- name: Remove stable repo
+ command: "{{ helm_bin_dir }}/helm repo remove stable"
+ when: "'stable' in repos.stdout"
+
+- name: Helm Serve
+ shell: "{{ helm_bin_dir }}/helm serve &"
+ async: 45
+ poll: 0
+
+- name: Helm Add Repo
+ command: "{{ helm_bin_dir }}/helm repo add {{ helm_repository_name }} {{ helm_repository_url }}"
+
+- name: Helm Make All
+ make:
+ chdir: "{{ app_helm_charts_directory }}"
+ target: all
+
+- name: Helm Install application {{ app_name }}
+ command: "helm install {{ helm_repository_name }}/{{ app_helm_chart_name }} --name {{ app_helm_release_name }} --namespace {{ app_kubernetes_namespace }}"
diff --git a/ansible/roles/application-install/tasks/main.yml b/ansible/roles/application-install/tasks/main.yml
new file mode 100644
index 00000000..3306d9e4
--- /dev/null
+++ b/ansible/roles/application-install/tasks/main.yml
@@ -0,0 +1,5 @@
+---
+- debug:
+ msg: "phase is {{ phase }}"
+
+- include_tasks: "{{ phase }}.yml"