Fix DNS flush 49/36849/4
authorchigang <chigang@huawei.com>
Mon, 3 Jul 2017 06:40:34 +0000 (14:40 +0800)
committerchigang <chigang@huawei.com>
Mon, 3 Jul 2017 07:35:45 +0000 (15:35 +0800)
JIRA:-

It doesn't need to config DNS in ansible roles, just need to
set NAMESERVERS variable

Change-Id: I37a70b32c766c1fad7afa5289ffbbc27b956b2d5
Signed-off-by: chigang <chigang@huawei.com>
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/openstack/group_vars/all
deploy/adapters/ansible/roles/config-compute/tasks/Ubuntu.yml
deploy/adapters/ansible/roles/config-compute/templates/compute.j2
deploy/adapters/ansible/roles/config-controller/templates/controller.j2
deploy/adapters/ansible/roles/config-deployment/files/setup-ovs.yml
deploy/adapters/ansible/roles/config-deployment/tasks/main.yml
deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml.j2 [moved from deploy/adapters/ansible/roles/config-deployment/templates/user_variables.yml with 99% similarity]
deploy/adapters/ansible/roles/setup-host/tasks/main.yml
deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl

index 2979632..663f02b 100644 (file)
@@ -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
index 54fdabe..79859d0 100644 (file)
@@ -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
index 4bf243b..886a407 100644 (file)
@@ -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
index 9a73438..66c3297 100644 (file)
@@ -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
index d28297d..215807f 100755 (executable)
@@ -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
index 1097240..57bc5ef 100644 (file)
         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
index 1269cd3..8246d6e 100644 (file)
@@ -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
 
 - 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:
@@ -29,7 +29,7 @@ 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="
index e7aabcb..73f572e 100644 (file)
@@ -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; \