Commit 9f8a60e1 authored by Дмитрий Сафронов's avatar Дмитрий Сафронов
Browse files

Fix

parent 0021ad02
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
---

- name: Install python3
  hosts: ipacluster
- hosts: ipacluster
  become: yes
  tasks:
    - name: Bootstrap a host without python3 installed
@@ -13,7 +12,13 @@
  roles:
    - hostname

- name: Build hosts file
  lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
- hosts: hostname:&ipacluster
  tasks:
    - name: Populate /etc/hosts
      lineinfile:
        dest: /etc/hosts
        regexp: '.*{{ item }}$'
        line: "{{ hostvars[item].ansible_default_ipv4.address }} {{item}}"
        state: present
      when: hostvars[item].ansible_default_ipv4.address is defined
      with_items: groups['ipaserver','ipareplicas']