Michal Ptacek | 84617e8 | 2019-05-24 12:05:04 +0000 | [diff] [blame] | 1 | --- |
| 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 Ptacek | fff4f53 | 2019-05-28 13:59:07 +0000 | [diff] [blame] | 11 | - 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 Ptacek | 84617e8 | 2019-05-24 12:05:04 +0000 | [diff] [blame] | 18 | - 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 Ptacek | fff4f53 | 2019-05-28 13:59:07 +0000 | [diff] [blame] | 28 | - 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 |