我有一个剧本,它配置了静态 IP 地址并重新启动服务器。但是,剧本导致错误。甚至以下代码似乎也不起作用
- name: Creating Interface Configuration using JINJA2 Temlate
template:
src: templates/interface_config.jinja2
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ nat_int }}"
- name: Reboot Server
become: yes
reboot:
reboot_timeout: 180
## Setting Fact for New IP Address
- name: Setting Fact for New IP Address
set_fact:
ansible_host: "192.168.1.253"