📜  当主机名 ansible - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:27.831000             🧑  作者: Mango

代码示例2
- 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'