Skip to content

Commit 3538bb2

Browse files
committed
add lingering for build process
1 parent 4eb3597 commit 3538bb2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

olam/provision_builder.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@
7474
mode: '0644'
7575
when: ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '9'
7676

77+
- name: Check if user is lingering
78+
ansible.builtin.stat:
79+
path: "/var/lib/systemd/linger/{{ username }}"
80+
register: user_lingering
81+
82+
- name: Enable lingering is needed
83+
ansible.builtin.command: "loginctl enable-linger {{ username }}"
84+
register: linger_result
85+
changed_when: linger_result.rc == 0
86+
when: not user_lingering.stat.exists
87+
7788
- name: Install Oracle Linux Automation Manager Builder Utility
7889
ansible.builtin.dnf:
7990
name:

0 commit comments

Comments
 (0)