--- # The image installs none of the services the role touches, so the units it acts on are # stubs in /usr/lib/systemd/system (not /etc: `systemctl mask` refuses to replace a regular # file there). Nothing is started. rpcbind is enabled so the role has something to # disable; telnet only needs to exist; testsvc receives the drop-in. - name: Prepare hosts: all gather_facts: false tasks: - name: Install the stub unit files ansible.builtin.copy: dest: "/usr/lib/systemd/system/{{ item }}.service" content: | [Unit] Description=molecule stub for {{ item }} [Service] ExecStart=/bin/sleep 3600 [Install] WantedBy=multi-user.target owner: root group: root mode: "0644" loop: [rpcbind, telnet, testsvc] - name: Enable rpcbind and reload systemd ansible.builtin.systemd: name: rpcbind enabled: true daemon_reload: true