Ansible roles by Evolix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
507 B

- name: search profile for presence of evomaintenance
command: 'grep -q "trap.*sudo.*"'
changed_when: False
failed_when: False
register: grep_profile_evomaintenance
# Don't add the trap if it is present or commented
- name: "Add evomaintenance trap for '{{ }}'"
state: present
dest: '/home/{{ }}/.profile'
insertafter: EOF
line: 'trap "sudo /usr/share/scripts/" 0'
when: grep_profile_evomaintenance.rc != 0