--- - name: Get software for apt repository management. apt: state: present name: - python3-apt - python3-pycurl - python3-pymysql - name: Add ondrej repository for later versions of PHP. apt_repository: repo: "ppa:ondrej/php" update_cache: yes #sudo dpkg -l | grep php | tee packages.txt #sudo apt install apt-transport-https lsb-release ca-certificates wget -y #sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg #sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' #sudo apt update - name: "Install Apache, MySQL, PHP, and other dependencies." apt: state: present name: - acl - git - curl - wget - unzip - openssl - redis-server - mariadb-server - libpcre3-dev - apache2 - "libapache2-mod-php" - "php{{ php_version }}" - "php{{ php_version }}-imagick" - "php{{ php_version }}-common" - "php{{ php_version }}-curl" - "php{{ php_version }}-gd" - "php{{ php_version }}-imap" - "php{{ php_version }}-intl" - "php{{ php_version }}-json" - "php{{ php_version }}-mbstring" - "php{{ php_version }}-gmp" - "php{{ php_version }}-bcmath" - "php{{ php_version }}-mysql" - "php{{ php_version }}-ssh2" - "php{{ php_version }}-xml" - "php{{ php_version }}-zip" - "php{{ php_version }}-apcu" - "php{{ php_version }}-redis" - "php{{ php_version }}-ldap" #- "php{{ php_version }}-smbclient" - php-phpseclib - bzip2 - rsync - jq - inetutils-ping - ldap-utils - smbclient - cron #- name: Disable the firewall (since this is behind a firewall) # service: name=ufw state=stopped - name: "Start Apache, MySQL, and PHP." service: "name={{ item }} state=started enabled=yes" with_items: - apache2 - mysql