Skip to content

Commit 492f12e

Browse files
committed
oraswdb_install: refactoring include for systemd
1 parent 02c1033 commit 492f12e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

roles/oraswdb_install/tasks/systemd.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
# Configure systemd only for Single-Instance without GI/Restart
3+
# We need a minimum of 1 entry in db_homes_installed with state=present
34
- name: install_home_db | Configure oracle-rdbms auto-startup service (systemd.d)
45
ansible.builtin.template:
56
src: oracle-rdbms-service.j2
@@ -10,12 +11,17 @@
1011
become_user: root
1112
notify:
1213
- systemd register and reload
13-
with_items: "{{ db_homes_installed }}"
14+
with_items:
15+
- "{{ db_homes_installed | selectattr('state', 'equalto', 'present') | list | first | default([]) }}"
16+
loop_control:
17+
label: >-
18+
{{ item.home | default('') }}
19+
state: {{ item.state | default('') }}
1420
when:
1521
- autostartup_service
1622
- oracle_install_option_gi | default('') | length == 0
23+
- db_homes_installed | length > 0
1724
- hostinitdaemon == "systemd"
18-
- item.state | lower == 'present'
1925
tags:
2026
- autostartup_service
2127
- seclimit # Update template when ulimits have been chagned as well.

0 commit comments

Comments
 (0)