blob: cda8982571c16ea441168cec09cc9d504da59e9e [file] [log] [blame]
---
# ds389 tasks/main.yml
#
# SPDX-FileCopyrightText: © 2021 Open Networking Foundation <support@opennetworking.org>
# SPDX-License-Identifier: Apache-2.0
- name: include OS-specific tasks
include_tasks: "{{ ansible_os_family }}.yml"
- name: Create a directory if it does not exist
file:
path: "{{ ds389_config_dir }}"
state: directory
mode: '0700'
- name: Create configuration file for 389DS service
template:
src: "{{ item }}.j2"
dest: "{{ ds389_config_dir }}/{{ item }}"
owner: "root"
group: "root"
mode: "0400"
with_items:
- "instance.inf"
- name: Get current instance status
command:
cmd: dsctl {{ ds389_instance_name }} status
register: dsctl_result
changed_when: false
failed_when: false
- name: Run dscreate to init instance
command:
cmd: "dscreate from-file {{ ds389_config_dir }}/instance.inf"
when: dsctl_result.rc != 0