Merge "Move openstack collection into artcl_commands"

This commit is contained in:
Zuul 2020-05-04 11:02:11 +00:00 committed by Gerrit Code Review
commit 30016d8494
4 changed files with 23 additions and 24 deletions

View File

@ -97,6 +97,7 @@ File Collection
key2:
cmd: touch /foo.txt
capture_disable: true # <-- disable implicit std redirection
when: "1 > 2" # <-- optional condition
Documentation generation related
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -298,7 +298,26 @@ artcl_commands:
echo "\nOutput of ovn-sbctl lflow-list"
sbctl lflow-list
fi
openstack: {}
openstack:
baremetal_list:
cmd: |
if [[ -e {{ working_dir }}/stackrc ]]; then
source {{ working_dir }}/stackrc
openstack baremetal node list
fi
nova_list:
cmd: |
if [[ -e {{ working_dir }}/stackrc ]]; then
source {{ working_dir }}/stackrc
openstack server list
fi
openstack-status:
cmd: |
if type openstack-status &> /dev/null; then
. ~/keystonerc_admin
openstack-status
fi
when: "'controller' in inventory_hostname"
container: {}
# Doc generation specific vars

View File

@ -29,6 +29,7 @@
- name: Run artcl_commands
# noqa 305
# noqa 102 :: No Jinja2 in when
vars:
capture_file: "{{ item.capture_file | default( item.name + '.txt') }}"
shell:
@ -42,6 +43,7 @@
warn: false
executable: bash
changed_when: false
when: "{{ item.when | default(true) }}"
loop: "{{ artcl_commands_flatten.data }}"
loop_control:
label: "{{ item.name }}"
@ -60,9 +62,6 @@
- import_tasks: collect/monitoring.yml
when: "'monitoring' in collect_log_types"
- import_tasks: collect/openstack.yml
when: "'openstack' in collect_log_types"
- name: Set default collect list
set_fact:
collect_list: "{{ artcl_collect_list }} + {{ artcl_collect_list_append|default([]) }}"

View File

@ -1,20 +0,0 @@
---
- become: true
ignore_errors: true
block:
- name: openstack-status
shell: "which openstack-status &> /dev/null && (. ~/keystonerc_admin; openstack-status &> /var/log/extra/openstack-status.txt)"
when: "'controller' in inventory_hostname"
- name: List nova servers on undercloud
shell: >
if [[ -e {{ working_dir }}/stackrc ]]; then
source {{ working_dir }}/stackrc;
openstack server list &> /var/log/extra/nova_list.txt;
fi
- name: List ironic servers on undercloud
shell: >
if [[ -e {{ working_dir }}/stackrc ]]; then
source {{ working_dir }}/stackrc;
openstack baremetal node list &> /var/log/extra/baremetal_list.txt;
fi