Qian
0
Q:

ansible set hostname from facts

- name: Set proper hostname
  hostname:
    #name: hostvars[inventory_hostname].ansible_host
    name: "{{ hostvars[inventory_hostname].ansible_host }}"
  become: yes
  when:
    - ansible_facts['os_family'] == 'Suse'
0

New to Communities?

Join the community