ansible-roles/evomaintenance/tasks/trap.yml
Jérémy Lecour ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2777|524|2253|2462|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Use FQCN
Fully Qualified Collection Name
2023-03-20 23:33:19 +01:00

37 lines
944 B
YAML

- name: is {{ home }}/.bash_profile present?
ansible.builtin.stat:
path: "{{ home }}/.bash_profile"
check_mode: no
register: bash_profile
tags:
- evomaintenance
- name: install shell trap in {{ home }}/.bash_profile
ansible.builtin.lineinfile:
dest: "{{ home }}/.bash_profile"
line: "trap \"sudo /usr/share/scripts/evomaintenance.sh\" 0"
insertafter: EOF
create: no
when: bash_profile.stat.exists
tags:
- evomaintenance
- name: is {{ home }}/.profile present?
ansible.builtin.stat:
path: "{{ home }}/.profile"
check_mode: no
register: profile
when: not bash_profile.stat.exists
tags:
- evomaintenance
- name: install shell trap in {{ home }}/.profile
ansible.builtin.lineinfile:
dest: "{{ home }}/.profile"
line: "trap \"sudo /usr/share/scripts/evomaintenance.sh\" 0"
insertafter: EOF
create: yes
when: not bash_profile.stat.exists
tags:
- evomaintenance