- name: setup network gather_facts: no hosts: "{{target}}" become: "{{become_var}}" tasks: - name: rc.inet1 ansible.builtin.copy: content: | #!/bin/bash # CONFIGURED BY ANSIBLE [[ $1 = stop ]] && exit 0 echo rc.inet1 PATH is $PATH ifconfig lo up brctl addbr kvmbr0 brctl addif kvmbr0 eth0 ifconfig kvmbr0 {{cidr}} up ifconfig eth0 up route add default gw {{gw}} # virbr0 already there with casual kvm ip dest: /etc/rc.d/rc.inet1 mode: "0755"