Re-add ansible network setup and split out virbr case.

This commit is contained in:
Kevin Fenzi 2016-02-05 17:59:23 +00:00
parent 5ecc096a05
commit ec285b1708

View file

@ -19,41 +19,41 @@
- resolvconf - resolvconf
- base - base
#- name: disable resolv.conf control from NM - name: disable resolv.conf control from NM
# ini_file: dest=/etc/NetworkManager/NetworkManager.conf section=main option=dns value=none ini_file: dest=/etc/NetworkManager/NetworkManager.conf section=main option=dns value=none
# notify: notify:
# - restart NetworkManager - restart NetworkManager
# when: ansible_distribution_major_version|int >=7 when: ansible_distribution_major_version|int >=7
# tags: tags:
# - config - config
# - resolvconf - resolvconf
# - base - base
#
#- name: get interface uuid - name: get interface uuid
# shell: nmcli -f "DEVICE,UUID" c show --active | grep -E '^eth|^br' shell: nmcli -f "DEVICE,UUID" c show --active | grep -E '^eth|^br'
# register: if_uuid register: if_uuid
# changed_when: false changed_when: false
# failed_when: 'if_uuid.stdout == ""' failed_when: 'if_uuid.stdout == ""'
# always_run: yes always_run: yes
# when: ansible_distribution_major_version|int >=7 when: ansible_distribution_major_version|int >=7
# tags: tags:
# - config - config
# - ifcfg - ifcfg
# - base - base
#
#- name: copy ifcfg files - non virthost - name: copy ifcfg files - non virthost
# template: src=ifcfg.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{item}} mode=644 template: src=ifcfg.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{item}} mode=644
# with_items: with_items:
# - "{{ ansible_interfaces }}" - "{{ ansible_interfaces }}"
# notify: notify:
## - restart NetworkManager # - restart NetworkManager
# - reload NetworkManager-connections - reload NetworkManager-connections
# - apply interface-changes - 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'] 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: tags:
# - config - config
# - ifcfg - ifcfg
# - base - base
- name: global default packages to install (yum) - name: global default packages to install (yum)
yum: state=present name={{ item }} yum: state=present name={{ item }}