diff options
Diffstat (limited to 'playbooks.d')
-rw-r--r-- | playbooks.d/k3s-master/playbook.bash | 3 | ||||
-rw-r--r-- | playbooks.d/k3s-node/playbook.bash | 1 | ||||
-rw-r--r-- | playbooks.d/seaweedfs-filer/playbook.bash | 21 | ||||
-rw-r--r-- | playbooks.d/seaweedfs-filer/share/filer-leveldb3.toml (renamed from playbooks.d/seaweedfs-filer/share/filer.toml) | 2 | ||||
-rw-r--r-- | playbooks.d/seaweedfs-filer/share/filer-postgres2.toml | 24 | ||||
-rw-r--r-- | playbooks.d/seaweedfs/playbook.bash | 2 |
6 files changed, 48 insertions, 5 deletions
diff --git a/playbooks.d/k3s-master/playbook.bash b/playbooks.d/k3s-master/playbook.bash index f19fe8c..22f82b0 100644 --- a/playbooks.d/k3s-master/playbook.bash +++ b/playbooks.d/k3s-master/playbook.bash @@ -11,6 +11,7 @@ playbook_add() { node-ip: "$(config "$BASHTARD_PLAYBOOK.internal-ip" "127.0.0.1")" bind-address: "$(config "$BASHTARD_PLAYBOOK.bind-address" "0.0.0.0")" flannel-backend: wireguard-native + flannel-ipv6-masq: true cluster-cidr: "$(config "$BASHTARD_PLAYBOOK.cluster-cidr" "172.19.0.0/16")" cluster-domain: "$(config "$BASHTARD_PLAYBOOK.cluster-domain" "cluster.local")" service-cidr: "$(config "$BASHTARD_PLAYBOOK.service-cidr" "172.20.0.0/16")" @@ -38,7 +39,7 @@ playbook_add() { notice "$BASHTARD_PLAYBOOK/add" "Waiting for node to become available" { grep -q -m 1 "${BASHTARD_PLATFORM[fqdn]}[[:space:]]\+Ready"; kill $!; } < <(k3s kubectl get node -w) - #playbook_sync + playbook_sync } playbook_sync() { diff --git a/playbooks.d/k3s-node/playbook.bash b/playbooks.d/k3s-node/playbook.bash index e5eb2a6..0cf54c2 100644 --- a/playbooks.d/k3s-node/playbook.bash +++ b/playbooks.d/k3s-node/playbook.bash @@ -60,6 +60,7 @@ playbook_add() { cluster-cidr: "$(config "$BASHTARD_PLAYBOOK.cluster-cidr" "172.19.0.0/16")" cluster-domain: "$(config "$BASHTARD_PLAYBOOK.cluster-domain" "cluster.local")" flannel-backend: wireguard-native + flannel-ipv6-masq: true service-cidr: "$(config "$BASHTARD_PLAYBOOK.service-cidr" "172.20.0.0/16")" service-node-port-range: "$(config "$BASHTARD_PLAYBOOK.service-node-port-min" "30000")-$(config "$BASHTARD_PLAYBOOK.service-node-port-max" "32767")" disable: diff --git a/playbooks.d/seaweedfs-filer/playbook.bash b/playbooks.d/seaweedfs-filer/playbook.bash index 1a71f07..7ae23b2 100644 --- a/playbooks.d/seaweedfs-filer/playbook.bash +++ b/playbooks.d/seaweedfs-filer/playbook.bash @@ -66,8 +66,25 @@ playbook_sync() { s3_port="$(config "$BASHTARD_PLAYBOOK.s3.port" "8333")" \ > "$buffer" - file_template "filer.toml" \ - > "$(config "fs.etcdir")/seaweedfs/filer.toml" + case "$(config "$BASHTARD_PLAYBOOK.db.type" "leveldb3")" in + leveldb3) + file_template "filer-leveldb3.toml" \ + path="$(config "$BASHTARD_PLAYBOOK.db.path" "./filerldb3")" \ + > "$(config "fs.etcdir")/seaweedfs/filer.toml" + ;; + postgres2) + file_template "filer-postgres2.toml" \ + host="$(config "$BASHTARD_PLAYBOOK.db.host" "localhost")" \ + port="$(config "$BASHTARD_PLAYBOOK.db.port" "5432")" \ + name="$(config "$BASHTARD_PLAYBOOK.db.name" "seaweedfs")" \ + user="$(config "$BASHTARD_PLAYBOOK.db.user" "seaweedfs")" \ + pass="$(config "$BASHTARD_PLAYBOOK.db.password" "")" \ + > "$(config "fs.etcdir")/seaweedfs/filer.toml" + ;; + *) + alert "$BASHTARD_PLAYBOOK/sync" "No valid '$BASHTARD_PLAYBOOK.db.type' set" + return 1 + esac [[ "$(file_hash "$buffer")" == "$hash" ]] && return diff --git a/playbooks.d/seaweedfs-filer/share/filer.toml b/playbooks.d/seaweedfs-filer/share/filer-leveldb3.toml index 8d40cb9..da7324f 100644 --- a/playbooks.d/seaweedfs-filer/share/filer.toml +++ b/playbooks.d/seaweedfs-filer/share/filer-leveldb3.toml @@ -1,3 +1,3 @@ [leveldb3] enabled = true -dir = "./filerldb3" +dir = "${path}" diff --git a/playbooks.d/seaweedfs-filer/share/filer-postgres2.toml b/playbooks.d/seaweedfs-filer/share/filer-postgres2.toml new file mode 100644 index 0000000..d802703 --- /dev/null +++ b/playbooks.d/seaweedfs-filer/share/filer-postgres2.toml @@ -0,0 +1,24 @@ +[postgres2] +enabled = true +createTable = """ + CREATE TABLE IF NOT EXISTS "%s" ( + dirhash BIGINT, + name VARCHAR(65535), + directory VARCHAR(65535), + meta bytea, + PRIMARY KEY (dirhash, name) + ); +""" +hostname = "${host}" +port = ${port} +username = "${user}" +password = "${pass}" +database = "${name}" +schema = "" +sslmode = "disable" +connection_max_idle = 100 +connection_max_open = 100 +connection_max_lifetime_seconds = 0 +# if insert/upsert failing, you can disable upsert or update query syntax to match your RDBMS syntax: +enableUpsert = true +upsertQuery = """UPSERT INTO "%[1]s" (dirhash,name,directory,meta) VALUES($1,$2,$3,$4)""" diff --git a/playbooks.d/seaweedfs/playbook.bash b/playbooks.d/seaweedfs/playbook.bash index e6c0c4c..fabc958 100644 --- a/playbooks.d/seaweedfs/playbook.bash +++ b/playbooks.d/seaweedfs/playbook.bash @@ -14,7 +14,7 @@ playbook_add() { dl_baseurl="https://github.com/seaweedfs/seaweedfs/releases/download" dl_binary="$(printf "%s_%s.tar.gz" "${BASHTARD_PLATFORM[os]}" "$dl_arch")" - dl_version="$(config "$BASHTARD_PLAYBOOK.version" "3.63")" + dl_version="$(config "$BASHTARD_PLAYBOOK.version" "3.65")" buffer="$(tmpdir)" |