This guide installs a minimal Backdrop CMS stack with Apache, PHP, and MariaDB.
It targets Debian 10 to latest stable, Ubuntu LTS, and RHEL 9+ compatible hosts.
- name: Install Backdrop CMS
hosts: backdrop
become: true
vars:
backdrop_version: "1.29.2"
backdrop_webroot: /var/www/backdrop
backdrop_db_name: backdrop
backdrop_db_user: backdrop
backdrop_db_password: change_me_now
tasks:
- name: Install dependencies on Debian/Ubuntu
apt:
name:
- apache2
- mariadb-server
- php
- php-mysql
- php-gd
- php-xml
- php-mbstring
- php-curl
- unzip
- wget
- curl
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install dependencies on RHEL family
dnf:
name:
- httpd
- mariadb-server
- php
- php-mysqlnd
- php-gd
- php-xml
- php-mbstring
- php-cli
- unzip
- wget
state: present
when: ansible_os_family == "RedHat"
- name: Ensure web and database services are enabled and started
service:
name: "{{ item }}"
state: started
enabled: true
loop:
- "{{ 'apache2' if ansible_os_family == 'Debian' else 'httpd' }}"
- mariadb
- name: Create Backdrop web root
file:
path: "{{ backdrop_webroot }}"
state: directory
mode: "0755"
- name: Download Backdrop release archive
get_url:
url: "https://github.com/backdrop/backdrop/releases/download/{{ backdrop_version }}/backdrop.zip"
dest: /tmp/backdrop.zip
mode: "0644"
- name: Extract Backdrop
unarchive:
src: /tmp/backdrop.zip
dest: /tmp
remote_src: true
creates: /tmp/backdrop
- name: Sync Backdrop files into web root
command: rsync -a --delete /tmp/backdrop/ {{ backdrop_webroot }}/
- name: Set ownership for web root
file:
path: "{{ backdrop_webroot }}"
state: directory
recurse: true
owner: "{{ 'www-data' if ansible_os_family == 'Debian' else 'apache' }}"
group: "{{ 'www-data' if ansible_os_family == 'Debian' else 'apache' }}"
dnf module) before package install.We develop tailored automation solutions for:
Let’s discuss your requirements: office@linux-server-admin.com | Contact