diff options
author | Zuul <zuul@review.openstack.org> | 2018-11-26 15:13:46 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-11-26 15:13:46 +0000 |
commit | b7385790e5ad7cb02fada69d232cd0347fcfa509 (patch) | |
tree | 065dfe9316f04a49bfb04884d7e3aa48e7a039fd | |
parent | a4e69319ad61dffe0482d6fe7a9b421b55145f0a (diff) | |
parent | 599b6c54bc165e7d01ea16f8294dd24d281b1071 (diff) |
Merge "ir plugin: Fix issues related to migration-tool package and OVN image preparation"
-rw-r--r-- | migration/infrared/tripleo-ovn-migration/main.yml | 36 | ||||
-rw-r--r-- | migration/infrared/tripleo-ovn-migration/roles/prepare-migration/tasks/main.yml | 50 |
2 files changed, 32 insertions, 54 deletions
diff --git a/migration/infrared/tripleo-ovn-migration/main.yml b/migration/infrared/tripleo-ovn-migration/main.yml index 999c36a..600e31e 100644 --- a/migration/infrared/tripleo-ovn-migration/main.yml +++ b/migration/infrared/tripleo-ovn-migration/main.yml | |||
@@ -8,47 +8,11 @@ | |||
8 | name: python-virtualenv | 8 | name: python-virtualenv |
9 | state: present | 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 | - name: Install python networking ovn migration tool | 11 | - name: Install python networking ovn migration tool |
38 | yum: | 12 | yum: |
39 | name: python-networking-ovn-migration-tool | 13 | name: python-networking-ovn-migration-tool |
40 | state: present | 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 | - name: Set host_key_checking to False in ansible.cfg | 16 | - name: Set host_key_checking to False in ansible.cfg |
53 | ini_file: | 17 | ini_file: |
54 | path=/etc/ansible/ansible.cfg | 18 | path=/etc/ansible/ansible.cfg |
diff --git a/migration/infrared/tripleo-ovn-migration/roles/prepare-migration/tasks/main.yml b/migration/infrared/tripleo-ovn-migration/roles/prepare-migration/tasks/main.yml index 599e75d..1ae7ddd 100644 --- a/migration/infrared/tripleo-ovn-migration/roles/prepare-migration/tasks/main.yml +++ b/migration/infrared/tripleo-ovn-migration/roles/prepare-migration/tasks/main.yml | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | - name: Copy overcloud deploy script to overcloud-deploy-ovn.sh | 1 | - name: Copy overcloud deploy script to overcloud-deploy-ovn.sh |
3 | block: | 2 | block: |
4 | - name: Check if overcloud_deploy.sh is present or not | 3 | - name: Check if overcloud_deploy.sh is present or not |
@@ -75,13 +74,22 @@ | |||
75 | - name: Set image tag (infrared deployment) | 74 | - name: Set image tag (infrared deployment) |
76 | block: | 75 | block: |
77 | - name: Get puddle version | 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 | ignore_error: True | 78 | ignore_error: True |
80 | register: core_puddle_version | 79 | register: core_puddle_version |
81 | 80 | ||
82 | - name: Set image tag from puddle version | 81 | - name: Set image tag from puddle version |
83 | set_fact: | 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 | - debug: | 94 | - debug: |
87 | msg: "{{ core_puddle_version.stdout }}" | 95 | msg: "{{ core_puddle_version.stdout }}" |
@@ -89,6 +97,8 @@ | |||
89 | - debug: | 97 | - debug: |
90 | msg: "{{ docker_image_tag }}" | 98 | msg: "{{ docker_image_tag }}" |
91 | 99 | ||
100 | - debug: | ||
101 | msg: "{{ reg_namespace }}" | ||
92 | when: infrared_deployment|bool | 102 | when: infrared_deployment|bool |
93 | 103 | ||
94 | - name: Set image tag (tripleo deployment) | 104 | - name: Set image tag (tripleo deployment) |
@@ -105,13 +115,17 @@ | |||
105 | - name: Add ovn container images to ovn_container_images.yaml | 115 | - name: Add ovn container images to ovn_container_images.yaml |
106 | lineinfile: | 116 | lineinfile: |
107 | dest: ~/ovn_container_images.yaml | 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 | with_items: | 119 | with_items: |
110 | - "ovn-northd" | 120 | - "ovn-northd" |
111 | - "ovn-controller" | 121 | - "ovn-controller" |
112 | - "neutron-server-ovn" | 122 | - "neutron-server-ovn" |
113 | - "neutron-metadata-agent-ovn" | 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 | - name: Set the local namespace | 129 | - name: Set the local namespace |
116 | block: | 130 | block: |
117 | - name: Extract the local namespace | 131 | - name: Extract the local namespace |
@@ -123,9 +137,8 @@ | |||
123 | mv overcloud.tar.gz /tmp/oc_plan/ | 137 | mv overcloud.tar.gz /tmp/oc_plan/ |
124 | cd /tmp/oc_plan | 138 | cd /tmp/oc_plan |
125 | tar xvf overcloud.tar.gz | 139 | tar xvf overcloud.tar.gz |
126 | reg=`cat /tmp/oc_plan/plan-environment.yaml | grep DockerNeutronApiImage | awk '{ split($2, image , "/"); print image[1] }'` | 140 | reg=`cat /tmp/oc_plan/environments/containers-default-parameters.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] }'` | 141 | namespace=`cat /tmp/oc_plan/environments/containers-default-parameters.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] }'` | ||
129 | echo $reg/$namespace > /tmp/_reg_namespace | 142 | echo $reg/$namespace > /tmp/_reg_namespace |
130 | rm -rf /tmp/oc_plan | 143 | rm -rf /tmp/oc_plan |
131 | 144 | ||
@@ -145,17 +158,18 @@ | |||
145 | when: | 158 | when: |
146 | - local_namespace != '' | 159 | - local_namespace != '' |
147 | 160 | ||
148 | - name: Generate docker images environment file | 161 | - name: Add ovn container images to docker images environment file |
149 | shell: | | 162 | lineinfile: |
150 | set -exo pipefail | 163 | dest: ~/docker-images-ovn.yaml |
151 | openstack overcloud container image prepare \ | 164 | line: " {{ item.name }}: {{ local_registry }}/{{ image_prefix }}-{{ item.image_name }}:{{ docker_image_tag }}" |
152 | --namespace={{ local_registry }} \ | 165 | with_items: |
153 | --tag={{ docker_image_tag }} \ | 166 | - { name: DockerNeutronApiImage, image_name: neutron-server-ovn} |
154 | --prefix={{ image_prefix }} \ | 167 | - { name: DockerNeutronConfigImage, image_name: neutron-server-ovn} |
155 | --output-env-file={{ output_env_file }} \ | 168 | - { name: DockerOvnMetadataImage, image_name: neutron-metadata-agent-ovn} |
156 | -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml \ | 169 | - { name: DockerOvnControllerImage, image_name: ovn-controller} |
157 | -e /usr/share/openstack-tripleo-heat-templates/environments/docker-ha.yaml \ | 170 | - { name: DockerOvnControllerConfigImage, image_name: ovn-controller} |
158 | -e {{ neutron_ovn_env_path }} | 171 | - { name: DockerOvnDbsImage, image_name: ovn-northd} |
172 | - { name: DockerOvnDbsConfigImage, image_name: ovn-northd} | ||
159 | 173 | ||
160 | - name: Upload the ovn docker images to the local registry | 174 | - name: Upload the ovn docker images to the local registry |
161 | shell: | | 175 | shell: | |