Eric Lavarde
2018-08-28 9e777758072a0293e82cc771dbf72c6118d0c104
Allow usage of ansible_host, ansible_ssh_host or inventory_hostname in this order.
1 files modified
4 ■■■■ changed files
ansible/configs/ansible-cicd-lab/create_host.yml 4 ●●●● patch | view | raw | blame | history
ansible/configs/ansible-cicd-lab/create_host.yml
@@ -2,7 +2,7 @@
- name: Set Hostname
  set_fact:
    lab_host_hostname: "{{ hostvars[lab_host]['ansible_host'] }}"
    lab_host_hostname: "{{ hostvars[lab_host]['ansible_host'] | default(hostvars[lab_host]['ansible_ssh_host']) | default(hostvars[lab_host]['inventory_hostname']) }}"
- name: Determine if Host Exists
  uri:
@@ -31,4 +31,4 @@
    - 201
  register: response
  changed_when: response.status == 201
  when: response.json.count == 0
  when: response.json.count == 0