playbook shell

shell

- name: set hosts
  shell: hostnamectl set-hostname {{ hostsname }}; ip=$(ifconfig | awk  '/netmask 255.255./{print $2}'); echo $ip $(hostname) >> /etc/hosts
  ignore_errors: yes
posted @ 2021-09-10 17:38  Star-Hitian  阅读(49)  评论(0)    收藏  举报