Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
)

var (
Version string // Set via ldflags during build
port int
playbookName string
dryRun bool
Expand Down Expand Up @@ -129,7 +130,11 @@ Requires a configuration file (typically bloom.yaml). Use --playbook to specify
Use: "version",
Short: "Show version information",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Bloom V2.0.0-alpha")
if Version != "" {
fmt.Printf("%s\n", Version)
} else {
fmt.Println("dev")
}
},
}

Expand Down
12 changes: 12 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ClusterBloom build recipes

# Default recipe - show available commands
default:
@just --list

# Build the bloom binary with optional version parameter
build version="dev-build":
@echo "Building bloom (version: {{version}})..."
@mkdir -p dist
CGO_ENABLED=0 go build -ldflags="-X 'github.com/silogen/cluster-bloom/cmd.Version={{version}}'" -o dist/bloom
@echo "Built: dist/bloom"
8 changes: 6 additions & 2 deletions pkg/ansible/runtime/playbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ func RunPlaybook(config map[string]any, playbookName string, dryRun bool, tags s

extraArgs := configToAnsibleVars(config)

// Add BLOOM_DIR to Ansible variables
extraArgs = append(extraArgs, "-e", fmt.Sprintf(`{"BLOOM_DIR": "%s"}`, workDir))
// Add BLOOM_DIR to Ansible variables (current working directory, not .bloom subdir)
cwd, err := os.Getwd()
if err != nil {
return 1, fmt.Errorf("get current directory: %w", err)
}
extraArgs = append(extraArgs, "-e", fmt.Sprintf(`{"BLOOM_DIR": "%s"}`, cwd))

exitCode := RunContainer(rootfs, playbookDir, playbookName, extraArgs, dryRun, tags)
return exitCode, nil
Expand Down
29 changes: 16 additions & 13 deletions pkg/ansible/runtime/playbooks/cluster-bloom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,6 @@
loop: "{{ cluster_disks_list | default([]) }}"
when: cluster_disks_list | length > 0

- name: Mount cluster disks
mount:
path: "/mnt/disk{{ item.0 }}"
src: "{{ item.1 }}"
fstype: ext4
opts: defaults,nofail
state: mounted
loop: "{{ range(cluster_disks_list | length) | list | zip(cluster_disks_list) | list }}"
when: cluster_disks_list | length > 0

- name: Get UUIDs for cluster disks
shell: blkid -s UUID -o value {{ item.1 }}
loop: "{{ range(cluster_disks_list | length) | list | zip(cluster_disks_list) | list }}"
Expand All @@ -470,6 +460,13 @@
state: present
loop: "{{ disk_uuids.results }}"
when: cluster_disks_list | length > 0 and not item.skipped | default(false)

- name: Mount cluster disks using fstab entries (verifies fstab)
shell: mount /mnt/disk{{ item.item.0 }}
loop: "{{ disk_uuids.results }}"
when: cluster_disks_list | length > 0 and not item.skipped | default(false)
register: mount_results
failed_when: mount_results.rc != 0
tags: [storage, prep_node]

- name: Prepare RKE2
Expand Down Expand Up @@ -903,9 +900,15 @@
state: started
tags: [rke2, deploy_cluster]

- name: Setup KubeConfig (First Node)
when: FIRST_NODE
- name: Setup KubeConfig (Control Plane Nodes)
when: FIRST_NODE or CONTROL_PLANE
block:
- name: Wait for RKE2 kubeconfig to be available
wait_for:
path: /etc/rancher/rke2/rke2.yaml
state: present
timeout: 300

- name: Update RKE2 kubeconfig with actual IP
replace:
path: /etc/rancher/rke2/rke2.yaml
Expand Down Expand Up @@ -1277,7 +1280,7 @@
copy:
content: |
echo -e 'FIRST_NODE: false\nJOIN_TOKEN: {{ JOIN_TOKEN_content.content | b64decode | trim }}\nSERVER_IP: {{ node_ip }}' > bloom.yaml && sudo ./bloom --config bloom.yaml
dest: "/tmp/additional_node_command.txt"
dest: "{{ BLOOM_DIR }}/additional_node_command.txt"
mode: "0644"
become: no

Expand Down
Loading
Loading