2016-11-07 14:00:57 +01:00
|
|
|
- name: is {{ home }}/.bash_profile present?
|
|
|
|
stat:
|
|
|
|
path: "{{ home }}/.bash_profile"
|
2017-01-31 11:45:35 +01:00
|
|
|
#check_mode: no (for migration to Ansible 2.2)
|
|
|
|
always_run: yes
|
2016-11-07 14:00:57 +01:00
|
|
|
register: bash_profile
|
|
|
|
|
|
|
|
- name: install shell trap in {{ home }}/.bash_profile
|
|
|
|
lineinfile:
|
|
|
|
dest: "{{ home }}/.bash_profile"
|
2016-12-19 14:19:35 +01:00
|
|
|
line: "trap \"sudo /usr/share/scripts/evomaintenance.sh\" 0"
|
2016-11-07 14:00:57 +01:00
|
|
|
insertafter: EOF
|
|
|
|
create: no
|
|
|
|
when: bash_profile.stat.exists
|
|
|
|
|
|
|
|
- name: is {{ home }}/.profile present?
|
|
|
|
stat:
|
|
|
|
path: "{{ home }}/.profile"
|
2017-01-31 11:45:35 +01:00
|
|
|
#check_mode: no (for migration to Ansible 2.2)
|
|
|
|
always_run: yes
|
2016-11-07 14:00:57 +01:00
|
|
|
register: profile
|
|
|
|
when: not bash_profile.stat.exists
|
|
|
|
|
|
|
|
- name: install shell trap in {{ home }}/.profile
|
|
|
|
lineinfile:
|
|
|
|
dest: "{{ home }}/.profile"
|
2016-12-19 14:19:35 +01:00
|
|
|
line: "trap \"sudo /usr/share/scripts/evomaintenance.sh\" 0"
|
2016-11-07 14:00:57 +01:00
|
|
|
insertafter: EOF
|
|
|
|
create: yes
|
|
|
|
when: not bash_profile.stat.exists
|