summaryrefslogtreecommitdiffstats
path: root/patches/onap-casablanca-patch-role/tasks/main.yml
blob: 00ee45772b0c78e1c9e6824ac55e75653f0d6c35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
# 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 }}"
  with_items:
    - common/dgbuilder/templates/deployment.yaml
    - sdnc/charts/sdnc-portal/templates/deployment.yaml
  register: npm_files_check

- name: Check presence of dcae cloudify deployment chart file
  stat:
    path: "{{ app_helm_charts_infra_directory }}/{{ item }}"
  with_items:
    - dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml
  register: dcae_files_check

- 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
  with_items: "{{ npm_files_check.results }}"
  when: item.stat.exists

- 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
  with_items: "{{ npm_files_check.results }}"
  when: item.stat.exists

- name: Patch OOM - set cert path for cloudify
  lineinfile:
    path: "{{ item.stat.path }}"
    regexp: '^(.*)CERT_PATH'
    line: '\g<1>/etc/pki/ca-trust/source/anchors'
    backrefs: yes
    state: present
  with_items: "{{ dcae_files_check.results }}"
  when: item.stat.exists