Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge ansible role octavia_preconf as per jira OSPC-189 #653

Merged
merged 5 commits into from
Jan 24, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove tests directory from the octavia_preconf role and enclose vari…
…able names in double quotes in shell scripts

Signed-off-by: puni4220 <punitshankar.kundal@rackspace.com>
puni4220 committed Jan 24, 2025
commit 2437a2df74ea40ef34ef3af936db7637aa6cd00c
10 changes: 5 additions & 5 deletions ansible/roles/octavia_preconf/files/create_health_mgr_ports.sh
Original file line number Diff line number Diff line change
@@ -20,15 +20,15 @@ CONTROLLER_IP_PORT_LIST=''
CTRLS=$(kubectl get nodes -l openstack-control-plane=enabled -o name | awk -F"/" '{print $2}')
for node in $CTRLS
do
node_short=$(echo $node | awk -F"." '{print $1}')
node_short=$(echo "$node" | awk -F"." '{print $1}')
PORTNAME=octavia-health-manager-port-$node_short
PORT_ID=$(openstack port create $PORTNAME --security-group $SECGRP_ID --device-owner Octavia:health-mgr --host=$node -c id -f value --network $NET_ID)
IP=$(openstack port show $PORT_ID -c fixed_ips -f yaml | grep ip_address | awk -F':' '{print $2}')
if [ -z $CONTROLLER_IP_PORT_LIST ]; then
PORT_ID=$(openstack port create "$PORTNAME" --security-group "$SECGRP_ID" --device-owner Octavia:health-mgr --host="$node" -c id -f value --network "$NET_ID")
IP=$(openstack port show "$PORT_ID" -c fixed_ips -f yaml | grep ip_address | awk -F':' '{print $2}')
if [ -z "$CONTROLLER_IP_PORT_LIST" ]; then
CONTROLLER_IP_PORT_LIST=$IP:5555
else
CONTROLLER_IP_PORT_LIST=$CONTROLLER_IP_PORT_LIST,$IP:5555
fi
done

echo $CONTROLLER_IP_PORT_LIST > /tmp/octavia_hm_controller_ip_port_list
echo "$CONTROLLER_IP_PORT_LIST" > /tmp/octavia_hm_controller_ip_port_list
10 changes: 5 additions & 5 deletions ansible/roles/octavia_preconf/files/create_k8s_secret.sh
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ CLIENT_KEY_CERT=$4
function encod_base64()
{
local file_path=$1
cat $file_path | base64 -w0 | tr -d '\n'
cat "$file_path" | base64 -w0 | tr -d '\n'
}

cat <<EOF> /tmp/k8s_secret.yml
@@ -26,8 +26,8 @@ metadata:
namespace: openstack
type: Opaque
data:
server_ca.cert.pem: $(encod_base64 $SERVER_CA)
server_ca.key.pem: $(encod_base64 $SERVER_CA_KEY)
client_ca.cert.pem: $(encod_base64 $CLIENT_CA)
client.key-and-cert.pem: $(encod_base64 $CLIENT_KEY_CERT)
server_ca.cert.pem: $(encod_base64 "$SERVER_CA")
server_ca.key.pem: $(encod_base64 "$SERVER_CA_KEY")
client_ca.cert.pem: $(encod_base64 "$CLIENT_CA")
client.key-and-cert.pem: $(encod_base64 "$CLIENT_KEY_CERT")
EOF
3 changes: 0 additions & 3 deletions ansible/roles/octavia_preconf/tasks/octavia_cert.yml
Original file line number Diff line number Diff line change
@@ -119,9 +119,6 @@
cmd: create_k8s_secret.sh {{ octavia_server_ca_cert }} {{ octavia_serverca_privkey }} {{ octavia_client_ca_cert }} {{ octavia_client_key_cert }}
creates: /tmp/k8s_secret.yml

#- name: Create the "octavia-certs" secret in the openstack namespace
# command:
# cmd: kubectl apply -f /tmp/k8s_secret.yml
- name: Create the "octavia-certs" secret in the openstack namespace
k8s:
state: present
2 changes: 0 additions & 2 deletions ansible/roles/octavia_preconf/tests/inventory

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/roles/octavia_preconf/tests/test.yml

This file was deleted.