diff --git a/docker/Dockerfile b/docker/Dockerfile index 32d243d..db3bbff 100755 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,12 +14,15 @@ RUN mkdir -p /var/run/sshd /var/log/supervisor \ && echo 'ansible ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # Install base system packages in a single layer +RUN apt-get update && apt-get upgrade -y && apt-get install -y \ +# Core system RUN apt-get update && apt-get upgrade -y && apt-get install -y \ # Core system ca-certificates \ gnupg \ lsb-release \ apt-transport-https \ + software-properties-common \ # SSH and system control openssh-server \ sudo \ diff --git a/playbooks/lemp-wordpress-ultimate.yml b/playbooks/lemp-wordpress-ultimate.yml index 4868c86..1b520af 100755 --- a/playbooks/lemp-wordpress-ultimate.yml +++ b/playbooks/lemp-wordpress-ultimate.yml @@ -88,10 +88,16 @@ cache_valid_time: 3600 tags: packages - - name: Add PHP PPA for Ubuntu 24.04+ (needed for PHP 8.4) + - name: Install gnupg for PPA + package: + name: gnupg + state: present + tags: packages + + - name: Add PHP PPA for Ubuntu (needed for PHP 8.4) apt_repository: repo: ppa:ondrej/php - when: ansible_distribution == "Ubuntu" and ansible_distribution_version is version("24", ">=") + when: ansible_distribution == "Ubuntu" tags: packages - name: Install all required packages diff --git a/playbooks/lemp-wordpress.yml b/playbooks/lemp-wordpress.yml index f3e396a..037d688 100755 --- a/playbooks/lemp-wordpress.yml +++ b/playbooks/lemp-wordpress.yml @@ -91,16 +91,16 @@ cache_valid_time: 3600 tags: packages + - name: Install gnupg for PPA (required for apt-add-repository) + package: + name: gnupg + state: present + tags: packages + - name: Add PHP PPA for Ubuntu (needed for PHP 8.4) apt_repository: repo: ppa:ondrej/php - when: ansible_os_family == "Debian" and ansible_distribution_version is version("24", ">=") - tags: packages - - - name: Add PHP PPA for Ubuntu 24.04+ (needed for PHP 8.4) - apt_repository: - repo: ppa:ondrej/php - when: ansible_distribution == "Ubuntu" and ansible_distribution_version is version("24", ">=") + when: ansible_distribution == "Ubuntu" tags: packages - name: Install all required packages diff --git a/vars/debian-family.yml b/vars/debian-family.yml index cd54782..86aa8b3 100755 --- a/vars/debian-family.yml +++ b/vars/debian-family.yml @@ -18,6 +18,8 @@ packages: - unzip - fail2ban - ufw + - gnupg + - software-properties-common # Service names mysql_service: mariadb