Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging in CI #1868

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion molecule/default/tasks/awx_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- name: Validate DEFAULT_AWX_VERSION
block:
- name: Extract tags from images from web pod

Check warning on line 32 in molecule/default/tasks/awx_test.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

32:7 [indentation] wrong indentation: expected 8 but found 6

Check warning on line 32 in molecule/default/tasks/awx_test.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

32:7 [indentation] wrong indentation: expected 8 but found 6
set_fact:
web_image_tags: |
{{ awx_web_pod.resources[0].spec.containers |
Expand All @@ -52,7 +52,7 @@

- name: Validate additional_labels
block:
- name: Extract additional_labels from AWX spec

Check warning on line 55 in molecule/default/tasks/awx_test.yml

View workflow job for this annotation

GitHub Actions / molecule (--skip-tags=replicas)

55:7 [indentation] wrong indentation: expected 8 but found 6

Check warning on line 55 in molecule/default/tasks/awx_test.yml

View workflow job for this annotation

GitHub Actions / molecule (-t replicas)

55:7 [indentation] wrong indentation: expected 8 but found 6
set_fact:
awx_additional_labels: >-
{{ this_awx.resources[0].metadata.labels
Expand Down Expand Up @@ -139,6 +139,11 @@
controller_password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"

rescue:
- name: Create debug output directory
ansible.builtin.file:
path: '{{ debug_output_dir }}'
state: directory

- name: Get list of project updates and jobs
uri:
url: "http://localhost/awx/api/v2/{{ resource }}/"
Expand All @@ -158,7 +163,7 @@
dest: "{{ debug_output_dir }}/job_lists.json"
when: store_debug_output | default(false)

- name: Get all job and project details
- name: Get all job and project_update details
uri:
url: "http://localhost{{ endpoint }}"
user: admin
Expand All @@ -176,6 +181,38 @@
dest: "{{ debug_output_dir }}/job_details.json"
when: store_debug_output | default(false)

- name: Get list of instances
uri:
url: "http://localhost/awx/api/v2/instances/"
user: admin
password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"
force_basic_auth: yes
register: instances_list

- name: Store instances_list debug output
copy:
content: "{{ instances_list | to_nice_json }}"
dest: "{{ debug_output_dir }}/instances_list.json"
when: store_debug_output | default(false)

- name: Get instances detail
uri:
url: "http://localhost{{ item }}"
user: admin
password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"
force_basic_auth: yes
loop: |
{{ instances_list.json.results | map(attribute='url') }}
loop_control:
loop_var: item
register: instances_details

- name: Store instances_details debug output
copy:
content: "{{ instances_details | to_nice_json }}"
dest: "{{ debug_output_dir }}/instances_details.json"
when: store_debug_output | default(false)

## TODO: figure out why this doesn't work
# - name: Store debug outputs
# copy:
Expand Down
3 changes: 3 additions & 0 deletions molecule/default/templates/awx_cr_molecule.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ spec:
additional_labels:
- my/team
- my/service
extra_settings:
- setting: LOG_AGGREGATOR_LEVEL
value: "'DEBUG'"
{% if additional_fields is defined %}
{{ additional_fields | to_nice_yaml | indent(2) }}
{% endif %}
Loading