---
# Redhat/CentOS for consul
- name: Install the repo
  template:
      src: consul.repo
      dest: /etc/yum.repos.d/consul.repo
      owner: root
      group: root
      mode: 0644

- name: Install Consul
  yum:
      name: consul
      state: present

- name: Install Consul UI
  yum:
      name: consul-ui
      state: present
  when: consul_is_ui == True

- name: Configure DNS to point to the local agent
  nmcli:
      conn_name: consul-dns
      type: ethernet
      dns4:
          - 127.0.0.1
          - 10.235.0.2
      state: present
  ignore_errors: True

- name: Install python-consul system wide
  pip:
      name: python-consul
      state: present

- name: Delete the default Nginx Config
  file:
      name: /etc/nginx/conf.d/default
      state: absent
  notify: restart nginx

---
# Redhat/CentOS for consul
- name: Install the repo
  template:
      src: consul.repo
      dest: /etc/yum.repos.d/consul.repo
      owner: root
      group: root
      mode: 0644

- name: Install Consul
  yum:
      name: consul
      state: present

- name: Install Consul UI
  yum:
      name: consul-ui
      state: present
  when: consul_is_ui == True

- name: Configure DNS to point to the local agent
  nmcli:
      conn_name: consul-eth0
      type: ethernet
      dns4:
          - 127.0.0.1
          - 10.235.0.2
      state: present
  ignore_errors: True

- name: Install python-consul system wide
  pip:
      name: python-consul
      state: present

- name: Delete the default Nginx Config
  file:
      name: /etc/nginx/conf.d/default
      state: absent
  notify: restart nginx

Rename mncli command to use a more logical connection name
Rename mncli command to use a more logical connection name
