blob: fb81f2000b268f1d057eb5867f9a1b1faca49663 [file] [log] [blame]
Michal Ptacek84617e82019-05-24 12:05:04 +00001---
2# This role contains patching logic for OOM charts
3# and is valid until OOM-1610 is implemented
4- name: Check presence of files for NPM patching
5 stat:
6 path: "{{ app_helm_charts_infra_directory }}/{{ item }}"
7 with_items:
8 - common/dgbuilder/templates/deployment.yaml
9 register: npm_files_check
10
Michal Ptacekfff4f532019-05-28 13:59:07 +000011- name: Check presence of files for nexus domain resolving
12 stat:
13 path: "{{ app_helm_charts_infra_directory }}/{{ item }}"
14 with_items:
15 - oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh
16 register: hosts_files_check
17
Michal Ptacek84617e82019-05-24 12:05:04 +000018- name: Patch OOM - set npm registry
19 lineinfile:
20 path: "{{ item.stat.path }}"
21 regexp: '^(.*)NPM_REGISTRY_RECORD'
22 line: '\g<1>npm set registry "http://nexus.{{ ansible_nodename }}/repository/npm-private/";'
23 backrefs: yes
24 state: present
25 with_items: "{{ npm_files_check.results }}"
26 when: item.stat.exists
27
Michal Ptacekfff4f532019-05-28 13:59:07 +000028- name: Patch OOM - nexus domain resolving
29 lineinfile:
30 path: "{{ item.stat.path }}"
31 regexp: '^(.*)HOSTS_FILE_RECORD'
32 line: '\g<1>{{ cluster_ip }} {{ simulated_hosts.nexus | join(" ") }} >> /etc/hosts;'
33 backrefs: yes
34 state: present
35 with_items: "{{ hosts_files_check.results }}"
36 when: item.stat.exists