start od deployment
This commit is contained in:
@@ -0,0 +1 @@
|
||||
psutil
|
||||
@@ -0,0 +1,36 @@
|
||||
# Example: Check if /opt/app exists on remote hosts
|
||||
- name: Check if /opt/app directory exists
|
||||
stat:
|
||||
path: /opt/ansible_workdir
|
||||
register: app_dir
|
||||
|
||||
- name: Debug app_dir result
|
||||
debug:
|
||||
var: app_dir.stat.exists
|
||||
|
||||
- name: Ensure /opt/app directory exists
|
||||
file:
|
||||
path: {{ app_dir.stat.path }}
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
when: app_dir.stat.exists == false
|
||||
|
||||
- name: Ensure python requirements file is present
|
||||
ansible.builtin.copy:
|
||||
src: requirements.txt
|
||||
dest: "{{ app_dir.stat.path }}/requirements.txt"
|
||||
mode: '0644'
|
||||
when: app_dir.stat.exists == true and python_requirements is defined
|
||||
|
||||
- name: Install specified python requirements
|
||||
ansible.builtin.pip:
|
||||
requirements: "{{ app_dir.stat.path }}/requirements.txt"
|
||||
when: app_dir.stat.exists == true and python_requirements is defined
|
||||
|
||||
- name: Deploy custom Nagios/NRPE script
|
||||
ansible.builtin.copy:
|
||||
src: memory_usage_check.py
|
||||
dest: /usr/local/nagios/libexec/my_custom_check.py
|
||||
mode: '0755'
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
python_requirements: true
|
||||
Reference in New Issue
Block a user