Take advantage of the YAML multiline notation

This commit is contained in:
Anders Ingemann 2014-07-06 18:24:35 +02:00
parent 03a0746299
commit 376baae583
2 changed files with 15 additions and 16 deletions

View file

@ -1,17 +1,16 @@
---
# This is a mapping of Debian release codenames to NIC configurations
# Every item in an array is a line
squeeze:
- auto lo
- iface lo inet loopback
- auto eth0
- iface eth0 inet dhcp
wheezy:
- auto eth0
- iface eth0 inet dhcp
jessie:
- auto eth0
- iface eth0 inet dhcp
sid:
- auto eth0
- iface eth0 inet dhcp
squeeze: |
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
wheezy: |
auto eth0
iface eth0 inet dhcp
jessie: |
auto eth0
iface eth0 inet dhcp
sid: |
auto eth0
iface eth0 inet dhcp

View file

@ -51,4 +51,4 @@ class ConfigureNetworkIF(Task):
interfaces_path = os.path.join(info.root, 'etc/network/interfaces')
with open(interfaces_path, 'a') as interfaces:
interfaces.write('\n'.join(if_config) + '\n')
interfaces.write(if_config + '\n')