From f79e647b61fd25be3367314236c8192f129fa8d7 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 3 Jul 2017 20:18:24 +0200 Subject: [PATCH] change variable layout --- defaults/main.yml | 9 ++++++--- tasks/config.yml | 15 +++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4fb31fa..ad4e999 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,7 @@ --- -def_network: - disable_ipv6: false -network: {} +network_hostname: '' +network_fqdn: '' +network_defaultif: '' +network_disable_ipv6: false + +network_interfaces: {} diff --git a/tasks/config.yml b/tasks/config.yml index d41d196..211d84d 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,35 +1,34 @@ --- - name: set hostname - template: + template: src: 'etc/hostname.j2' dest: '/etc/hostname' owner: root group: root mode: 0644 register: hostname_result - notify: + notify: - host_reboot - name: set hosts file - template: + template: src: 'etc/hosts.j2' dest: '/etc/hosts' owner: root group: root - mode: 0644 + mode: 0644 register: hosts_result - notify: + notify: - host_reboot - name: interface configuration - template: + template: src: 'etc/sysconfig/network-scrips/ifcfg.j2' dest: '/etc/sysconfig/network-scripts/ifcfg-{{ item.key }}' owner: root group: root mode: 0644 - with_dict: '{{ network.config }}' + with_dict: '{{ network_interfaces }}' when: item.key in ansible_interfaces notify: - network_restart -