]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Handle interfaces stanzas with leading whitespace 174/head
authorZack Cerza <zack@redhat.com>
Fri, 4 Dec 2015 22:51:22 +0000 (15:51 -0700)
committerZack Cerza <zack@redhat.com>
Fri, 4 Dec 2015 22:51:22 +0000 (15:51 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
roles/testnode/tasks/resolvconf.yml

index 21af20485798800943a37835dece16e5b487b4d9..d4d863bb273ca79fccd9be22a8c40e60369e1c59 100644 (file)
   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
-    regexp: '^iface {{ interface }} inet static(\n\ +.*)+'
+    #
+    # 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