Answers for "when hostname ansible"

0

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'
Posted by: Guest on June-08-2020
0

when hostname ansible

# Use Special Variable inventory_hostname
when: inventory_hostname == 'your_inventory_name'
Posted by: Guest on August-25-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language