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

Gather more Assisted logs #252

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
2 changes: 2 additions & 0 deletions roles/generate_manifests/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ single_node_openshift_enabled: "{{ is_valid_single_node_openshift_config | defau
manifests: true
extra_manifests: []
manifest_templates: "{{ extra_manifests }}"

fetched_dest: "{{ repo_root_path }}/fetched"
11 changes: 11 additions & 0 deletions roles/generate_manifests/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Render nmstate

Check failure on line 1 in roles/generate_manifests/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint

syntax-check this task 'ansible.builtin.include_tasks' has extra params, which is only allowed in the following modules: include_role, raw, import_role, meta, shell, add_host, group_by, script, command, import_tasks, set_fact, include_vars, win_command, include_tasks, win_shell, include

Check failure on line 1 in roles/generate_manifests/tasks/main.yml

View workflow job for this annotation

GitHub Actions / lint

syntax-check this task 'ansible.builtin.include_tasks' has extra params, which is only allowed in the following modules: set_fact, include_role, meta, include_tasks, script, import_role, group_by, include_vars, win_shell, shell, win_command, raw, add_host, import_tasks, command, include
ansible.builtin.include_tasks: static.yml
loop: "{{ groups['nodes'] }}"

Expand Down Expand Up @@ -38,6 +38,17 @@
- agent-config.yaml.j2
- install-config.yaml.j2

# The agent-config files are eventually deleted after its usage, just
# save them in a safe place in case of needing to check them
- name: Save a backup of agent-config files
fetch:
src: "{{ manifests_dir }}/{{ item }}"
dest: "{{ fetched_dest }}/{{ item }}"
flat: true
loop:
- agent-config.yaml
- install-config.yaml

- name: Create extra_manifest_dir dir
ansible.builtin.file:
name: "{{ extra_manifest_dir }}"
Expand Down
3 changes: 3 additions & 0 deletions roles/monitor_agent_based_installer/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
generated_dir: "{{ repo_root_path }}/generated"
manifests_dir: "{{ generated_dir}}/{{ cluster_name }}"

agent_based_installer_bootstrap_node: "{{ groups['masters'][0] }}"
host_ip_keyword: ansible_host
30 changes: 26 additions & 4 deletions roles/monitor_agent_based_installer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,29 @@
chdir: "{{ manifests_dir }}"
ignore_errors: True # Timeout is fixed and some bare metal clusters complete bootstrap just after the timeout

- name: Wait for install complete
ansible.builtin.shell:
cmd: "{{ agent_based_installer_path }} --log-level=debug agent wait-for install-complete"
chdir: "{{ manifests_dir }}"
- name: Check installation and gather jobs if it fails
block:
- name: Wait for install complete
ansible.builtin.shell:
cmd: "{{ agent_based_installer_path }} --log-level=debug agent wait-for install-complete"
chdir: "{{ manifests_dir }}"

rescue:
# Using master-0 IP address to reach the bootstrap VM
# Placing the logs in repo_root_path
# Trying several times in case there are SSH connectivity issues
- name: Gather logs from installation
vars:
rendezvous_ip_address: "{{ hostvars[agent_based_installer_bootstrap_node][host_ip_keyword] }}"
ansible.builtin.shell:
cmd: "{{ agent_based_installer_path }} --log-level=debug gather bootstrap --bootstrap {{ rendezvous_ip_address }}"
chdir: "{{ repo_root_path }}"
register: command_result
until: command_result.rc == 0
retries: 6
delay: 20
ignore_errors: True

- name: Fail properly because installation was not completed
fail:
msg: "Installation was not completed"
Loading