ansible/test/integration/targets/service_facts/tasks/systemd_setup.yml
Abhijeet Kasurde 723a904f4e
Handle disabled service units (#69349)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-01 09:40:52 -04:00

26 lines
770 B
YAML

- name: install the test daemon script
copy:
src: ansible_test_service.py
dest: /usr/sbin/ansible_test_service
mode: '755'
- name: rewrite shebang in the test daemon script
lineinfile:
path: /usr/sbin/ansible_test_service
line: "#!{{ ansible_python_interpreter | realpath }}"
insertbefore: BOF
firstmatch: yes
- name: install the systemd unit file
copy:
src: ansible.systemd
dest: /etc/systemd/system/ansible_test.service
mode: '0644'
register: install_systemd_result
- name: assert that the systemd unit file was installed
assert:
that:
- "install_systemd_result.dest == '/etc/systemd/system/ansible_test.service'"
- "install_systemd_result.state == 'file'"
- "install_systemd_result.mode == '0644'"