Browse Source

Merge "ir plugin: Fix issues related to migration-tool package and OVN image preparation"

Zuul 4 months ago
parent
commit
b7385790e5

+ 0
- 36
migration/infrared/tripleo-ovn-migration/main.yml View File

@@ -8,47 +8,11 @@
8 8
             name: python-virtualenv
9 9
             state: present
10 10
 
11
-      - name: Enable delorean deps repository
12
-        yum_repository:
13
-            name: dlrn-master-deps
14
-            description: dlrn-master-deps
15
-            baseurl: https://trunk.rdoproject.org/centos7-master/deps/latest/
16
-            gpgcheck: no
17
-            includepkgs: python2-openvswitch
18
-
19
-      - name: Enable delorean current repository
20
-        yum_repository:
21
-            name: dlrn-master
22
-            description: dlrn-master
23
-            baseurl: https://trunk.rdoproject.org/centos7-master/current/
24
-            gpgcheck: no
25
-            includepkgs: python-networking-ovn,python-networking-ovn-migration-tool
26
-
27
-      - name: Install python2 openvswitch
28
-        yum:
29
-            name: python2-openvswitch
30
-            state: present
31
-
32
-      - name: Install python-networking-ovn
33
-        yum:
34
-            name: python-networking-ovn
35
-            state: present
36
-
37 11
       - name: Install python networking ovn migration tool
38 12
         yum:
39 13
             name: python-networking-ovn-migration-tool
40 14
             state: present
41 15
 
42
-      - name: Disable delorean deps repository
43
-        yum_repository:
44
-            name: dlrn-master-deps
45
-            state: absent
46
-
47
-      - name: Disable delorean repository
48
-        yum_repository:
49
-            name: dlrn-master
50
-            state: absent
51
-
52 16
       - name: Set host_key_checking to False in ansible.cfg
53 17
         ini_file:
54 18
             path=/etc/ansible/ansible.cfg

+ 32
- 18
migration/infrared/tripleo-ovn-migration/roles/prepare-migration/tasks/main.yml View File

@@ -1,4 +1,3 @@
1
-
2 1
 - name: Copy overcloud deploy script to overcloud-deploy-ovn.sh
3 2
   block:
4 3
       - name: Check if overcloud_deploy.sh is present or not
@@ -75,13 +74,22 @@
75 74
 - name: Set image tag (infrared deployment)
76 75
   block:
77 76
       - name: Get puddle version
78
-        shell: cat ~/core_puddle_version
77
+        shell: cat containers-prepare-parameter.yaml | grep -v _tag | grep tag | awk '{print $2}'
79 78
         ignore_error: True
80 79
         register: core_puddle_version
81 80
 
82 81
       - name: Set image tag from puddle version
83 82
         set_fact:
84
-            docker_image_tag: "{{ (core_puddle_version.stdout != '') | ternary(core_puddle_version.stdout, image_tag) }}"
83
+            docker_image_tag: "{{ core_puddle_version.stdout }}"
84
+
85
+      - name: Get registry namespace
86
+        shell: cat containers-prepare-parameter.yaml | grep -v _namespace | grep namespace | awk '{print $2}'
87
+        ignore_error: True
88
+        register: reg_ns
89
+
90
+      - name: Set registry namespace
91
+        set_fact:
92
+            reg_namespace: "{{ reg_ns.stdout }}"
85 93
 
86 94
       - debug:
87 95
           msg: "{{ core_puddle_version.stdout }}"
@@ -89,6 +97,8 @@
89 97
       - debug:
90 98
           msg: "{{ docker_image_tag }}"
91 99
 
100
+      - debug:
101
+          msg: "{{ reg_namespace }}"
92 102
   when: infrared_deployment|bool
93 103
 
94 104
 - name: Set image tag (tripleo deployment)
@@ -105,13 +115,17 @@
105 115
 - name: Add ovn container images to ovn_container_images.yaml
106 116
   lineinfile:
107 117
       dest: ~/ovn_container_images.yaml
108
-      line: "- imagename: {{ registry_namespace }}/{{ image_prefix }}-{{ item }}:{{ docker_image_tag }}"
118
+      line: "- imagename: {{ reg_namespace }}/{{ image_prefix }}-{{ item }}:{{ docker_image_tag }}"
109 119
   with_items:
110 120
       - "ovn-northd"
111 121
       - "ovn-controller"
112 122
       - "neutron-server-ovn"
113 123
       - "neutron-metadata-agent-ovn"
114 124
 
125
+- name: Generate docker images environment file
126
+  shell: |
127
+      echo "parameter_defaults:" > ~/docker-images-ovn.yaml
128
+
115 129
 - name: Set the local namespace
116 130
   block:
117 131
      - name: Extract the local namespace
@@ -123,9 +137,8 @@
123 137
            mv overcloud.tar.gz /tmp/oc_plan/
124 138
            cd /tmp/oc_plan
125 139
            tar xvf overcloud.tar.gz
126
-           reg=`cat /tmp/oc_plan/plan-environment.yaml  | grep DockerNeutronApiImage | awk '{ split($2, image , "/"); print image[1] }'`
127
-           namespace=`cat /tmp/oc_plan/plan-environment.yaml  | grep DockerNeutronApiImage | awk '{ split($2, image , "/"); print image[2] }'`
128
-           img=`cat plan-environment.yaml  | grep DockerNeutronApiImage | awk '{ split($2, image, "/"); print image[3] }'`
140
+           reg=`cat /tmp/oc_plan/environments/containers-default-parameters.yaml  | grep DockerNeutronApiImage | awk '{ split($2, image , "/"); print image[1] }'`
141
+           namespace=`cat /tmp/oc_plan/environments/containers-default-parameters.yaml  | grep DockerNeutronApiImage | awk '{ split($2, image , "/"); print image[2] }'`
129 142
            echo $reg/$namespace > /tmp/_reg_namespace
130 143
            rm -rf /tmp/oc_plan
131 144
 
@@ -145,17 +158,18 @@
145 158
   when:
146 159
       - local_namespace != ''
147 160
 
148
-- name: Generate docker images environment file
149
-  shell: |
150
-      set -exo pipefail
151
-      openstack overcloud container image prepare \
152
-      --namespace={{ local_registry }} \
153
-      --tag={{ docker_image_tag }} \
154
-      --prefix={{ image_prefix }} \
155
-      --output-env-file={{ output_env_file }} \
156
-      -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml \
157
-      -e /usr/share/openstack-tripleo-heat-templates/environments/docker-ha.yaml \
158
-      -e {{ neutron_ovn_env_path }}
161
+- name: Add ovn container images to docker images environment file
162
+  lineinfile:
163
+      dest: ~/docker-images-ovn.yaml
164
+      line: "  {{ item.name }}: {{ local_registry }}/{{ image_prefix }}-{{ item.image_name }}:{{ docker_image_tag }}"
165
+  with_items:
166
+      - { name: DockerNeutronApiImage, image_name: neutron-server-ovn}
167
+      - { name: DockerNeutronConfigImage, image_name: neutron-server-ovn}
168
+      - { name: DockerOvnMetadataImage, image_name: neutron-metadata-agent-ovn}
169
+      - { name: DockerOvnControllerImage, image_name: ovn-controller}
170
+      - { name: DockerOvnControllerConfigImage, image_name: ovn-controller}
171
+      - { name: DockerOvnDbsImage, image_name: ovn-northd}
172
+      - { name: DockerOvnDbsConfigImage, image_name: ovn-northd}
159 173
 
160 174
 - name: Upload the ovn docker images to the local registry
161 175
   shell: |

Loading…
Cancel
Save