Modularize oracle-db-postinstall role tasks
- Split main.yml into modular files: scripts.yml, backup.yml, services.yml - Use include_tasks for better organization and maintainability - Group related tasks by functionality - Improve code readability and reusability
This commit is contained in:
32
roles/oracle-db-postinstall/tasks/scripts.yml
Normal file
32
roles/oracle-db-postinstall/tasks/scripts.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
#
|
||||
# Gestion des scripts SQL pour Oracle
|
||||
#
|
||||
|
||||
- name: Gérer le repository des scripts SQL
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/Yacine31/sql.git
|
||||
dest: "{{ scripts_dir }}"
|
||||
update: yes
|
||||
force: yes
|
||||
become: true
|
||||
become_method: su
|
||||
become_user: oracle
|
||||
register: git_result
|
||||
failed_when: git_result.failed and 'already exists' not in git_result.msg
|
||||
tags: scripts
|
||||
|
||||
- name: Changement du propriétaire des scripts
|
||||
ansible.builtin.file:
|
||||
dest: "{{ scripts_dir }}"
|
||||
owner: oracle
|
||||
group: oinstall
|
||||
recurse: yes
|
||||
tags: scripts
|
||||
|
||||
- name: Ajout de la variable ORACLE_PATH dans .bash_profile
|
||||
ansible.builtin.lineinfile:
|
||||
path: /home/oracle/.bash_profile
|
||||
line: "export ORACLE_PATH={{ scripts_dir }}"
|
||||
create: yes
|
||||
tags: oraclepath
|
||||
Reference in New Issue
Block a user