Skip to content

merge fixes for olam on ol9 #79

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

Merged
merged 23 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
018dea7
migrate instance setup to individual playbooks for olam
bgraef Jul 2, 2025
a513064
update oci deployment and split terminate plays
bgraef Jul 2, 2025
6bb7f30
fix instance name var in block and build
bgraef Jul 2, 2025
e56e860
fix hosts and loop var in build and block
bgraef Jul 2, 2025
3090390
remove loop for host ini group and use instance type
bgraef Jul 2, 2025
6481091
update hosts list for instance config basics
bgraef Jul 2, 2025
c783c69
fix subnet var name when config passwordless
bgraef Jul 2, 2025
491439d
move olae under install_type var
bgraef Jul 2, 2025
8bf2ffc
swap wait_for to wait_for_connection
bgraef Jul 2, 2025
0670499
minor lint fix in wait_for_connection
bgraef Jul 2, 2025
ee9cf96
update single node for ol9 through db install
bgraef Jul 7, 2025
7e50e4b
update olam install through pkg, redis, and podman image
bgraef Jul 7, 2025
8fec1ef
add condition to python3-check for ol8-only
bgraef Jul 7, 2025
db18dd2
remove 2.3 repo in v1 deployment
bgraef Jul 7, 2025
b1730b0
update cluster deploy for ol9
bgraef Jul 11, 2025
4f36ace
update receptor peer config
bgraef Jul 14, 2025
f9540b2
add receptor address and swap peer from control to local exec
bgraef Jul 14, 2025
f2bc564
fix typo in awx-manage command
bgraef Jul 14, 2025
4cb2091
update builder utility install for 2.3 and ol9
bgraef Jul 16, 2025
fa3c81b
fix typo for ol9 in builder
bgraef Jul 16, 2025
4eb3597
add bindep and update builder install
bgraef Jul 16, 2025
3538bb2
add lingering for build process
bgraef Jul 17, 2025
9de9bc5
merge in fixes for olam on ol9
bgraef Jul 21, 2025
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
6 changes: 5 additions & 1 deletion olam/block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
block:
- name: Create block volume
oracle.oci.oci_blockstorage_volume:
config_file_location: "{{ oci_config_file | default(omit) }}"
config_profile_name: "{{ oci_config_section | default(omit) }}"
compartment_id: "{{ my_compartment_id }}"
availability_domain: "{{ my_availability_domain }}"
display_name: "blockvolume-{{ item.value.instance_name | default('instance-'~timestamp) }}"
Expand All @@ -27,7 +29,9 @@

- name: Attach the block volume
oracle.oci.oci_compute_volume_attachment:
instance_id: "{{ instance_id }}"
config_file_location: "{{ oci_config_file | default(omit) }}"
config_profile_name: "{{ oci_config_section | default(omit) }}"
instance_id: "{{ my_instance_id }}"
type: paravirtualized
volume_id: "{{ volume_id }}"
compartment_id: "{{ my_compartment_id }}"
Expand Down
45 changes: 29 additions & 16 deletions olam/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
# Copyright (c) 2024 Oracle and/or its affiliates.
# Copyright (c) 2024 2025 Oracle and/or its affiliates.
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
# See LICENSE.TXT for details.

- name: Launch an instance
oracle.oci.oci_compute_instance:
config_file_location: "{{ oci_config_file | default(omit) }}"
config_profile_name: "{{ oci_config_section | default(omit) }}"
availability_domain: "{{ my_availability_domain }}"
compartment_id: "{{ my_compartment_id }}"
display_name: "{{ item.value.instance_name | default('instance-'~timestamp) }}"
Expand Down Expand Up @@ -50,23 +52,33 @@

- name: Set the compute instance id
ansible.builtin.set_fact:
instance_id: "{{ result.instance.id }}"
my_instance_id: "{{ result.instance.id }}"

