---
# tasks file for ansible-role-fgci-login
#
- name: install EPEL
  yum: name=epel-release state=present

- name: install software that do not need extra configuration
  yum: name={{ item }} state=present
  with_items: "{{ unconfigured_packages | default({}) }}"

- name: install IB software that do not need extra configuration - on nodes with ib interfaces
  yum: name={{ item }} state=present
  with_items: "{{ ib_unconfigured_packages | default({}) }}"
  when: infiniband_on_login_node

- name: remove software 
  yum: "name={{ item }} state=absent"
  with_items: "{{ remove_packages | default({}) }}"


## Set Login as the internal network gateway on DHCP server ##

- name: setting Login as Internal network gateway
  lineinfile: backup=yes dest=/etc/dhcp/dhcpd.conf regexp="  option routers 10.1.1.2;" line="  option routers 10.1.1.4;"
  when: chgIntGW is defined
  delegate_to: install

- name: restart dhcpd
  service: name=dhcpd state=restarted
  delegate_to: install

---
# tasks file for ansible-role-fgci-login
#
- name: install EPEL
  yum: name=epel-release state=present

- name: install software that do not need extra configuration
  yum: name={{ item }} state=present
  with_items: "{{ unconfigured_packages | default({}) }}"

- name: install IB software that do not need extra configuration - on nodes with ib interfaces
  yum: name={{ item }} state=present
  with_items: "{{ ib_unconfigured_packages | default({}) }}"
  when: infiniband_on_login_node

- name: remove software 
  yum: "name={{ item }} state=absent"
  with_items: "{{ remove_packages | default({}) }}"


## Set Login as the internal network gateway on DHCP server ##

- name: setting Login as Internal network gateway
  lineinfile: backup=yes dest=/etc/dhcp/dhcpd.conf regexp="  option routers {{ kickstart_server_ip }};" line="  option routers {{ int_gateway }};"
  when: chgIntGW is defined and chgIntGW == True
  delegate_to: install

- name: restart dhcpd
  service: name=dhcpd state=restarted
  delegate_to: install

Use variables to define the IP of the routers
Use variables to define the IP of the routers

for issue #1:

 - 10.1.1.2: install node
 - 10.1.1.4: login node
