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 # Example: Check if /opt/app exists on remote hosts
- name: Check if /opt/app directory exists - name: Check if /opt/app directory exists
stat: stat:
path: /opt/ansible_workdir path: "{{ ansible_workdir }}""
register: app_dir register: app_dir
- name: Debug app_dir result - name: Debug app_dir result
debug: debug:
msg: "{{ app_dir }} is the place to be" msg: "{{ ansible_workdir }} is the place to be"
- name: Debug app_dir result - name: Debug app_dir result
debug: debug:
@@ -14,7 +14,7 @@
- name: Ensure /opt/app directory exists - name: Ensure /opt/app directory exists
file: file:
path: "{{ app_dir }}" path: "{{ ansible_workdir }}"
state: directory state: directory
owner: root owner: root
group: root group: root
+2 -1
View File
@@ -1,4 +1,5 @@
python_requirements: true python_requirements: true
bsd_nrpe: "nrpe" bsd_nrpe: "nrpe"
centos_nrpe: "nagios-plugins-nrpe.x86_64" centos_nrpe: "nagios-plugins-nrpe.x86_64"
ubuntu_nrpe: "nagios-nrpe-server" ubuntu_nrpe: "nagios-nrpe-server"
ansible_workdir: "/opt/app"