[lint] satisfy ansible-lint

This commit is contained in:
bronsen 2025-03-03 23:54:15 +01:00
parent e98d2fc075
commit a78aeb031e
2 changed files with 37 additions and 30 deletions

View file

@ -13,7 +13,7 @@
cache_valid_time: 3600 cache_valid_time: 3600
handlers: handlers:
- name: restart apache - name: Restart apache
ansible.builtin.service: ansible.builtin.service:
name: apache2 name: apache2
state: restarted state: restarted
@ -76,7 +76,7 @@
community.general.apache2_module: community.general.apache2_module:
name: rewrite name: rewrite
state: present state: present
notify: restart apache notify: Restart apache
- name: Add Apache virtualhost for Drupal. - name: Add Apache virtualhost for Drupal.
ansible.builtin.template: ansible.builtin.template:
@ -85,19 +85,19 @@
owner: root owner: root
group: root group: root
mode: "0664" mode: "0664"
notify: restart apache notify: Restart apache
- name: Enable Drupal site. - name: Enable Drupal site.
ansible.builtin.command: > ansible.builtin.command:
a2ensite {{ domain }}.test cmd: a2ensite {{ domain }}.test
creates=/etc/apache2/sites-enabled/{{ domain }}.test.conf creates: /etc/apache2/sites-enabled/{{ domain }}.test.conf
notify: restart apache notify: Restart apache
- name: Disable the default site. - name: Disable the default site.
ansible.builtin.command: > ansible.builtin.command:
a2dissite 000-default cmd: a2dissite 000-default
removes=/etc/apache2/sites-enabled/000-default.conf removes: /etc/apache2/sites-enabled/000-default.conf
notify: restart apache notify: Restart apache
- name: Adjust OpCache memory setting. - name: Adjust OpCache memory setting.
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@ -105,7 +105,7 @@
regexp: "^opcache/memory_consumption" regexp: "^opcache/memory_consumption"
line: "opcache.memory_consumption = 96" line: "opcache.memory_consumption = 96"
state: present state: present
notify: restart apache notify: Restart apache
- name: Create a MySQL database for Drupal. - name: Create a MySQL database for Drupal.
community.mysql.mysql_db: community.mysql.mysql_db:
@ -126,6 +126,7 @@
state: directory state: directory
owner: www-data owner: www-data
group: www-data group: www-data
mode: "755"
- name: Check if Drupal project already exists. - name: Check if Drupal project already exists.
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ drupal_core_path }}/composer.json" path: "{{ drupal_core_path }}/composer.json"
@ -138,6 +139,7 @@
working_dir: "{{ drupal_core_path }}" working_dir: "{{ drupal_core_path }}"
no_dev: true no_dev: true
become_user: www-data become_user: www-data
become: true
when: not drupal_composer_json.stat.exists when: not drupal_composer_json.stat.exists
- name: Ensure cache dir is writable by www-data. - name: Ensure cache dir is writable by www-data.
@ -154,16 +156,19 @@
arguments: "drush/drush" arguments: "drush/drush"
working_dir: "{{ drupal_core_path }}" working_dir: "{{ drupal_core_path }}"
become_user: www-data become_user: www-data
become: true
when: not drupal_composer_json.stat.exists when: not drupal_composer_json.stat.exists
- name: Install Drupal - name: Install Drupal
ansible.builtin.command: > ansible.builtin.command:
vendor/bin/drush si -y --site-name="{{ drupal_site_name }}" argv:
--account-name=admin - vendor/bin/drush si -y --site-name="{{ drupal_site_name }}"
--account-pass=admin - --account-name=admin
--db-url=mysql://{{ domain }}:1234@localhost/{{ domain }} - --account-pass=admin
--root={{ drupal_core_path }}/web - --db-url=mysql://{{ domain }}:1234@localhost/{{ domain }}
chdir={{ drupal_core_path }} - --root={{ drupal_core_path }}/web
creates={{ drupal_core_path }}/web/sites/default/settings.php chdir: "{{ drupal_core_path }}"
notify: restart apache creates: "{{ drupal_core_path }}/web/sites/default/settings.php"
notify: Restart apache
become_user: www-data become_user: www-data
become: true

View file

@ -23,6 +23,7 @@
url: "https://archive.apache.org/dist/lucene/solr/{{ solr_version }}/solr-{{ solr_version }}.tgz" url: "https://archive.apache.org/dist/lucene/solr/{{ solr_version }}/solr-{{ solr_version }}.tgz"
dest: "{{ download_dir }}/solr-{{ solr_version }}.tgz" dest: "{{ download_dir }}/solr-{{ solr_version }}.tgz"
checksum: "{{ solr_checksum }}" checksum: "{{ solr_checksum }}"
mode: "644"
- name: Expand Solr archive. - name: Expand Solr archive.
ansible.builtin.unarchive: ansible.builtin.unarchive:
@ -32,15 +33,16 @@
creates: "{{ download_dir }}/solr-{{ solr_version }}/README.txt" creates: "{{ download_dir }}/solr-{{ solr_version }}/README.txt"
- name: Run Solr installation script. - name: Run Solr installation script.
ansible.builtin.command: > ansible.builtin.command:
{{ download_dir }}/solr-{{ solr_version }}/bin/install_solr_service.sh argv:
{{ download_dir }}/solr-{{ solr_version }}.tgz - "{{ download_dir }}/solr-{{ solr_version }}/bin/install_solr_service.sh"
-i /opt - "{{ download_dir }}/solr-{{ solr_version }}.tgz"
-d /var/solr - -i /opt
-u solr - -d /var/solr
-s solr - -u solr
-p 8983 - -s solr
creates={{ solr_dir }}/bin/solr - -p 8983
creates: "{{ solr_dir }}/bin/solr"
- name: Ensure Solr is started and enabled on boot. - name: Ensure Solr is started and enabled on boot.
ansible.builtin.service: ansible.builtin.service: