Add SDK logging option for openstack ansible collections.

The solution is based on implementation of logging option
in Open Telekom Cloud collections.

Change-Id: Ie8b309d2aaa8da57794888848fc5414de207e54f
(cherry picked from commit 19cd6262cf)
This commit is contained in:
Vladimir Hasko
2022-06-03 08:09:08 +00:00
committed by Jakob Meng
parent e8bba38e2e
commit c435002734
5 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1 @@
sdk_log_file_path: "{{ playbook_dir }}/sdk.log"

View File

@@ -0,0 +1,20 @@
---
- name: Trigger flavor listing
openstack.cloud.compute_flavor_info:
cloud: "{{ cloud }}"
sdk_log_path: "{{ sdk_log_file_path }}"
sdk_log_level: "DEBUG"
- name: Check log file presence
ansible.builtin.stat:
path: "{{ sdk_log_file_path }}"
register: sdk_log_file
- name: Assert
ansible.builtin.assert:
that:
- "sdk_log_file.stat.exists"
- name: Debug log file content
ansible.builtin.debug:
msg: "{{ lookup('ansible.builtin.file', sdk_log_file_path) }}"

View File

@@ -38,6 +38,7 @@
- role: keystone_federation_protocol
tags: keystone_federation_protocol
when: sdk_version is version(0.44, '>=')
- { role: logging, tags: logging }
- { role: network, tags: network }
- role: neutron_rbac
tags: