diff options
| author | Kevin Fenzi <kevin@scrye.com> | 2016-02-05 17:59:23 +0000 |
|---|---|---|
| committer | Kevin Fenzi <kevin@scrye.com> | 2016-02-05 17:59:23 +0000 |
| commit | ec285b1708094f53be9d5ea987c5e7cf2ebf2938 (patch) | |
| tree | d7a541d66b752141cf9df838f1f85c5f72c6bc9a | |
| parent | 5ecc096a05404ddd288966cedc54b13960d6bb50 (diff) | |
| download | ansible-ec285b1708094f53be9d5ea987c5e7cf2ebf2938.tar.gz ansible-ec285b1708094f53be9d5ea987c5e7cf2ebf2938.tar.xz ansible-ec285b1708094f53be9d5ea987c5e7cf2ebf2938.zip | |
Re-add ansible network setup and split out virbr case.
| -rw-r--r-- | roles/base/tasks/main.yml | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index bf6d80831..266189d6e 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -19,41 +19,41 @@ - resolvconf - base -#- name: disable resolv.conf control from NM -# ini_file: dest=/etc/NetworkManager/NetworkManager.conf section=main option=dns value=none -# notify: -# - restart NetworkManager -# when: ansible_distribution_major_version|int >=7 -# tags: -# - config -# - resolvconf -# - base -# -#- name: get interface uuid -# shell: nmcli -f "DEVICE,UUID" c show --active | grep -E '^eth|^br' -# register: if_uuid -# changed_when: false -# failed_when: 'if_uuid.stdout == ""' -# always_run: yes -# when: ansible_distribution_major_version|int >=7 -# tags: -# - config -# - ifcfg -# - base -# -#- name: copy ifcfg files - non virthost -# template: src=ifcfg.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{item}} mode=644 -# with_items: -# - "{{ ansible_interfaces }}" -# notify: -## - restart NetworkManager -# - reload NetworkManager-connections -# - apply interface-changes -# when: (virthost is not defined) and (not item.startswith('tun','virbr')) and (hostvars[inventory_hostname]['ansible_' + item]['type'] == 'ether') and (ansible_distribution_major_version|int >=7) and hostvars[inventory_hostname]['ansible_' + item]['active'] -# tags: -# - config -# - ifcfg -# - base +- name: disable resolv.conf control from NM + ini_file: dest=/etc/NetworkManager/NetworkManager.conf section=main option=dns value=none + notify: + - restart NetworkManager + when: ansible_distribution_major_version|int >=7 + tags: + - config + - resolvconf + - base + +- name: get interface uuid + shell: nmcli -f "DEVICE,UUID" c show --active | grep -E '^eth|^br' + register: if_uuid + changed_when: false + failed_when: 'if_uuid.stdout == ""' + always_run: yes + when: ansible_distribution_major_version|int >=7 + tags: + - config + - ifcfg + - base + +- name: copy ifcfg files - non virthost + template: src=ifcfg.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{item}} mode=644 + with_items: + - "{{ ansible_interfaces }}" + notify: +# - restart NetworkManager + - reload NetworkManager-connections + - apply interface-changes + when: (virthost is not defined) and (not item.startswith('tun') or not item.startswith('virbr') and (hostvars[inventory_hostname]['ansible_' + item]['type'] == 'ether') and (ansible_distribution_major_version|int >=7) and hostvars[inventory_hostname]['ansible_' + item]['active'] + tags: + - config + - ifcfg + - base - name: global default packages to install (yum) yum: state=present name={{ item }} |
