diff options
author | 2019-03-19 08:45:54 +0200 | |
---|---|---|
committer | 2019-04-01 15:08:20 +0300 | |
commit | 51d7d013fbff9706910be7cbecd1720967ff486f (patch) | |
tree | 4fb191fc432f4e1e975afb66866a160ce0b447c7 /ansible/roles/application/tasks/transfer-helm-charts.yml | |
parent | dc924a0cb81e1eed9f5bf152bfba076a45fe91e1 (diff) |
Improve application role testability
Remove different phases for application role as
those are supposed to run after each other anyway
from playbook and pre/post steps can be disabled
by other means.
Enable Helm override file generation customization by
delegating it to separate role.
Separate Helm file transfer to own module.
NOTE: install.yml with all Helm commands (shell/command)
is not idempotent and should be fixed with separate
commit.
Issue-ID: OOM-1655
Change-Id: Ib29773c4d64a0529c71c3f93c2af7265ae94059f
Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
Diffstat (limited to 'ansible/roles/application/tasks/transfer-helm-charts.yml')
-rw-r--r-- | ansible/roles/application/tasks/transfer-helm-charts.yml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ansible/roles/application/tasks/transfer-helm-charts.yml b/ansible/roles/application/tasks/transfer-helm-charts.yml new file mode 100644 index 00000000..0cd7c02f --- /dev/null +++ b/ansible/roles/application/tasks/transfer-helm-charts.yml @@ -0,0 +1,44 @@ +--- +# before custom specific code is executed we need to move helm charts to infra +- name: Distribute helm charts to infra node + block: + - name: Archive helm charts + archive: + path: "{{ app_helm_charts_install_directory }}/*" + dest: "{{ app_helm_charts_install_directory }}.tgz" + delegate_to: localhost + - name: Create helm charts dir on infra + file: + path: "{{ app_helm_charts_infra_directory }}" + state: directory + mode: 0755 + - name: Unarchive helm charts on infra node + unarchive: + src: "{{ app_helm_charts_install_directory }}.tgz" + dest: "{{ app_helm_charts_infra_directory }}" + + +- name: Install helm plugins if needed + block: + - name: Get helm dir + command: "{{ helm_bin_dir }}/helm home" + register: helm_home_dir + - name: Ensure that dir for helm plugins exists + file: + path: "{{ helm_home_dir.stdout }}/plugins" + state: directory + mode: 0755 + - name: Register all plugins to be inserted by dir names + find: + paths: "{{ app_helm_plugins_directory }}" + file_type: "directory" + register: list_of_plugins + delegate_to: localhost + - name: Install all helm plugins from {{ app_helm_plugins_directory }} dir + copy: + src: "{{ item.path }}" + dest: "{{ helm_home_dir.stdout }}/plugins" + directory_mode: true + mode: 0755 + with_items: "{{ list_of_plugins.files }}" + when: app_helm_plugins_directory is defined and app_helm_plugins_directory is not none |