zuul-operator/roles/zuul-ensure-database-password/tasks/main.yaml
Tristan Cacqueray ee8a7b2cfb Remove command args override and update operator-framework to v1.4.2
This change fixes an issue where zuul services can't create
a lockfile.

Another issue happening with older operator-framework and newer
kubernetes version is being fixed by updating the operator-framework
following this migration documentation:
  https://sdk.operatorframework.io/docs/building-operators/ansible/migration/

Change-Id: I6adfb907184112f0b7debb050975f76cd1dd4b01
2021-04-06 17:23:56 +00:00

17 lines
594 B
YAML

- name: Check if zuul database-password is already created
set_fact:
_zuul_db_password: "{{ lookup('k8s', api_version='v1', kind='Secret', namespace=namespace, resource_name=zuul_name + '-database-password') }}"
- name: Generate and store database password
when: _zuul_db_password.data is not defined
community.kubernetes.k8s:
state: "{{ state }}"
namespace: "{{ namespace }}"
definition:
apiVersion: v1
kind: Secret
metadata:
name: "{{ zuul_name }}-database-password"
stringData:
password: "{{ lookup('password', '/dev/null') }}"