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

Fix tests after password encryption #466

Merged
merged 50 commits into from
Oct 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2b177fe
Remove some old TODOs
cbaxley Oct 10, 2024
3b8db23
Don't remove the Azure resources at the end of the Linux only tests
cbaxley Oct 10, 2024
bcf92c5
Change the variables to work with the 2.0 pipeline
cbaxley Oct 11, 2024
df108a1
Run the cluster run workflow to debug the tests
cbaxley Oct 11, 2024
0e3b95d
Run ansible playbook to set fleet
cbaxley Oct 11, 2024
f9e986c
Log secrets in set_fleet.yml
cbaxley Oct 11, 2024
adf8557
Debug setting the environment variables in set_fleet.yml
cbaxley Oct 11, 2024
084b027
Set the debug mode in set_fleet.yml
cbaxley Oct 11, 2024
f526d9e
Log the Fleet API call details in set_fleet.yml
cbaxley Oct 11, 2024
a6d791c
Loop through Fleet API calls in set_fleet.yml
cbaxley Oct 11, 2024
e5c37d5
Change the Fleet API call to loop through attempts in set_fleet.yml
cbaxley Oct 11, 2024
754cf6c
Try to set the Fleet API with retries in set_fleet.yml
cbaxley Oct 11, 2024
a196563
Attempt to output the Fleet API call details in set_fleet.yml
cbaxley Oct 11, 2024
22ad2c1
A new way to handle the Fleet API call in set_fleet.yml
cbaxley Oct 11, 2024
de554ec
Export the check_fleet_api.yml file in set_fleet.yml
cbaxley Oct 11, 2024
832920d
Make sure the password is in the check_fleet_api.yml file
cbaxley Oct 11, 2024
0089796
Exit the loop if the Fleet API call succeeds in check_fleet_api.yml
cbaxley Oct 11, 2024
a6630e8
Wait a little longer for the results to be written to the index
cbaxley Oct 15, 2024
077cdfa
Update the cluster.yml workflow to wait a little longer for the resul…
cbaxley Oct 15, 2024
ac39458
Delay in a different way
cbaxley Oct 15, 2024
ff25324
Attempt a different looping method
cbaxley Oct 15, 2024
877e268
Remove the set-fleet script from the installer
cbaxley Oct 15, 2024
2fefce6
Reverts to old loop method
cbaxley Oct 15, 2024
d6fc98f
Check that fleet is ready in an external script
cbaxley Oct 15, 2024
f4cbd7a
Call the ansible playbook from the install script
cbaxley Oct 15, 2024
9ec8542
Get the CA fingerprint from the Elasticsearch container
cbaxley Oct 15, 2024
03ac6a9
Adds headers to the curl commands in the set_fleet.yml playbook
cbaxley Oct 15, 2024
5b603b9
Address the hosts and fleet API issues
cbaxley Oct 15, 2024
35e9121
Change the way we login to the Kibana API
cbaxley Oct 16, 2024
519bcf8
Increase the timeout for the Endpoint Policy API calls
cbaxley Oct 16, 2024
c9de1e1
Increase the timeout for the Endpoint Policy API calls
cbaxley Oct 16, 2024
05c5ad0
Increase the timeout for the Defend Policy API calls
cbaxley Oct 16, 2024
50e9cb5
Only print debug information if debug_mode is true
cbaxley Oct 16, 2024
3efbe3e
Keeps the azure resources on builds
cbaxley Oct 16, 2024
d924ea1
Fixing Error with certs where the permissions should only be on first
mreeve-snl Oct 16, 2024
4dd138a
Remove sysctl edits to lower privileged ports and add 443 to kibana c…
mreeve-snl Oct 16, 2024
7eb4e5d
Add notes on starting vms via azure cli to testing v2
mreeve-snl Oct 16, 2024
4a9109e
Fix ansible errors in checking for passwords that are created
mreeve-snl Oct 16, 2024
8bf0477
Add debugging commands, and remove references to 443 for kibana from
mreeve-snl Oct 16, 2024
d06c3f3
Update the cluster.yml file to use the new IP address for the Azure i…
cbaxley Oct 16, 2024
3d2fdef
Only allow the ip address of the host to connect to the azure instance
cbaxley Oct 16, 2024
b9801c6
remove unnecassary script
mreeve-snl Oct 17, 2024
18fb506
Move ansible files to the ansible directory
cbaxley Oct 17, 2024
2ea0568
Moving Upgrade Readme into upgrade directory
mreeve-snl Oct 17, 2024
a75bbb5
Merge branch 'cbaxley-fix-tests-after-password-encryption' of github.…
mreeve-snl Oct 17, 2024
b3610b6
Add upgrading docs and remove dev notes
mreeve-snl Oct 17, 2024
f96cde0
Update main readme docs:
mreeve-snl Oct 17, 2024
e26f0bc
Adding updated cloud docs and firewall explanation
mreeve-snl Oct 17, 2024
a9da11d
Update FAQ and Pre-requisites
mreeve-snl Oct 17, 2024
4e4706c
Merge branch 'release-2.0.0' into cbaxley-fix-tests-after-password-en…
cbaxley Oct 17, 2024
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
Prev Previous commit
Next Next commit
A new way to handle the Fleet API call in set_fleet.yml
cbaxley committed Oct 11, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 22ad2c17eab1dd327671aee4cd37ae2654656913
35 changes: 25 additions & 10 deletions scripts/set_fleet.yml
Original file line number Diff line number Diff line change
@@ -44,6 +44,10 @@

- name: Wait for Fleet API to be ready
block:
- name: Initialize attempt counter
set_fact:
attempt_counter: 1

- name: Attempt Fleet API call
uri:
url: "{{ local_kbn_url }}/api/fleet/settings"
@@ -55,30 +59,41 @@
status_code: 200
return_content: yes
register: fleet_status
retries: "{{ max_retries }}"
delay: "{{ delay_seconds }}"
until: fleet_status.status == 200
ignore_errors: yes

- name: Display Fleet API call details
debug:
msg:
- "Attempt: {{ fleet_status.attempts }}"
- "Attempt: {{ attempt_counter }}"
- "URL: {{ fleet_status.url }}"
- "Status: {{ fleet_status.status | default('N/A') }}"
- "Status Message: {{ fleet_status.msg | default('N/A') }}"
- "Response Headers: {{ fleet_status.headers | default({}) | to_nice_json }}"
- "Response Content: {{ fleet_status.content | default('N/A') | to_nice_json }}"
when: fleet_status is changed
loop: "{{ range(1, fleet_status.attempts|int + 1)|list }}"
loop_control:
label: "Attempt {{ item }}"

- name: Fail if Fleet API is not ready
- name: Increment attempt counter
set_fact:
attempt_counter: "{{ attempt_counter | int + 1 }}"

- name: Check if max retries reached
fail:
msg: "Fleet API is not ready after {{ max_retries }} attempts."
msg: "Max retries reached. Fleet API is not ready."
when: attempt_counter | int > max_retries

- name: Wait before next attempt
wait_for:
timeout: "{{ delay_seconds }}"
when: fleet_status.status is not defined or fleet_status.status != 200

- name: Retry Fleet API call
include_tasks: "{{ lookup('env', 'PWD') }}/set_fleet.yml"
when: fleet_status.status is not defined or fleet_status.status != 200

rescue:
- name: Handle any unexpected errors
debug:
msg: "An unexpected error occurred: {{ ansible_failed_result }}"

- name: Confirm Fleet API is ready
debug:
msg: "Fleet API is ready"