Merge "Fix ldap dir on ansible playbook for backup roles"

This commit is contained in:
Zuul 2022-07-12 17:27:11 +00:00 committed by Gerrit Code Review
commit 12e5a6f858
4 changed files with 22 additions and 13 deletions

View File

@ -326,8 +326,13 @@
set_fact:
ldap_db_backup: "{{ ldap_dir.path }}/ldap.db"
- name: Backup ldap db
- name: Backup LDAP DB on CentOS
command: "slapcat -d 0 -F /etc/openldap/schema -l {{ ldap_db_backup }}"
when: os_release == "centos"
- name: Backup LDAP DB on Debian
command: "slapcat -d 0 -F /etc/ldap/schema -l {{ ldap_db_backup }}"
when: os_release == "debian"
- block:
- name: Create ceph temp dir

View File

@ -9,17 +9,6 @@
# the next step.
#
# Check for Host OS release
- name: Gather Host OS release
raw: "grep '^NAME=' /etc/os-release | sed s'/NAME=//'"
register: distro
changed_when: false
- name: Set OS Release to Debian
set_fact:
os_release: "debian"
when: "'Debian' in distro.stdout"
- name: Set package lookup command
set_fact:
pkg_lookup_cmd: "{{ 'rpm -q' if os_release == 'centos' else 'dpkg -l' }}"

View File

@ -7,7 +7,6 @@ standard_root_disk_size: 500
temp_ssl_ca_dir: "/tmp"
temp_ssl_ca_file: "ca-cert.pem"
temp_k8s_plugins_dir: "/tmp"
os_release: "centos"
# KUBERNETES PARAMETERS
# =====================

View File

@ -8,6 +8,22 @@
# This role is to perform tasks that are common to the playbooks.
#
# Check for Host OS release
- name: Gather Host OS release
raw: "grep '^NAME=' /etc/os-release | sed s'/NAME=//'"
register: distro
changed_when: false
- name: Set OS Release to Debian
set_fact:
os_release: "debian"
when: "'Debian' in distro.stdout"
- name: Set OS Release to Centos
set_fact:
os_release: "centos"
when: "'Debian' not in distro.stdout"
# Include user override files for a play
- stat:
path: "{{ item }}"