workdir variable
This commit is contained in:
@@ -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,3 +2,4 @@ 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"
|
||||||
Reference in New Issue
Block a user