Files
tower-tests/file-creation-single.yml

51 lines
903 B
YAML

---
- name: Create inventory based on passed extra_vars
hosts: localhost
gather_facts: no
become: no
vars_files:
- vars/defaults.yml
vars:
lab_tower_hosts:
- lab-dev-1
- lab-dev-2
- lab-prod-1
- lab-prod-2
provision_host : "{{ tower_provision_host | default(lab_tower_hosts | random) }}"
tasks:
- name: "Create in-memory inventory for {{ provision_host }}"
add_host:
name: "{{ provision_host }}"
groups:
- remdiation
# =========================================================================== #
- 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 }}"
ignore_errors: yes
...