This commit is contained in:
2022-11-03 03:59:42 +13:00
parent 5bd82a4d33
commit a62240b02a
6 changed files with 107 additions and 92 deletions

View File

@ -1,58 +1,58 @@
---
# - name: create target directory for rook files
# ansible.builtin.file:
# path: "{{ ansible_search_path[0] }}/files/rook"
# state: directory
# mode: 0775
- name: create target directory for rook files
ansible.builtin.file:
path: "{{ ansible_search_path[0] }}/files/rook"
state: directory
mode: 0775
# - name: load rbd kernel module
# become: true
# delegate_to: "{{ item }}"
# with_items: "{{ groups['k8s_worker'] }}"
# community.general.modprobe:
# name: rbd
# state: present
- name: load rbd kernel module
become: true
delegate_to: "{{ item }}"
with_items: "{{ groups['k8s_worker'] }}"
community.general.modprobe:
name: rbd
state: present
# - name: set rbd kernel module to load at boot
# become: true
# delegate_to: "{{ item }}"
# with_items: "{{ groups['k8s_worker'] }}"
# ansible.builtin.copy:
# dest: /etc/modules-load.d/rbd.conf
# content: rbd
# owner: root
# group: root
# mode: 0660
- name: set rbd kernel module to load at boot
become: true
delegate_to: "{{ item }}"
with_items: "{{ groups['k8s_worker'] }}"
ansible.builtin.copy:
dest: /etc/modules-load.d/rbd.conf
content: rbd
owner: root
group: root
mode: 0660
# - name: install lvm2 package
# become: true
# delegate_to: "{{ item }}"
# with_items: "{{ groups['k8s_worker'] }}"
# community.general.pacman:
# name: lvm2
# state: latest
# update_cache: true
- name: install lvm2 package
become: true
delegate_to: "{{ item }}"
with_items: "{{ groups['k8s_worker'] }}"
community.general.pacman:
name: lvm2
state: latest
update_cache: true
# - name: download the rook manifests
# ansible.builtin.uri:
# url: https://raw.githubusercontent.com/rook/rook/{{ rook_version }}/deploy/examples/{{ item }}.yaml
# dest: "{{ ansible_search_path[0] }}/files/rook/rook_{{ item }}_{{ rook_version }}.yaml"
# creates: "{{ ansible_search_path[0] }}/files/rook/rook_{{ item }}_{{ rook_version }}.yaml"
# mode: 0664
# with_items:
# - crds
# - common
# - operator
# - cluster
- name: download the rook manifests
ansible.builtin.uri:
url: https://raw.githubusercontent.com/rook/rook/{{ rook_version }}/deploy/examples/{{ item }}.yaml
dest: "{{ ansible_search_path[0] }}/files/rook/rook_{{ item }}_{{ rook_version }}.yaml"
creates: "{{ ansible_search_path[0] }}/files/rook/rook_{{ item }}_{{ rook_version }}.yaml"
mode: 0664
with_items:
- crds
- common
- operator
- cluster
# - name: deploy the rook manifest # The order of the items is important, crds > common > operator , see https://github.com/rook/rook/blob/v1.10.4/deploy/examples/common.yaml
# kubernetes.core.k8s:
# src: "{{ ansible_search_path[0] }}/files/rook/rook_{{ item }}_{{ rook_version }}.yaml"
# state: present
# with_items:
# - crds
# - common
# - operator
- name: deploy the rook manifest # The order of the items is important, crds > common > operator , see https://github.com/rook/rook/blob/v1.10.4/deploy/examples/common.yaml
kubernetes.core.k8s:
src: "{{ ansible_search_path[0] }}/files/rook/rook_{{ item }}_{{ rook_version }}.yaml"
state: present
with_items:
- crds
- common
# - operator
# # TODO somehow turn this command:
# # kubectl -n rook-ceph get pod -o json | jq '.items[].status.containerStatuses[].ready'
@ -92,10 +92,10 @@
# TODO create a check and wait until cluster is created and running
- name: create the storage providers
kubernetes.core.k8s:
src: "{{ ansible_search_path[0] }}/files/config/{{ item }}"
state: present
with_items:
- blockpool_ssd_replica.yaml
- filesystem_multi.yaml
# - name: create the storage providers
# kubernetes.core.k8s:
# src: "{{ ansible_search_path[0] }}/files/config/{{ item }}"
# state: present
# with_items:
# - blockpool_ssd_replica.yaml
# - filesystem_multi.yaml