]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: Remove DHCP configuration wip-37614 429/head
authorDavid Galloway <dgallowa@redhat.com>
Wed, 12 Dec 2018 15:03:26 +0000 (10:03 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 12 Dec 2018 15:28:27 +0000 (10:28 -0500)
I believe these tasks were originally added when we switched the Sepia
lab from static IP assignments to DHCP.  We can get rid of these tasks
now because:

1) All our testnodes are using DHCP now and have been for at least a
year
2) NICs are already configured in our FOG images and OVH nodes get
configured via cloud-init

Fixes: https://tracker.ceph.com/issues/37614
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/tasks/resolvconf.yml

index 940b6eb431709621b2d915cc5f0af087ff396a14..34bce3f6e0657c1724ac2235bf92eb87f8f0d645 100644 (file)
@@ -6,49 +6,6 @@
     purge: yes
   when: ansible_pkg_mgr == "apt"
 
-- name: Set interface
-  set_fact:
-    interface: "{{ ansible_default_ipv4.interface }}"
-
-- name: Check for presence of /etc/network/interfaces
-  stat:
-    path: /etc/network/interfaces
-    get_checksum: no
-    get_md5: no
-  register: etc_network_interfaces
-
-- name: Rewrite /etc/network/interfaces to use dhcp
-  replace:
-    dest: /etc/network/interfaces
-    # This regexp matches a stanza like:
-    #
-    # iface eth0 inet static
-    #     address 10.8.128.17
-    #     netmask 255.255.248.0
-    #     gateway 10.8.135.254
-    #     broadcast 10.8.135.255
-    #
-    # It also handles cases where the entire stanza has whitespace in front of it.
-    regexp: '^ *iface {{ interface }} inet static(\n\ +[^\s]+.*)+'
-    replace: "iface {{ interface }} inet dhcp\n"
-  when: etc_network_interfaces.stat.exists
-  register: dhcp_enabled
-
-- name: Set bounce_interface if we just enabled dhcp
-  set_fact:
-    bounce_interface: "{{ dhcp_enabled|changed }}"
-
-- name: ifdown and ifup
-  shell: "ifdown {{ interface }} && ifup {{ interface }}"
-  # Even if bounce_interface is False, we need to work around a Xenial issue
-  # where purging resolvconf breaks DNS by removing /etc/resolv.conf. Bouncing
-  # the interface rebuilds it.
-  # The Ubuntu bug is:
-  # https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1593489
-  when: bounce_interface == "True" or 
-        (ansible_distribution|lower == 'ubuntu' and
-        ansible_distribution_major_version|int >= 16)
-
 - name: Ensure lab_domain is in search domains in /etc/resolv.conf
   lineinfile:
     dest: /etc/resolv.conf