Skip to content

Commit

Permalink
fix servers flags (rancher#94)
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco <[email protected]>
  • Loading branch information
fmoral2 authored May 6, 2024
1 parent 334dbe5 commit bf44a22
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion modules/install/join_k3s_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ update_config() {
echo -e "$worker_flags" >> /etc/rancher/k3s/config.yaml
fi

if [[ "$worker_flags" != *"cloud-provider-name"* ]]; then
if [[ "$worker_flags" != *"cloud-provider-name"* ]] || [[ -z "$worker_flags" ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
echo -e "node-external-ip: $public_ip,$ipv6_ip" >> /etc/rancher/k3s/config.yaml
echo -e "node-ip: $private_ip,$ipv6_ip" >> /etc/rancher/k3s/config.yaml
Expand Down
2 changes: 1 addition & 1 deletion modules/install/join_k3s_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ update_config() {
echo -e "$server_flags" >> /etc/rancher/k3s/config.yaml
fi

if [[ "$server_flags" != *"cloud-provider-name"* ]]; then
if [[ "$server_flags" != *"cloud-provider-name"* ]] || [[ -z "$server_flags" ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
echo -e "node-external-ip: $public_ip,$ipv6_ip" >> /etc/rancher/k3s/config.yaml
echo -e "node-ip: $private_ip,$ipv6_ip" >> /etc/rancher/k3s/config.yaml
Expand Down
13 changes: 7 additions & 6 deletions modules/install/join_rke2_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ EOF
update_config() {
if [ -n "$worker_flags" ] && [[ "$worker_flags" == *":"* ]]; then
echo -e "$worker_flags" >> /etc/rancher/rke2/config.yaml
if [[ "$worker_flags" != *"cloud-provider-name"* ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
fi

if [[ "$worker_flags" != *"cloud-provider-name"* ]] || [[ -z "$worker_flags" ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
echo -e "node-external-ip: $public_ip,$ipv6_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $private_ip,$ipv6_ip" >> /etc/rancher/rke2/config.yaml
elif [ -n "$ipv6_ip" ]; then
elif [ -n "$ipv6_ip" ]; then
echo -e "node-external-ip: $ipv6_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $ipv6_ip" >> /etc/rancher/rke2/config.yaml
else
else
echo -e "node-external-ip: $public_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $private_ip" >> /etc/rancher/rke2/config.yaml
fi
fi
cat /etc/rancher/rke2/config.yaml
fi
cat /etc/rancher/rke2/config.yaml
}

cis_setup() {
Expand Down
13 changes: 7 additions & 6 deletions modules/install/join_rke2_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@ EOF
update_config() {
if [ -n "$server_flags" ] && [[ "$server_flags" == *":"* ]]; then
echo -e "$server_flags" >> /etc/rancher/rke2/config.yaml
if [[ "$server_flags" != *"cloud-provider-name"* ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
fi

if [[ "$server_flags" != *"cloud-provider-name"* ]] || [[ -z "$server_flags" ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
echo -e "node-external-ip: $public_ip,$ipv6_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $private_ip,$ipv6_ip" >> /etc/rancher/rke2/config.yaml
elif [ -n "$ipv6_ip" ]; then
elif [ -n "$ipv6_ip" ]; then
echo -e "node-external-ip: $ipv6_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $ipv6_ip" >> /etc/rancher/rke2/config.yaml
else
else
echo -e "node-external-ip: $public_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $private_ip" >> /etc/rancher/rke2/config.yaml
fi
fi
cat /etc/rancher/rke2/config.yaml
fi
cat /etc/rancher/rke2/config.yaml
}

subscription_manager() {
Expand Down
2 changes: 1 addition & 1 deletion modules/install/k3s_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ update_config() {
echo -e "$server_flags" >> /etc/rancher/k3s/config.yaml
fi

if [[ "$server_flags" != *"cloud-provider-name"* ]]; then
if [[ "$server_flags" != *"cloud-provider-name"* ]] || [[ -z "$server_flags" ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
echo -e "node-external-ip: $public_ip,$ipv6_ip" >> /etc/rancher/k3s/config.yaml
echo -e "node-ip: $private_ip,$ipv6_ip" >> /etc/rancher/k3s/config.yaml
Expand Down
13 changes: 7 additions & 6 deletions modules/install/rke2_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,21 @@ EOF
update_config() {
if [ -n "$server_flags" ] && [[ "$server_flags" == *":"* ]]; then
echo -e "$server_flags" >> /etc/rancher/rke2/config.yaml
if [[ "$server_flags" != *"cloud-provider-name"* ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
fi

if [[ "$server_flags" != *"cloud-provider-name"* ]] || [[ -z "$server_flags" ]]; then
if [ -n "$ipv6_ip" ] && [ -n "$public_ip" ] && [ -n "$private_ip" ]; then
echo -e "node-external-ip: $public_ip,$ipv6_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $private_ip,$ipv6_ip" >> /etc/rancher/rke2/config.yaml
elif [ -n "$ipv6_ip" ]; then
elif [ -n "$ipv6_ip" ]; then
echo -e "node-external-ip: $ipv6_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $ipv6_ip" >> /etc/rancher/rke2/config.yaml
else
else
echo -e "node-external-ip: $public_ip" >> /etc/rancher/rke2/config.yaml
echo -e "node-ip: $private_ip" >> /etc/rancher/rke2/config.yaml
fi
fi
cat /etc/rancher/rke2/config.yaml
fi
cat /etc/rancher/rke2/config.yaml
}

subscription_manager() {
Expand Down

0 comments on commit bf44a22

Please sign in to comment.