From 4d4977b164b0c81ee63daf9c03b4b8b4bcdf4e56 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 2 Nov 2022 14:48:24 +1300 Subject: [PATCH] early storage operator work --- .gitignore | 1 + ansible/playbooks/05_k8s_deploy.yaml | 7 +++++++ ansible/roles/k8s_storage/defaults/main.yaml | 2 ++ ansible/roles/k8s_storage/tasks/main.yaml | 17 +++++++++++++++++ zz_archived/88_scratch.yaml | 2 +- 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/k8s_storage/defaults/main.yaml create mode 100644 ansible/roles/k8s_storage/tasks/main.yaml diff --git a/.gitignore b/.gitignore index a235aae..ba8f146 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ ansible/vault_password ansible/inventory/host_vars/*/vault.yaml ansible/roles/k8s_network/files/calico +ansible/roles/k8s_storage/files/rook .vscode */vault.yaml \ No newline at end of file diff --git a/ansible/playbooks/05_k8s_deploy.yaml b/ansible/playbooks/05_k8s_deploy.yaml index a76820d..9fd171e 100644 --- a/ansible/playbooks/05_k8s_deploy.yaml +++ b/ansible/playbooks/05_k8s_deploy.yaml @@ -19,3 +19,10 @@ become: false roles: - k8s_taint + +- name: configure storage operator + hosts: localhost + gather_facts: false + become: false + roles: + - k8s_storage \ No newline at end of file diff --git a/ansible/roles/k8s_storage/defaults/main.yaml b/ansible/roles/k8s_storage/defaults/main.yaml new file mode 100644 index 0000000..2e11e39 --- /dev/null +++ b/ansible/roles/k8s_storage/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +rook_version: "v1.10.4" diff --git a/ansible/roles/k8s_storage/tasks/main.yaml b/ansible/roles/k8s_storage/tasks/main.yaml new file mode 100644 index 0000000..f281e8c --- /dev/null +++ b/ansible/roles/k8s_storage/tasks/main.yaml @@ -0,0 +1,17 @@ +--- +- name: create target directory for rook files + ansible.builtin.file: + path: "{{ ansible_search_path[0] }}/files/rook" + state: directory + mode: 0775 + +- 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: + - operator + - crds + - common \ No newline at end of file diff --git a/zz_archived/88_scratch.yaml b/zz_archived/88_scratch.yaml index 2771886..8c79f46 100644 --- a/zz_archived/88_scratch.yaml +++ b/zz_archived/88_scratch.yaml @@ -4,4 +4,4 @@ gather_facts: true become: false roles: - - k8s_taint \ No newline at end of file + - k8s_storage \ No newline at end of file