28 lines
710 B
YAML
28 lines
710 B
YAML
---
|
|
- name: Deploy standardized utils stack
|
|
hosts: docker_hosts
|
|
become: yes
|
|
gather_facts: yes
|
|
vars:
|
|
utils_path: /home/docker/appdata/utils
|
|
host_ip: "{{ ansible_default_ipv4.address }}"
|
|
host_name: "{{ inventory_hostname }}"
|
|
|
|
tasks:
|
|
- name: Create utils directory
|
|
file:
|
|
path: "{{ utils_path }}"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Create .env file
|
|
copy:
|
|
dest: "{{ utils_path }}/.env"
|
|
content: |
|
|
HOST_IP={{ host_ip }}
|
|
HOST_NAME={{ host_name }}
|
|
mode: '0600'
|
|
|
|
- name: Display completion
|
|
debug:
|
|
msg: "Utils directory created at {{ utils_path }} for {{ inventory_hostname }}"
|