aboutsummaryrefslogtreecommitdiff
path: root/host.yml
diff options
context:
space:
mode:
Diffstat (limited to 'host.yml')
-rw-r--r--host.yml17
1 files changed, 11 insertions, 6 deletions
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