blob: 474b8ed4ca497f6d245d0a5786fc0f07644a0e16 [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 }}"
Bartek Grzybowski76e017a2019-06-04 12:47:20 +02007 loop:
Michal Ptacek84617e82019-05-24 12:05:04 +00008 - 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 }}"
Bartek Grzybowski76e017a2019-06-04 12:47:20 +020014 loop:
Michal Ptacek863926e2019-06-05 16:14:00 +000015 - oof/charts/oof-cmso/charts/oof-cmso-service/templates/deployment.yaml
Michal Ptacekfff4f532019-05-28 13:59:07 +000016 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
Bartek Grzybowski76e017a2019-06-04 12:47:20 +020025 loop: "{{ npm_files_check.results }}"
Michal Ptacek84617e82019-05-24 12:05:04 +000026 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 }}"
Michal Ptacek863926e2019-06-05 16:14:00 +000031 regexp: '^(.*)INFRA_CLUSTER_IP'
32 line: '\g<1>{{ cluster_ip }}'
Michal Ptacekfff4f532019-05-28 13:59:07 +000033 backrefs: yes
34 state: present
Bartek Grzybowski76e017a2019-06-04 12:47:20 +020035 loop: "{{ hosts_files_check.results }}"
Michal Ptacekfff4f532019-05-28 13:59:07 +000036 when: item.stat.exists