- hosts: "{{ variable_host | default(lab15_standard) }}" gather_facts: no become: yes tasks: - name: Create folder /etc/systemd/system/systemd-logind.service.d/ file: path: /etc/systemd/system/systemd-logind.service.d/ state: directory - name: Create file /etc/systemd/system/systemd-logind.service.d/override.conf copy: dest: /etc/systemd/system/systemd-logind.service.d/override.conf content: | [Service] RestrictAddressFamilies=AF_INET IPAddressAllow=156.17.9.28 # i deb conf