workdir variable

This commit is contained in:
2025-11-21 17:03:25 +01:00
parent 2414a92ea1
commit 0f6117a004
2 changed files with 5 additions and 4 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
# Example: Check if /opt/app exists on remote hosts
- name: Check if /opt/app directory exists
stat:
path: /opt/ansible_workdir
path: "{{ ansible_workdir }}""
register: app_dir
- name: Debug app_dir result
debug:
msg: "{{ app_dir }} is the place to be"
msg: "{{ ansible_workdir }} is the place to be"
- name: Debug app_dir result
debug:
@@ -14,7 +14,7 @@
- name: Ensure /opt/app directory exists
file:
path: "{{ app_dir }}"
path: "{{ ansible_workdir }}"
state: directory
owner: root
group: root