This guide installs Apache CloudStack management and agent components using repository-based packages.
- name: Install Apache CloudStack on Debian family
hosts: cloudstack_debian
become: true
vars:
cloudstack_apt_repo: "deb https://download.cloudstack.org/debian bookworm 4.20"
cloudstack_apt_key_url: "https://download.cloudstack.org/release.asc"
tasks:
- name: Install repository prerequisites
ansible.builtin.apt:
update_cache: true
name:
- ca-certificates
- curl
- gnupg
- lsb-release
state: present
- name: Add CloudStack apt key
ansible.builtin.apt_key:
url: "{{ cloudstack_apt_key_url }}"
state: present
- name: Add CloudStack apt repository
ansible.builtin.apt_repository:
repo: "{{ cloudstack_apt_repo }}"
filename: cloudstack
state: present
- name: Install CloudStack packages
ansible.builtin.apt:
update_cache: true
name:
- cloudstack-management
- cloudstack-agent
- mariadb-server
state: present
- name: Enable and start services
ansible.builtin.systemd:
name: "{{ item }}"
enabled: true
state: started
loop:
- mariadb
- cloudstack-management
- cloudstack-agent
- name: Install Apache CloudStack on RHEL family
hosts: cloudstack_rhel
become: true
vars:
cloudstack_yum_repo_baseurl: "https://download.cloudstack.org/centos/$releasever/$basearch"
cloudstack_yum_repo_gpgkey: "https://download.cloudstack.org/release.asc"
tasks:
- name: Add CloudStack yum repository
ansible.builtin.yum_repository:
name: cloudstack
description: Apache CloudStack
baseurl: "{{ cloudstack_yum_repo_baseurl }}"
enabled: true
gpgcheck: true
gpgkey: "{{ cloudstack_yum_repo_gpgkey }}"
- name: Install CloudStack packages
ansible.builtin.dnf:
name:
- cloudstack-management
- cloudstack-agent
- mariadb-server
state: present
- name: Enable and start services
ansible.builtin.systemd:
name: "{{ item }}"
enabled: true
state: started
loop:
- mariadb
- cloudstack-management
- cloudstack-agent
- name: Verify CloudStack services are active
ansible.builtin.command: systemctl is-active cloudstack-management
changed_when: false
register: cloudstack_service
- name: Show CloudStack management service status
ansible.builtin.debug:
var: cloudstack_service.stdout
ansible-playbook -i inventory.ini cloudstack-install.yml
cloudstack_debian.