From 44292f15a489d08624112e411b73f9887b76f35e Mon Sep 17 00:00:00 2001 From: Stefan Horning Date: Wed, 6 Dec 2023 11:47:34 +0100 Subject: [PATCH] nginx and nginx-extras apt packages cannot be installed at the same time (on newer Ubuntus), added condition to only pick one --- defaults/main.yml | 2 ++ tasks/nginx-installation.yml | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 8160158..f155e87 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,6 +5,8 @@ nginx_distribution: nginx nginx_conf_dir: /etc/nginx +nginx_extras_package_install: true + nginx_repo: "deb http://nginx.org/packages/ubuntu {{ ansible_distribution_release }} nginx" nginx_binary_name: nginx diff --git a/tasks/nginx-installation.yml b/tasks/nginx-installation.yml index 79c8c18..5edefab 100644 --- a/tasks/nginx-installation.yml +++ b/tasks/nginx-installation.yml @@ -3,6 +3,14 @@ ansible.builtin.apt: name: - nginx + state: present + when: not nginx_extras_package_install + tags: [packages, nginx] + +- name: Install the nginx-extras package + ansible.builtin.apt: + name: - nginx-extras state: present + when: nginx_extras_package_install tags: [packages, nginx]