- name: setup system gather_facts: no hosts: "{{target}}" become: "{{become_var}}" tasks: - name: enable daemons at boot-time ansible.builtin.copy: content: | #!/bin/bash # CONFIGURED BY ANSIBLE [[ $1 = stop ]] && exit 0 PATH=/usr/local/bin:/usr/local/sbin:$PATH echo rc.inet2 fixed PATH is $PATH # self-verbose /etc/rc.d/rc.sshd start {% if storage == 'zfs' %} echo -n loading zfs ... modprobe zfs && echo done echo -n loading smith pool ... zpool import smith -N && echo done echo found zvols: find /dev/zvol/ -mindepth 2 | grep '\-part' {% endif %} # self-verbose /etc/rc.d/rc.libvirt start dest: /etc/rc.d/rc.inet2 mode: "0755" - name: console goes ttyS0 lineinfile: path: /etc/inittab regexp: '^s1:' line: 's1:12345:respawn:/sbin/agetty --noclear --local-line ttyS0 115200 linux'