Skip to content
Merged
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
26 changes: 26 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,32 @@

# tasks file for EDA

# get and set annotations passed via CR
- name: Look up details for this deployment
k8s_info:
api_version: "{{ api_version }}"
kind: "{{ kind }}"
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ ansible_operator_meta.namespace }}"
register: this_eda

- name: set annotations based on this_eda
set_fact:
this_annotations: "{{ this_eda['resources'][0]['metadata']['annotations'] | default({}) }}"

- name: set client_request_timeout based on annotation
set_fact:
client_request_timeout: "{{ (this_annotations['aap.ansible.io/client-request-timeout'][:-1]) | int }}"
client_request_timeout_overidden: true
when:
- "'aap.ansible.io/client-request-timeout' in this_annotations"
- this_annotations['aap.ansible.io/client-request-timeout'] is match('^\\d+s$')

- name: client_request_timeout has been changed
debug:
msg: "client_request_timeout's default 30s value has been overriden by the annotation 'aap.ansible.io/client-request-timeout' to {{ client_request_timeout }}s"
when: client_request_timeout_overidden | default(false)

- name: Create EDA ServiceAccount
k8s:
apply: yes
Expand Down