Skip to content

Commit

Permalink
fix: 🐛 FIX: Correctif tasks sonarqube et vault
Browse files Browse the repository at this point in the history
FIX: FIX: Correctif tasks sonarqube et vault pour éviter d'avoir à relancer l'install
  • Loading branch information
cedric-montagne committed Jun 12, 2023
1 parent 452db9a commit 66d0022
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion roles/sonarqube/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@
query: select row_to_json(row) from (SELECT * FROM users WHERE login = 'admin') row;
register: admin_account
until: "admin_account is not failed"
retries: 5
retries: 10
delay: 5

- name: Generate random password
set_fact:
admin: "{{ admin_account.stdout | from_json }}"
token_pass: "{{ lookup('password', '/dev/null length=32 chars=ascii_letters') }}"
until: "admin is defined and token_pass is defined"
retries: 5
delay: 5

- name: Get sha384sum of token
shell: "echo -n {{ token_pass }} | sha384sum | awk '{ print $1 }'"
Expand All @@ -109,6 +112,10 @@
(uuid, user_uuid, "name", token_hash, last_connection_date, created_at, project_key, "type", expiration_date)
VALUES('mysuperuuid', '{{ admin.uuid }}', 'DSO', '{{ token_sha.stdout_lines[0] }}', null, 0, '', 'USER_TOKEN', null)
ON CONFLICT(uuid) DO UPDATE SET token_hash = '{{ token_sha.stdout_lines[0] }}';
register: admin_token_check
until: "admin_token_check is not failed"
retries: 5
delay: 5

- name: Update inventory
kubernetes.core.k8s:
Expand Down
4 changes: 3 additions & 1 deletion roles/vault/tasks/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
url: "https://{{ VAULT_DOMAIN }}/v1/sys/health"
status_code: [200, 503, 501]
register: vault_health
retries: 5
retries: 12
delay: 5
until: vault_health.json is defined

- name: set vault_status to OK
set_fact:
Expand Down

0 comments on commit 66d0022

Please sign in to comment.