This guide automates OpenStack installation using native packages on bare-metal or virtual machines without containerization.
- name: Deploy OpenStack (Native)
hosts: openstack_hosts
become: true
vars:
openstack_release: "2025.2"
database_password: "secure_db_password"
rabbit_password: "secure_rabbit_password"
admin_password: "secure_admin_password"
tasks:
- name: Install Python dependencies
ansible.builtin.package:
name:
- python3
- python3-pip
- libffi-dev
- libssl-dev
state: present
- name: Install OpenStack client
ansible.builtin.pip:
name: python-openstackclient
state: present
- name: Install MariaDB server (controller node)
ansible.builtin.package:
name:
- mariadb-server
- python3-pymysql
state: present
when: inventory_hostname in groups['controllers']
- name: Start and enable MariaDB
ansible.builtin.systemd:
name: mariadb
enabled: true
state: started
- name: Install RabbitMQ
ansible.builtin.package:
name: rabbitmq-server
state: present
- name: Start and enable RabbitMQ
ansible.builtin.systemd:
name: rabbitmq-server
enabled: true
state: started
- name: Install Keystone (Identity Service)
ansible.builtin.package:
name:
- keystone
- python3-keystone
state: present
- name: Install Nova (Compute Service)
ansible.builtin.package:
name:
- nova-api
- nova-conductor
- nova-novncproxy
- nova-scheduler
state: present
when: inventory_hostname in groups['controllers']
- name: Install Nova Compute
ansible.builtin.package:
name:
- nova-compute
state: present
when: inventory_hostname in groups['computes']
- name: Install Neutron (Networking Service)
ansible.builtin.package:
name:
- neutron-server
- neutron-plugin-ml2
- neutron-openvswitch-agent
state: present
when: inventory_hostname in groups['controllers']
- name: Install Neutron OVS Agent
ansible.builtin.package:
name:
- neutron-openvswitch-agent
state: present
when: inventory_hostname in groups['computes']
- name: Initialize Keystone database
ansible.builtin.command: keystone-manage db_sync
when: inventory_hostname in groups['controllers']
- name: Start OpenStack services
ansible.builtin.systemd:
name: "{{ item }}"
enabled: true
state: started
loop:
- openstack-keystone
- openstack-nova-api
- openstack-nova-scheduler
- openstack-nova-conductor
- neutron-server
ansible-playbook -i inventory.ini openstack-native.yml
# Source admin credentials
source admin-openrc.sh
# List services
openstack service list
openstack compute service list
openstack network agent list