Deploying Drupal 8 with Ansible playbook

Prerequisites

  1. Two Alibaba Cloud ECS instances with Ubuntu 16.04 64-bit installed. You can follow this Quick Start Guide to create the instances. Let’s call the first instance as “web-server” and assume the public IP assigned to the server is “192.168.0.1”. We will use this server to install Drupal using Drush on NGINX with PHP 7.2. Similarly, we will call our second server as “db-server” having public IP “192.168.0.2”. We will install MariaDB server on this instance to host the Drupal database. Make sure to use SSH Key based authentication rather than password authentication and use the same key for both the instance.
  2. Important: Firewall or Security group rules configured to allow the port “80”, “443” for everyone from the “web-server” instance. For the database server, you will only need to allow access to the private IP address of the “web-server” instance on port “3306”.
  1. Install the MariaDB server and create the database for Drupal on the instance named “db-server”.
  2. Install the PHP 7.2 on the instance “web-server”.
  3. Clone the Drupal 8 and Drush 9 Github repository and install Drupal on the instance “web-server”.
  4. Install the NGINX Web server to host the Drupal site with optional Let’s Encrypt SSL on the instance “web-server”.
- name: create a new database for Drupal
mysql_db: name={{ drupal_db_name }} state=present
- name: create a new database user for Drupal
mysql_user: name={{ drupal_db_user }} password={{ drupal_db_pass }}
priv="{{ drupal_db_name }}.*:ALL" state=present host={{ hostvars['web-server']['ansible_default_ipv4']['address'] }}

Drupal Role

mkdir -p roles/drupal/tasks
nano roles/drupal/tasks/main.yaml

Related Market Product

Related Products

Related Course

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Understanding Entity Relationship Diagrams

Python built-in functions: open()

Recap: Threat Modelling and Developers

Hyper-V Role Installation, Remote Management, and Storage Configuration

Monorepos for Microservices Part 3: Pipeline Implementation on Jenkins

CS371p Spring 2021: Blog Post 3

AWS S3 usage with Python using Boto3 library

Redis Hotspot Key Discovery and Common Solutions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Use OpenID Connect to Authenticate AWS Account in GitHub Actions

Self managed EFK Setup for 10 billion+ documents

The What, Why, and How of Implementing Microservices Architecture on AWS

Microservices

OpenID Connect: Authentication between AWS and Bitbucket