summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/service_facts/tasks/systemd_setup.yml
blob: 85eeed0c7d275a636fc4e47346c024edd4408bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
- 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'"