add comment, add run datadiode python
This commit is contained in:
parent
6342cc01ae
commit
6d5116104b
|
@ -3,6 +3,11 @@
|
|||
hosts: All_server
|
||||
become: yes # برای اجرای دستورات با دسترسی ریشه
|
||||
tasks:
|
||||
- name: Update all packages
|
||||
zypper:
|
||||
name: '*'
|
||||
state: latest
|
||||
|
||||
- name: Install Git
|
||||
zypper:
|
||||
name: git
|
||||
|
@ -17,3 +22,9 @@
|
|||
zypper:
|
||||
name: libgthread-2_0-0
|
||||
state: present
|
||||
|
||||
- name: Symlink /usr/local/bin/python to python3.11
|
||||
become: yes
|
||||
ansible.builtin.command:
|
||||
cmd: ln -sfn /usr/bin/python3.11 /usr/local/bin/python
|
||||
creates: /usr/local/bin/python
|
|
@ -5,7 +5,10 @@
|
|||
vars:
|
||||
git_username: tester
|
||||
git_password: Datall@0000
|
||||
app_path: /opt/DataDiodeRServer
|
||||
venv_path: "{{ app_path }}/.env"
|
||||
tasks:
|
||||
#section clone in git
|
||||
- name: Remove existing DataDiodeRServer directory
|
||||
file:
|
||||
path: /opt/DataDiodeRServer
|
||||
|
@ -22,7 +25,26 @@
|
|||
owner: datall
|
||||
group: users
|
||||
state: directory
|
||||
|
||||
#section active python and install requirements
|
||||
- name: Create a Python 3 venv
|
||||
ansible.builtin.command:
|
||||
cmd: python3 -m venv "{{ venv_path }}"
|
||||
args:
|
||||
creates: "{{ venv_path }}/bin/activate"
|
||||
|
||||
- name: Upgrade pip & setuptools inside the venv
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ venv_path }}/bin/python -m pip install --upgrade pip setuptools"
|
||||
|
||||
- name: Install requirements into the venv
|
||||
ansible.builtin.pip:
|
||||
requirements: "{{ app_path }}/requirements.txt"
|
||||
virtualenv: "{{ venv_path }}"
|
||||
virtualenv_command: python3 -m venv
|
||||
virtualenv_site_packages: no
|
||||
|
||||
#section copy scripts to path
|
||||
- name: Copy all scripts from scripts directory to /usr/sbin
|
||||
copy:
|
||||
src: /opt/DataDiodeRServer/scripts/
|
||||
|
@ -32,7 +54,7 @@
|
|||
mode: '0755'
|
||||
recurse: yes
|
||||
|
||||
|
||||
#section copy systemd file enable and start
|
||||
- name: Copy datadiode.service to /etc/systemd/system/
|
||||
copy:
|
||||
src: /opt/DataDiodeRServer/service/datadiode.service
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
become: yes # برای اجرای دستورات با دسترسی ریشه
|
||||
vars:
|
||||
git_username: tester
|
||||
git_password: Datall@0000
|
||||
git_password: Datall@0000\
|
||||
app_path: /opt/DataDiodeTServer
|
||||
venv_path: "{{ app_path }}/.env"
|
||||
tasks:
|
||||
#section clone in git
|
||||
- name: Remove existing DataDiodeTServer directory
|
||||
file:
|
||||
path: /opt/DataDiodeTServer
|
||||
|
@ -22,7 +25,25 @@
|
|||
owner: datall
|
||||
group: users
|
||||
state: directory
|
||||
|
||||
#section active python and install requirements
|
||||
- name: Create a Python 3 venv
|
||||
ansible.builtin.command:
|
||||
cmd: python3 -m venv "{{ venv_path }}"
|
||||
args:
|
||||
creates: "{{ venv_path }}/bin/activate"
|
||||
|
||||
- name: Upgrade pip & setuptools inside the venv
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ venv_path }}/bin/python -m pip install --upgrade pip setuptools"
|
||||
|
||||
- name: Install requirements into the venv
|
||||
ansible.builtin.pip:
|
||||
requirements: "{{ app_path }}/requirements.txt"
|
||||
virtualenv: "{{ venv_path }}"
|
||||
virtualenv_command: python3 -m venv
|
||||
virtualenv_site_packages: no
|
||||
|
||||
#section copy scripts to path
|
||||
- name: Copy all scripts from scripts directory to /usr/sbin
|
||||
copy:
|
||||
src: /opt/DataDiodeRServer/scripts/
|
||||
|
@ -32,7 +53,7 @@
|
|||
mode: '0755'
|
||||
recurse: yes
|
||||
|
||||
|
||||
#section copy systemd file enable and start
|
||||
- name: Copy datadiode.service to /etc/systemd/system/
|
||||
copy:
|
||||
src: /opt/DataDiodeTServer/service/datadiode.service
|
||||
|
|
Loading…
Reference in New Issue
Block a user