Skip to content

feat: init config ansible support#488

Open
joka134 wants to merge 16 commits into
mainfrom
feat/init-config-ansible-support
Open

feat: init config ansible support#488
joka134 wants to merge 16 commits into
mainfrom
feat/init-config-ansible-support

Conversation

@joka134

@joka134 joka134 commented Jun 15, 2026

Copy link
Copy Markdown
Member

Adding a new flag for oms init install-config to pass an ansible inventory that is used to fetch ceph and k8s hosts from it and fills the newly generated config with it.

The main goal of this feature is to reduce manual interactions during installations on infrastructure that has been bootstrapped with ansible.

We decided to limit the format of ansible to the following for now as this is our current use case:

ceph:
  hosts:
    ceph-host-1: # can be any name
      private_ip: 
      ...

k8s-cp:
  hosts:
     k8s-cp-host1: # can be any name
        private_ip: 
        ...
k8s-workers:
  hosts:
     k8s-worker-host1: # can be any name
        private_ip: 
        ...

The first ceph node parsed is always the master during the installation.

@joka134 joka134 marked this pull request as ready for review June 16, 2026 07:30
Signed-off-by: joka134 <27293650+joka134@users.noreply.github.com>

@OliverTrautvetter OliverTrautvetter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice new feature, some comments for it 👍

Comment thread cli/cmd/init_install_config.go
Comment thread cli/cmd/init_install_config.go Outdated
Comment on lines +205 to +212
// If Ansible inventory file is provided, import host information from it
if c.Opts.AnsibleInventoryFile != "" {
err = icg.FetchFromAnsibleInventory(c.Opts.AnsibleInventoryFile)
if err != nil {
return fmt.Errorf("failed to import from Ansible inventory: %w", err)
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ansible inventory integration should have tests in init_install_config_test.go

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about that. We don't have any tests so far for the init function and everything tested regarding FetchFromAnsibleInventory is tested in the new test file

Comment thread internal/installer/config_manager_ansible_test.go
Comment thread internal/installer/config_manager_ansible.go Outdated
Comment thread internal/installer/config_manager_ansible.go Outdated
Comment thread internal/installer/config_manager_ansible.go Outdated
Comment thread internal/installer/config_manager_ansible.go Outdated
Comment thread internal/installer/config_manager_ansible.go Outdated
Comment thread cli/cmd/init_install_config.go Outdated
Comment thread internal/installer/config_manager_ansible.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants