- name: Install php dependencies apt: pkg: - curl - php - php-cli - php-mbstring - unzip - php-common - php-mysql - php-sqlite3 - php-gd - php-curl - php-json - php-intl - php-bcmath - php-zip - php-apcu - php-mbstring - php-xml - php-soap - name: Check composer installed stat: path: /usr/local/bin/composer register: composer_install_location_stat check_mode: false - name: Download composer get_url: url: https://getcomposer.org/installer dest: /root/composer-setup.php when: not composer_install_location_stat.stat.exists - name: Install composer command: php composer-setup.php --install-dir=/usr/local/bin --filename=composer when: not composer_install_location_stat.stat.exists - name: Ensure composer world read/execute file: path: /usr/local/bin/composer mode: 0755 - name: Change permissions on /var/www file: path: /var/www mode: 0755 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 community.general.composer: 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 & nginx apt: pkg: - php-fpm - nginx - 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:9000 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 line: listen.allowed_clients = 127.0.0.1 notify: restart php-fpm - name: Configure nginx template: src: default-nginx.conf dest: /etc/nginx/sites-available/default notify: restart nginx