Files
tower-tests/file-creation-single.yml
2022-05-03 12:19:13 -04:00

46 lines
808 B
YAML

---
- name: Create inventory based on passed extra_vars
hosts: all
gather_facts: no
become: no
vars_files:
- vars/defaults.yml
vars:
provision_host: "{{ tower_provision_host | default(ansible_play_hosts | random) }}"
tasks:
- name: "Create in-memory inventory for {{ provision_host }}"
add_host:
name: "{{ provision_host }}"
groups:
- remdiation
delegate_to: localhost
# =========================================================================== #
- name: Create a test file on remediation group
hosts: remdiation
gather_facts: no
become: no
vars_files:
- vars/defaults.yml
tasks:
- name: "Test #1 - Copy file to machine"
copy:
src : files/hello-ansible.txt
dest : "{{ check_file }}"
...