Skip to content

Commit

Permalink
Add initial ansible rook role
Browse files Browse the repository at this point in the history
  • Loading branch information
erzetpe committed Feb 10, 2022
1 parent d15fda4 commit e7a222f
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansible/playbooks/roles/rook/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
rook_helm_chart_file_name: rook-ceph-v1.8.1.tgz
rook_chart_namespace: rook-ceph
rook_helm_chart_name: rook-ceph
rook_enabled: true
kubeconfig:
remote: /etc/kubernetes/admin.conf
36 changes: 36 additions & 0 deletions ansible/playbooks/roles/rook/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
- name: Prepare configuration and upgrade/install Helm chart
when: rook_enabled
become: true
run_once: true

block:
- name: Download Rook's Chart File
include_role:
name: download
tasks_from: download_file
vars:
file_name: "{{ rook_helm_chart_file_name }}"

# - name: Copy configuration Helm chart file (custom-chart-values.yml.j2)
# template:
# dest: "{{ download_directory }}/custom-chart-values.yml"
# src: custom-chart-values.yml.j2

# - name: Install Rook using Helm chart
# shell: |
# helm -n {{ rook_chart_namespace }} upgrade --install \
# -f {{ download_directory }}/custom-chart-values.yml \
# {{ rook_helm_chart_name }} \
# {{ download_directory }}/{{ rook_helm_chart_file_name }} --create-namespace
# environment:
# KUBECONFIG: "{{ kubeconfig.remote }}"

- name: Install Rook using Helm chart
shell: |
helm -n {{ rook_chart_namespace }} upgrade --install \
-f {{ download_directory }}/custom-chart-values.yml \
{{ rook_helm_chart_name }} \
{{ download_directory }}/{{ rook_helm_chart_file_name }} --create-namespace
environment:
KUBECONFIG: "{{ kubeconfig.remote }}"
10 changes: 10 additions & 0 deletions ansible/playbooks/rook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- hosts: all
gather_facts: true
tasks: []

- hosts: kubernetes_master
become: true
become_method: sudo
roles:
- rook

0 comments on commit e7a222f

Please sign in to comment.