- name: Add instance id to state file
ansible.builtin.lineinfile:
path: .ansible-state
line: "instance{{ ansible_loop.index0 + 1 }}_ocid: {{ my_instance_id }}"
mode: "0755"

- name: Set the compute instance display_name
ansible.builtin.set_fact:
instance_display_name: "{{ result.instance.display_name }}"
my_instance_display_name: "{{ result.instance.display_name }}"

- name: Get the vnic attachment details of instance
oracle.oci.oci_compute_vnic_attachment_facts:
config_file_location: "{{ oci_config_file | default(omit) }}"
config_profile_name: "{{ oci_config_section | default(omit) }}"
compartment_id: "{{ my_compartment_id }}"
instance_id: "{{ instance_id }}"
instance_id: "{{ my_instance_id }}"
register: result
retries: 10
delay: 30
until: result is not failed

- name: Get vnic details
oracle.oci.oci_network_vnic_facts:
config_file_location: "{{ oci_config_file | default(omit) }}"
config_profile_name: "{{ oci_config_section | default(omit) }}"
id: "{{ result.vnic_attachments[0].vnic_id }}"
register: result
retries: 10
Expand All @@ -86,6 +98,7 @@
loop: "{{ query('sequence', 'start=1 end=' + (block_count) | string) }}"
loop_control:
extended: true
loop_var: blk_item
vars:
block_devices:
- b
Expand All @@ -97,36 +110,36 @@
- name: Print the public and private ip of the newly created instance
ansible.builtin.debug:
msg:
- "Instance name: {{ instance_display_name }}"
- "Instance name: {{ my_instance_display_name }}"
- " public ip: {{ instance_public_ip }}"
- " private ip: {{ instance_private_ip }}"
when: debug_enabled

- name: Add host to in-memory host file
ansible.builtin.add_host:
name: "{{ instance_display_name }}"
name: "{{ my_instance_display_name }}"
groups: "{{ item.value.type }}"
ansible_user: opc
ansible_private_key_file: "{{ lookup('env', 'HOME') + '/.ssh/' + private_key }}"
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
ansible_host: "{{ instance_public_ip }}"
ansible_port: 22
instance_ocid: "{{ instance_id }}"
instance_ocid: "{{ my_instance_id }}"

- name: Create host ini file
ansible.builtin.lineinfile:
path: hosts
regexp: '^\[{{ host_group }}'
line: "[{{ host_group }}]"
regexp: '^\[{{ item.value.type }}'
line: "[{{ item.value.type }}]"
create: true
mode: "0664"
delegate_to: localhost
loop:
- control
- execution
- db
loop_control:
loop_var: host_group
# loop:
# - control
# - execution
# - db
# loop_control:
# loop_var: host_group

- name: Add host to ini host file
ansible.builtin.lineinfile:
Expand All @@ -143,7 +156,7 @@
mode: "664"
delegate_to: localhost
vars:
instance_name: "{{ instance_display_name }}"
instance_name: "{{ my_instance_display_name }}"
instance_ansible_user: opc
instance_ansible_private_key_file: "{{ lookup('env', 'HOME') + '/.ssh/' + private_key }}"
instance_ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
Expand Down
43 changes: 43 additions & 0 deletions olam/check_instance_available.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# Copyright (c) 2024 2025 Oracle and/or its affiliates.
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
# See LICENSE.TXT for details.

- name: Configure new instances
hosts: all:!localhost
gather_facts: false
vars_files:
- default_vars.yml
- oci_vars.yml

tasks:

- name: Wait for systems to become reachable and usable
ansible.builtin.wait_for_connection:

# - name: Wait for systems to become reachable using ssh
# ansible.builtin.wait_for:
# port: 22
# host: '{{ (ansible_ssh_host | default(ansible_host)) | default(inventory_hostname) }}'
# search_regex: OpenSSH
# delay: 10
# timeout: 300

- name: Get a set of all available facts
ansible.builtin.setup:

