elastic / ansible-elastic-cloud-enterprise

Ansible playbooks for Elastic Cloud Enterprise (ECE)
https://www.elastic.co/products/ece
Other
60 stars 61 forks source link

Always assumes that network interface is called eth0 #60

Open xucito opened 4 years ago

xucito commented 4 years ago

The playbook always assumes that the network interface is eth0.

in main.yml

- name: ensure dhcp dns is set
  lineinfile:
    path: /etc/sysconfig/network-scripts/ifcfg-eth0
    line: "{{ item }}"
  with_items:
    - 'PeerDNS=yes'
    - 'NM_CONTROLLED=yes'

My suggestion is to allow this to be passed via variable.

vaubarth commented 4 years ago

Agreed, it should be configurable.

alexsuppanz commented 4 years ago

Hi my suggestion is to completly remove this task from the playboo, because even if we correct the path, I think it is not necessary to set these options, because if PeerDNS is not set, it defaults to yes, the same as with NM_CONTROLLED, which also defaults to yes.

Or, we make the interface name configurable via ansible variables (and should default to ens192) we should also add this to at least the RedHat-7 installation tasks as well.

I can submit an PR when we agree on one of the options

obierlaire commented 3 years ago

I just checked on Centos7 (this task only runs for Centos 7) and NM_CONTROLLED is set to no and PeerDNS is not set. Maybe we can use a variable here (with eth0 as default), or we set those parameters for all eth* interfaces. @vaubarth any preference?