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 --- .../ansible/openstack/HA-ansible-multinodes.yml | 7 ++-- deploy/adapters/ansible/openstack/group_vars/all | 1 - .../ansible/roles/config-compute/tasks/Ubuntu.yml | 6 --- .../roles/config-compute/templates/compute.j2 | 3 +- .../config-controller/templates/controller.j2 | 1 - .../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 ++++++++++++++++++++++ .../ansible/roles/setup-host/tasks/main.yml | 6 +-- .../vars/HA-ansible-multinodes.tmpl | 1 - 11 files changed, 67 insertions(+), 76 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') diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 29796323..663f02b8 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -1,12 +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 -############################################################################## - +# ############################################################################# --- - hosts: all remote_user: root @@ -31,6 +30,6 @@ - role: setup-infrastructure - role: setup-openstack - role: setup-openvswitch - when: NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or + when: NEUTRON_MECHANISM_DRIVERS[0] == "openvswitch" or NEUTRON_MECHANISM_DRIVERS[0] == "opendaylight" - role: openstack-post diff --git a/deploy/adapters/ansible/openstack/group_vars/all b/deploy/adapters/ansible/openstack/group_vars/all index 54fdabe1..79859d0c 100644 --- a/deploy/adapters/ansible/openstack/group_vars/all +++ b/deploy/adapters/ansible/openstack/group_vars/all @@ -38,7 +38,6 @@ NEUTRON_TUNNEL_TYPES: ['vxlan'] METADATA_SECRET: metadata_secret INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS: 10.1.1.21 INTERFACE_NAME: eth2 -DNS: 8.8.8.8 EXTERNAL_NETWORK_CIDR: 203.0.113.0/24 EXTERNAL_NETWORK_GATEWAY: 203.0.113.1 diff --git a/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml b/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml index 4bf243b5..886a407f 100644 --- a/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml +++ b/deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml @@ -7,12 +7,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- name: remove resolv.conf - file: "dest=/etc/resolv.conf state=absent" - -- name: make a symbolic link - shell: "ln -s /var/run/resolvconf/resolv.conf /etc/resolv.conf" - - name: configure network template: src: compute.j2 diff --git a/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 b/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 index 9a734385..66c3297b 100644 --- a/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 +++ b/deploy/adapters/ansible/roles/config-compute/templates/compute.j2 @@ -69,9 +69,8 @@ iface br-vlan inet static # -- Putting this here is primarily for tempest to work. address {{host_info[inventory_hostname].VLAN_IP_SECOND}} netmask 255.255.252.0 - dns-nameservers {{ DNS }} -# compute1 Storage bridge +# compute storage bridge auto br-storage iface br-storage inet static bridge_stp off diff --git a/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 b/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 index d28297db..215807f0 100755 --- a/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 +++ b/deploy/adapters/ansible/roles/config-controller/templates/controller.j2 @@ -53,7 +53,6 @@ iface br-vlan inet static address {{ ip_settings[inventory_hostname]["br-prv"]["ip"] }} netmask 255.255.255.0 gateway {{ ip_settings[inventory_hostname]["br-prv"]["gw"] }} - dns-nameservers {{ DNS }} # compute1 Storage bridge auto br-storage 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 %} diff --git a/deploy/adapters/ansible/roles/setup-host/tasks/main.yml b/deploy/adapters/ansible/roles/setup-host/tasks/main.yml index e7aabcbb..73f572ea 100644 --- a/deploy/adapters/ansible/roles/setup-host/tasks/main.yml +++ b/deploy/adapters/ansible/roles/setup-host/tasks/main.yml @@ -1,11 +1,11 @@ -############################################################################## +# ############################################################################# # Copyright (c) 2016 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: setup hosts shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ @@ -27,7 +27,7 @@ -e force_containers_data_destroy=yes > /dev/null;" with_items: - "{{ failed_container.stdout_lines }}" - ignore_errors: True + ignore_errors: "True" - name: retry to setup failed_container shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl index b4ea6e04..cca66f1d 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl @@ -149,7 +149,6 @@ ERLANG_TOKEN: YOWSJSJIGGAUFZTIBRAD cluster_name: $cluster_name -DNS: 8.8.8.8 odl_controller: 10.1.0.15 DEBUG: true -- cgit 1.2.3-korg