From e53c324dae5957a99f6ecbb0ad88246c204da42f Mon Sep 17 00:00:00 2001 From: spmfox Date: Thu, 15 May 2025 17:16:45 -0400 Subject: Updating readme, documentation, and a localhost warning - formalizing changes made for remote runs --- host.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'host.yml') diff --git a/host.yml b/host.yml index af0d4a8..f859cd3 100644 --- a/host.yml +++ b/host.yml @@ -1,13 +1,18 @@ - hosts: localhost gather_facts: false + vars: + tasks: - - name: Add localhost to all group if no hosts are defined - ansible.builtin.add_host: - name: "localhost" - ansible_connection: "local" + - name: Block for localhost run + block: + - ansible.builtin.pause: + prompt: "Warning - no hosts were given, this will run on localhost - hit enter to continue or ctrl-c to cancel" + + - name: Add localhost to all group if no hosts are defined + ansible.builtin.add_host: + name: "localhost" + ansible_connection: "local" when: groups['all'] | length == 0 - tags: - - always - hosts: all -- cgit