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 }}" |
Bartek Grzybowski | 76e017a | 2019-06-04 12:47:20 +0200 | [diff] [blame] | 7 | loop: |
Michal Ptacek | 84617e8 | 2019-05-24 12:05:04 +0000 | [diff] [blame] | 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 }}" |
Bartek Grzybowski | 76e017a | 2019-06-04 12:47:20 +0200 | [diff] [blame] | 14 | loop: |
Michal Ptacek | 863926e | 2019-06-05 16:14:00 +0000 | [diff] [blame] | 15 | - oof/charts/oof-cmso/charts/oof-cmso-service/templates/deployment.yaml |
Michal Ptacek | fff4f53 | 2019-05-28 13:59:07 +0000 | [diff] [blame] | 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 |
Bartek Grzybowski | 76e017a | 2019-06-04 12:47:20 +0200 | [diff] [blame] | 25 | loop: "{{ npm_files_check.results }}" |
Michal Ptacek | 84617e8 | 2019-05-24 12:05:04 +0000 | [diff] [blame] | 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 }}" |
Michal Ptacek | 863926e | 2019-06-05 16:14:00 +0000 | [diff] [blame] | 31 | regexp: '^(.*)INFRA_CLUSTER_IP' |
| 32 | line: '\g<1>{{ cluster_ip }}' |
Michal Ptacek | fff4f53 | 2019-05-28 13:59:07 +0000 | [diff] [blame] | 33 | backrefs: yes |
| 34 | state: present |
Bartek Grzybowski | 76e017a | 2019-06-04 12:47:20 +0200 | [diff] [blame] | 35 | loop: "{{ hosts_files_check.results }}" |
Michal Ptacek | fff4f53 | 2019-05-28 13:59:07 +0000 | [diff] [blame] | 36 | when: item.stat.exists |