diff --git a/drupal/provisioning/playbook.yml b/drupal/provisioning/playbook.yml index 0ae20dba..41e2105c 100644 --- a/drupal/provisioning/playbook.yml +++ b/drupal/provisioning/playbook.yml @@ -7,7 +7,7 @@ pre_tasks: - name: Update apt cache if needed. - apt: update_cache=yes cache_valid_time=3600 + apt: update_cache=yes cache_valid_time=10 handlers: - name: restart apache @@ -21,8 +21,6 @@ - python3-apt - python3-pycurl - - name: Add ondrej repository for later versions of PHP. - apt_repository: repo='ppa:ondrej/php' update_cache=yes - name: "Install Apache, MySQL, PHP, and other dependencies." apt: @@ -34,25 +32,22 @@ - unzip - sendmail - apache2 - - php8.2-common - - php8.2-cli - - php8.2-dev - - php8.2-gd - - php8.2-curl - - php8.2-opcache - - php8.2-xml - - php8.2-mbstring - - php8.2-pdo - - php8.2-mysql - - php8.2-apcu + - php8.3 + - php8.3-cli + - php8.3-dev + - php8.3-gd + - php8.3-curl + - php8.3-opcache + - php8.3-xml + - php8.3-mbstring + - php8.3-pdo + - php8.3-mysql + - php8.3-apcu - libpcre3-dev - - libapache2-mod-php8.2 + - libapache2-mod-php8.3 - python3-mysqldb - mysql-server - - name: Disable the firewall (since this is for local dev only). - service: name=ufw state=stopped - - name: "Start Apache, MySQL, and PHP." service: "name={{ item }} state=started enabled=yes" with_items: @@ -86,21 +81,24 @@ - name: Adjust OpCache memory setting. lineinfile: - dest: "/etc/php/8.2/apache2/conf.d/10-opcache.ini" + dest: "/etc/php/8.3/apache2/conf.d/10-opcache.ini" regexp: "^opcache.memory_consumption" line: "opcache.memory_consumption = 96" state: present notify: restart apache - name: Create a MySQL database for Drupal. - mysql_db: "db={{ domain }} state=present" + community.mysql.mysql_db: + name: "{{ domain }}" + state: present - name: Create a MySQL user for Drupal. - mysql_user: + community.mysql.mysql_user: name: "{{ domain }}" password: "1234" priv: "{{ domain }}.*:ALL" host: localhost + column_case_sensitive: true state: present - name: Download Composer installer. @@ -127,6 +125,14 @@ owner: www-data group: www-data + - name: Set file ownership + file: + path: /var/www + owner: www-data + group: www-data + mode: "0774" + recurse: yes + - name: Check if Drupal project already exists. stat: path: "{{ drupal_core_path }}/composer.json" @@ -144,14 +150,14 @@ - name: Add drush to the Drupal site with Composer. composer: command: require - arguments: drush/drush:11.* + arguments: drush/drush:13.* -W working_dir: "{{ drupal_core_path }}" become_user: www-data when: not drupal_composer_json.stat.exists - name: Install Drupal. command: > - vendor/bin/drush si -y --site-name="{{ drupal_site_name }}" + "{{ drupal_core_path }}/vendor/bin/drush" si -y --site-name="{{ drupal_site_name }}" --account-name=admin --account-pass=admin --db-url=mysql://{{ domain }}:1234@localhost/{{ domain }}