Debian Codegraph @

test/integration/targets/service/tasks/rc_setup.yml

raw
1 - name: install the rc init file
2 copy: src=ansible.rc dest=/etc/rc.d/ansible_test mode=0755
3 register: install_rc_result
4
5 - name: assert that the rc init file was installed
6 assert:
7 that:
8 - "install_rc_result.dest == '/etc/rc.d/ansible_test'"
9 - "install_rc_result.state == 'file'"
10 - "install_rc_result.mode == '0755'"
11 - "install_rc_result.checksum == '8526e4571d2ac685fa5a73af723183c194bda35d'"
12
13 # FreeBSD (likely others as well) requires the command_interpreter to match the
14 # shebang the script was started with as an extra caution against killing the
15 # wrong thing. We add the line here.
16 - name: add command_interpreter in rc init file
17 lineinfile:
18 path: /etc/rc.d/ansible_test
19 line: "command_interpreter={{ ansible_python_interpreter | realpath }}"
20 insertafter: '^pidfile.*'
21 firstmatch: yes