From 43cb1293d179f411c65c901c92370bb543a2866b Mon Sep 17 00:00:00 2001 From: Giancarlo Razzolini <grazzolini@archlinux.org> Date: Mon, 10 Feb 2020 11:13:46 -0300 Subject: [PATCH] common: Add a maintenance_remote_machine variable Add a variable that takes the SSH_CLIENT environment variable to save the ip address of the machine actually running the playbooks. This can be used on maintenance mode to allow in the person running the playbook and let everybody else to see the maintenance page. --- group_vars/all/common.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/group_vars/all/common.yml b/group_vars/all/common.yml index b89dbf0ab..56a6bf870 100644 --- a/group_vars/all/common.yml +++ b/group_vars/all/common.yml @@ -6,3 +6,7 @@ ansible_python_interpreter: /usr/bin/python3 zabbix_agent_templates: - Template OS Linux + +# this is used by the maintenance role to get the ip address +# of the machine running the playbook +maintenance_remote_machine: "{{ hostvars[inventory_hostname]['ansible_env'].SSH_CLIENT.split(' ')[0] }}" -- GitLab