From 91e7bff55ade7a006311326297be95de4b9c52fb Mon Sep 17 00:00:00 2001 From: Byron Sommardahl Date: Wed, 23 Oct 2024 15:40:50 -0500 Subject: [PATCH] Moving port to play level. --- util/ansible/deploy.yml | 2 ++ util/ansible/roles/configure-server/tasks/main.yml | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/util/ansible/deploy.yml b/util/ansible/deploy.yml index 5bc11df..69adceb 100644 --- a/util/ansible/deploy.yml +++ b/util/ansible/deploy.yml @@ -2,6 +2,8 @@ - name: Update web servers hosts: ec2 gather_facts: false + environment: + backend_port: 80 roles: - configure-server - deploy-artifact \ No newline at end of file diff --git a/util/ansible/roles/configure-server/tasks/main.yml b/util/ansible/roles/configure-server/tasks/main.yml index 1eaef1d..b264314 100644 --- a/util/ansible/roles/configure-server/tasks/main.yml +++ b/util/ansible/roles/configure-server/tasks/main.yml @@ -25,7 +25,4 @@ dest: "/etc/environment" state: present regexp: "^PORT=" - line: "PORT=80" - -- name: Source the environment file - shell: "source /etc/environment" \ No newline at end of file + line: "PORT={{ backend_port }}"