- name: Print in-memory inventory # noqa: run-once[task]
ansible.builtin.debug:
msg: "{{ groups['all'] }}"
delegate_to: localhost
run_once: true
when: debug_enabled

- name: Print all variables/facts known for a host # noqa: run-once[task]
ansible.builtin.debug:
msg: "{{ hostvars[item] }}"
loop: "{{ groups['all'] | flatten(levels=1) }}"
delegate_to: localhost
run_once: true
when: debug_enabled
85 changes: 85 additions & 0 deletions olam/configure_passwordless_ssh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
# Copyright (c) 2024 Oracle and/or its affiliates.
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0.
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl)
# See LICENSE.TXT for details.

- name: Configure passwordless ssh between hosts
hosts: all:!localhost:!remote
vars_files:
- default_vars.yml
- oci_vars.yml

tasks:

- name: Generate ssh keypair for user
community.crypto.openssh_keypair:
path: ~/.ssh/id_rsa
size: 2048
comment: ol ssh keypair
become: true
become_user: "{{ username }}"

- name: Fetch public key file
ansible.builtin.fetch:
src: "~/.ssh/id_rsa.pub"
dest: "buffer/{{ inventory_hostname }}-id_rsa.pub"
flat: true
become: true
become_user: "{{ username }}"

- name: Copy public key to each destination
ansible.posix.authorized_key:
user: "{{ username }}"
state: present
key: "{{ lookup('file', 'buffer/{{ item }}-id_rsa.pub') }}"
# loop: "{{ groups['all'] | flatten(levels=1) }}"
loop: "{{ ansible_play_hosts_all | difference(['localhost']) }}"
become: true

# - name: Copy public key to each destination for root
# ansible.posix.authorized_key:
# user: "root"
# state: present
# key: "{{ lookup('file', 'buffer/{{ item }}-id_rsa.pub') }}"
# loop: "{{ groups['all'] | flatten(levels=1) }}"
# become: true

- name: Print hostvars for groups
ansible.builtin.debug:
msg: "{{ hostvars[item] }}"
# loop: "{{ groups['all'] | flatten(levels=1) }}"
loop: "{{ ansible_play_hosts_all | difference(['localhost']) }}"
when: debug_enabled

- name: Print vcn subnet_domain_name
ansible.builtin.debug:
var: my_subnet1_domain_name
when: debug_enabled

- name: Accept new ssh fingerprints
ansible.builtin.shell: |
ssh-keyscan -t ecdsa-sha2-nistp256 \
{{ hostvars[item].ansible_hostname }},\
{{ hostvars[item].ansible_default_ipv4.address }},\
{{ hostvars[item].ansible_hostname + '.' + my_subnet_domain_name }} >> ~/.ssh/known_hosts
with_items:
# - "{{ groups['all'] }}"
"{{ ansible_play_hosts_all | difference(['localhost']) }}"
become: true
become_user: "{{ username }}"
register: result
changed_when: result.rc == 0

# - name: Accept new ssh fingerprints for root
# ansible.builtin.shell: |
# ssh-keyscan -t ecdsa-sha2-nistp256 \
# {{ hostvars[item].ansible_hostname }},\
# {{ hostvars[item].ansible_default_ipv4.address }},\
# {{ hostvars[item].ansible_hostname + '.' + my_subnet1_domain_name }} >> ~/.ssh/known_hosts
# with_items:
# - "{{ groups['all'] }}"
# become: true
# become_user: "root"
# register: result
# changed_when: result.rc == 0
3 changes: 2 additions & 1 deletion olam/convert_ansible_inventory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo ""

echo "[control:vars]"
echo "node_type=control"
echo "peers=local_execution_group"
# echo "peers=local_execution_group"
echo ""

echo "[execution]"
Expand All @@ -40,6 +40,7 @@ echo ""

echo "[local_execution_group:vars]"
echo "node_type=execution"
echo "peers=control"
echo ""

echo "[hop]"
Expand Down
Loading