diff --git a/roles/typo3-cms/handlers/main.yaml b/roles/typo3-cms/handlers/main.yaml new file mode 100644 index 0000000..51d716a --- /dev/null +++ b/roles/typo3-cms/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: restart php-fpm + systemd: + name: php8.1-fpm + state: restarted diff --git a/roles/typo3-cms/tasks/main.yaml b/roles/typo3-cms/tasks/main.yaml index 039394b..215b20f 100644 --- a/roles/typo3-cms/tasks/main.yaml +++ b/roles/typo3-cms/tasks/main.yaml @@ -24,6 +24,7 @@ stat: path: /usr/local/bin/composer register: composer_install_location_stat + check_mode: false - name: Download composer get_url: @@ -47,6 +48,12 @@ owner: www-data group: www-data +- name: Check project exists + stat: + path: /var/www/atlantishq-cms/ + register: project_stat + check_mode: false + - name: Install typo3 cms become: true become_user: www-data @@ -54,3 +61,29 @@ command: create-project arguments: "typo3/cms-base-distribution:^12 atlantishq-cms" working_dir: /var/www/ + when: not project_stat.stat.exists + +- name: Install php-fpm + apt: + pkg: + - php-fpm + +- name: Configure php-fpm listen + lineinfile: + path: /etc/php/8.1/fpm/pool.d/www.conf + regex: ^listen = .*$ + line: listen = 0.0.0.0:8080 + +- name: Configure php-fpm listen allowed clients + lineinfile: + path: /etc/php/8.1/fpm/pool.d/www.conf + regex: ^listen = .*$ + line: listen = 0.0.0.0:8080 + notify: restart php-fpm + +- name: Configure php-fpm listen allowed clients + lineinfile: + path: /etc/php/8.1/fpm/pool.d/www.conf + regex: ^;*listen.allowed_clients = .*$ + line: listen.allowed_clients = 192.168.122.1 + notify: restart php-fpm