From d529e77a45c77c10ac6970ca9e733e92e89d138f Mon Sep 17 00:00:00 2001 From: chigang Date: Mon, 3 Jul 2017 14:40:34 +0800 Subject: Fix DNS flush JIRA:- It doesn't need to config DNS in ansible roles, just need to set NAMESERVERS variable Change-Id: I37a70b32c766c1fad7afa5289ffbbc27b956b2d5 Signed-off-by: chigang --- .../roles/config-deployment/files/setup-ovs.yml | 10 +++-- .../ansible/roles/config-deployment/tasks/main.yml | 14 +++---- .../config-deployment/templates/user_variables.yml | 47 ---------------------- .../templates/user_variables.yml.j2 | 47 ++++++++++++++++++++++ 4 files changed, 60 insertions(+), 58 deletions(-) delete mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml create mode 100644 deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 (limited to 'deploy/adapters/ansible/roles/config-deployment') diff --git a/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml b/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml index 10972401..57bc5ef1 100644 --- a/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml +++ b/deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml @@ -10,13 +10,14 @@ name: neutron-openvswitch-agent state: stopped + # yamllint disable rule:line-length - name: change the openvswitch_agent.ini lineinfile: dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini insertafter: '^bridge_mappings' line: "local_ip = {{ hostvars[inventory_hostname]['container_networks']['tunnel_address']['address'] }}" when: - - inventory_hostname not in groups['nova_compute'] + - inventory_hostname not in groups['nova_compute'] - name: change the openvswitch_agent.ini lineinfile: @@ -27,7 +28,8 @@ notify: - Restart neutron-openvswitch-agent when: - - inventory_hostname in groups['nova_compute'] + - inventory_hostname in groups['nova_compute'] + # yamllint enable rule:line-length - name: Setup br-provider openvswitch_bridge: @@ -36,7 +38,7 @@ notify: - Restart neutron-openvswitch-agent when: - - inventory_hostname not in groups['nova_compute'] + - inventory_hostname not in groups['nova_compute'] - name: Add port to br-provider openvswitch_port: @@ -46,7 +48,7 @@ notify: - Restart neutron-openvswitch-agent when: - - inventory_hostname not in groups['nova_compute'] + - inventory_hostname not in groups['nova_compute'] handlers: - name: Restart neutron-openvswitch-agent diff --git a/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml b/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml index 1269cd3f..8246d6e7 100644 --- a/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml +++ b/deploy/adapters/ansible/roles/config-deployment/tasks/main.yml @@ -1,11 +1,11 @@ -############################################################################## +# ############################################################################# # Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## +# ############################################################################# --- - name: create osa log directory file: @@ -19,7 +19,7 @@ - name: copy user_variables template: - src: user_variables.yml + src: user_variables.yml.j2 dest: /etc/openstack_deploy/user_variables.yml - name: copy cinder.yml @@ -44,13 +44,13 @@ - name: generate create-network.yml template: - src: create-network.yml.j2 - dest: /opt/openstack-ansible/playbooks/create-network.yml + src: create-network.yml.j2 + dest: /opt/openstack-ansible/playbooks/create-network.yml - name: generate create-flavor.yml template: - src: create-flavor.yml.j2 - dest: /opt/openstack-ansible/playbooks/create-flavor.yml + src: create-flavor.yml.j2 + dest: /opt/openstack-ansible/playbooks/create-flavor.yml - name: copy http.yml copy: diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml b/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml deleted file mode 100644 index 16f78ff8..00000000 --- a/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ## -# ## This file contains commonly used overrides for convenience. Please inspect -# ## the defaults for each role to find additional override options. -# ## - -# # Debug and Verbose options. -debug: false - -openstack_service_publicuri_proto: http -haproxy_keepalived_external_vip_cidr: "{{ public_vip.ip }}/32" -haproxy_keepalived_internal_vip_cidr: "10.1.0.22/32" -haproxy_keepalived_external_interface: br-vlan -haproxy_keepalived_internal_interface: br-mgmt - -{% if "openvswitch" == NEUTRON_MECHANISM_DRIVERS[0] or - "opendaylight" == NEUTRON_MECHANISM_DRIVERS[0] - %} -openstack_host_specific_kernel_modules: - - name: "openvswitch" - pattern: "CONFIG_OPENVSWITCH=" - group: "network_hosts" - -neutron_plugin_type: ml2.ovs - -neutron_ml2_drivers_type: "local,flat,vlan,vxlan" - -neutron_provider_networks: - network_flat_networks: "*" - network_types: "vxlan" - network_vxlan_ranges: "1:1000" - network_mappings: "physnet:br-provider" -{% endif %} diff --git a/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 b/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 new file mode 100644 index 00000000..443a3f5b --- /dev/null +++ b/deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 @@ -0,0 +1,47 @@ +--- +# Copyright 2014, Rackspace US, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ## +# ## This file contains commonly used overrides for convenience. Please inspect +# ## the defaults for each role to find additional override options. +# ## + +# # Debug and Verbose options. +debug: false + +openstack_service_publicuri_proto: http +haproxy_keepalived_external_vip_cidr: "{{ public_vip.ip }}/32" +haproxy_keepalived_internal_vip_cidr: "10.1.0.22/32" +haproxy_keepalived_external_interface: br-vlan +haproxy_keepalived_internal_interface: br-mgmt + +{% if "openvswitch" == NEUTRON_MECHANISM_DRIVERS[0] or + "opendaylight" == NEUTRON_MECHANISM_DRIVERS[0] +%} +openstack_host_specific_kernel_modules: + - name: "openvswitch" + pattern: "CONFIG_OPENVSWITCH=" + group: "network_hosts" + +neutron_plugin_type: ml2.ovs + +neutron_ml2_drivers_type: "local,flat,vlan,vxlan" + +neutron_provider_networks: + network_flat_networks: "*" + network_types: "vxlan" + network_vxlan_ranges: "1:1000" + network_mappings: "physnet:br-provider" +{% endif %} -- cgit 1.2.3-korg 26 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261