53 lines
2.1 KiB
YAML
53 lines
2.1 KiB
YAML
---
|
|
# tasks file for ansible_roles_odoo
|
|
|
|
- name: Download Helm
|
|
ansible.builtin.command:
|
|
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
|
|
|
|
- name: Make get_helm.sh executable
|
|
ansible.builtin.command:
|
|
chmod +x get_helm.sh
|
|
|
|
- name: Install Helm
|
|
ansible.builtin.command:
|
|
./get_helm.sh
|
|
|
|
- name: Encoding cloud.conf file
|
|
command: "echo -n '{{ lookup('file', 'templates/cloud.conf') | b64encode | replace('\n', '') }}'"
|
|
register: base64_encoded_cloud_conf
|
|
|
|
|
|
- name: Append base64_encoded_cloud_conf to csi-secret-cinderplugin.yaml
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ role_path }}/templates/cinder-csi-plugin/csi-secret-cinderplugin.yaml"
|
|
insertafter: '^ cloud.conf:'
|
|
line: ' {{ base64_encoded_cloud_conf.stdout }}'
|
|
|
|
- name: Creating secret file
|
|
ansible.builtin.command: kubectl apply -f "{{ role_path }}/templates/cinder-csi-plugin/csi-secret-cinderplugin.yaml"
|
|
|
|
- name: Creating cinder-csi-driver plugins
|
|
ansible.builtin.command: kubectl apply -f "{{ role_path }}/templates/cinder-csi-plugin"
|
|
|
|
- name: Wait for deployment to be ready
|
|
ansible.builtin.wait_for:
|
|
command: kubectl get deploy/csi-cinder-controllerplugin -n kube-system -o jsonpath='{.status.readyReplicas}'
|
|
timeout: 300 # Timeout in seconds
|
|
sleep: 5 # Sleep time between retries
|
|
regexp: '^1$'
|
|
|
|
- name: Wait for DaemonSet to be ready
|
|
ansible.builtin.wait_for:
|
|
command: kubectl get ds/csi-cinder-nodeplugin -n kube-system -o jsonpath='{.status.desiredNumberScheduled} {.status.numberReady}'
|
|
timeout: 300 # Timeout in seconds
|
|
sleep: 5 # Sleep time between retries
|
|
regexp: '^(\d+) (\1)$'
|
|
|
|
- name: Creating the default storageclass
|
|
ansible.builtin.command: kubectl apply -f "{{ role_path }}/templates/storageclass.yml"
|
|
|
|
- name: Deploying odoo
|
|
ansible.builtin.command:
|
|
helm install my-release oci://registry-1.docker.io/bitnamicharts/airflow
|