Skip to content

Commit fbb4573

Browse files
committed
update cluster playbook, lint, and add new vars
1 parent f3b1878 commit fbb4573

File tree

5 files changed

+301
-175
lines changed

5 files changed

+301
-175
lines changed

olam/convert_ansible_inventory.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
4+
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
5+
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
6+
# See LICENSE.TXT for details.
7+
8+
# Check if input file is provided
9+
if [ $# -ne 1 ]; then
10+
echo "Usage: $0 <input_file>"
11+
exit 1
12+
fi
13+
14+
# Set input file
15+
input_file="$1"
16+
17+
# Check if input file exists
18+
if [ ! -f "$input_file" ]; then
19+
echo "Error: Input file '$input_file' does not exist."
20+
exit 1
21+
fi
22+
23+
# Extract hosts and create new format
24+
echo "[control]"
25+
grep "^olam-control-" "$input_file" | sed -E "s/ (ansible_user=opc|ansible_private_key_file=[^ ]+|ansible_ssh_common_args='[^']+')//g" | awk '{print $1, $2, $3}' | sort
26+
echo ""
27+
28+
echo "[control:vars]"
29+
echo "node_type=control"
30+
echo "peers=local_execution_group"
31+
echo ""
32+
33+
echo "[execution]"
34+
grep "^olam-execution-" "$input_file" | sed -E "s/ (ansible_user=opc|ansible_private_key_file=[^ ]+|ansible_ssh_common_args='[^']+')//g" | awk '{print $1, $2, $3}' | sort
35+
echo ""
36+
37+
echo "[local_execution_group]"
38+
grep "^olam-execution-" "$input_file" | sed -E "s/ (ansible_user=opc|ansible_private_key_file=[^ ]+|ansible_ssh_common_args='[^']+')//g" | awk '{print $1, $2, $3}' | sort
39+
echo ""
40+
41+
echo "[local_execution_group:vars]"
42+
echo "node_type=execution"
43+
echo ""
44+
45+
echo "[hop]"
46+
grep "^olam-hop-" "$input_file" | sed -E "s/ (ansible_user=opc|ansible_private_key_file=[^ ]+|ansible_ssh_common_args='[^']+')//g" | awk '{print $1, $2, $3}'
47+
echo ""
48+
49+
echo "[hop:vars]"
50+
echo "peers=control"
51+
echo ""
52+
53+
echo "[remote_execution_group]"
54+
grep "^olam-remote-execution-" "$input_file" | sed -E "s/ (ansible_user=opc|ansible_private_key_file=[^ ]+|ansible_ssh_common_args='[^']+')//g" | awk '{print $1, $2, $3}'
55+
echo ""
56+
57+
echo "[remote_execution_group:vars]"
58+
echo "peers=hop"
59+
echo ""
60+
61+
echo "[db]"
62+
grep "^olam-db" "$input_file" | sed -E "s/ (ansible_user=opc|ansible_private_key_file=[^ ]+|ansible_ssh_common_args='[^']+')//g" | awk '{print $1, $2, $3}'
63+
echo ""
64+
65+
echo "[all:vars]"
66+
echo "ansible_user=opc"
67+
echo "ansible_private_key_file=/home/luna.user/.ssh/id_rsa"
68+
echo "ansible_ssh_common_args='-o StrictHostKeyChecking=no'"

olam/default_vars.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,20 @@ vm_vcpus: 2
4343
vm_ram_mb: 2048
4444
vm_net: default
4545
vm_root_pass:
46-
cleanup_tmp: no
46+
cleanup_tmp: no
47+
48+
awx_pguser_password: password
49+
olam_admin_password: admin
50+
51+
# Set proxy if needed
52+
# Uncomment both the pip_proxy_env and proxy_env sections, and set the proxy host and port accordingly.
53+
54+
pip_proxy_env:
55+
# http_proxy: 'http://www.example.com:80
56+
# https_proxy: 'https://www.example.com:80'
57+
58+
proxy_env:
59+
# http_proxy: 'www.example.com:80'
60+
# https_proxy: 'www.example.com:80'
61+
# ftp_proxy: 'www.example.com:80'
62+
# no_proxy: 'localhost,127.0.0.1,example.com'

0 commit comments

Comments
 (0)