blob: 38d0ab923a7743c3af325fd4ac230153d9fe8ab1 [file] [log] [blame]
---
# This role contains patching logic for OOM charts
# and is valid until OOM-1610 is implemented
- name: Check presence of files for NPM patching
stat:
path: "{{ app_helm_charts_infra_directory }}/{{ item }}"
loop:
- common/dgbuilder/templates/deployment.yaml
register: npm_files_check
- name: Check presence of files for nexus domain resolving
stat:
path: "{{ app_helm_charts_infra_directory }}/{{ item }}"
loop:
- oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh
register: hosts_files_check
- name: Patch OOM - set npm registry
lineinfile:
path: "{{ item.stat.path }}"
regexp: '^(.*)NPM_REGISTRY_RECORD'
line: '\g<1>npm set registry "http://nexus.{{ ansible_nodename }}/repository/npm-private/";'
backrefs: yes
state: present
loop: "{{ npm_files_check.results }}"
when: item.stat.exists
- name: Patch OOM - nexus domain resolving
lineinfile:
path: "{{ item.stat.path }}"
regexp: '^(.*)HOSTS_FILE_RECORD'
line: '\g<1>{{ cluster_ip }} {{ simulated_hosts.nexus | join(" ") }} >> /etc/hosts;'
backrefs: yes
state: present
loop: "{{ hosts_files_check.results }}"
when: item.stat.exists