Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created April 9, 2018 18:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmsimard/d42cf5b281e6e6839f73756e6ab6b5a4 to your computer and use it in GitHub Desktop.
Save dmsimard/d42cf5b281e6e6839f73756e6ab6b5a4 to your computer and use it in GitHub Desktop.
ara_loop
- name: Create many hosts
hosts: localhost
gather_facts: no
tasks:
- name: Add one host
add_host:
ansible_connection: local
hostname: "{{ item }}"
groups: many
with_sequence: start=0 end=1024 format=host%02x
- name: Gather facts on many hosts
hosts: many
gather_facts: no
tasks:
- name: Run the setup module
setup:
- name: Finished
debug:
msg: "{{ inventory_hostname }} is finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment