Ansible Script 추가

This commit is contained in:
ByeonJungHun
2023-12-19 13:36:16 +09:00
parent 0273450ff6
commit 05cb8d9269
2610 changed files with 281893 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
---
- name: "Create datasaker local directory"
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{datasaker_docker_user}}"
group: "{{datasaker_docker_group}}"
mode: '0755'
with_items:
- "{{ datasaker_docker_path }}/agent/dsk-postgres-agent"
- "{{ datasaker_docker_path }}/agent/dsk-plan-postgres-agent"
- name: "Create agent config"
ansible.builtin.file:
path: "{{ datasaker_docker_path }}/dsk-docker-postgres-config.yml"
state: touch
- name: "Setting dsk-postgres-agent config"
template:
src: docker-postgres-agent-config.yml.j2
dest: "{{ datasaker_docker_path }}/dsk-docker-postgres-config.yml"
- name: "Create agent config"
ansible.builtin.file:
path: "{{ datasaker_docker_path }}/dsk-docker-plan-postgres-config.yml"
state: touch
- name: "Setting plan-dsk-postgres-agent config"
template:
src: docker-plan-postgres-agent-config.yml.j2
dest: "{{ datasaker_docker_path }}/dsk-docker-plan-postgres-config.yml"
- name: "Run dsk-postgres-agent container"
docker_container:
name: dsk-docker-postgres-agent
image: "datasaker/dsk-postgres-agent:{{ postgres_agent_image_tag }}"
state: started
restart_policy: "{{ postgres_agent_restart_policy }}"
detach: true
env:
DKS_LOG_LEVEL: "info"
DATA_SOURCE_USER: "{{ postgres_user_name | default('') }}"
DATA_SOURCE_PASS: "{{ postgres_user_password | default('') }}"
DATA_SOURCE_URI: "{{ postgres_database_address | default('') }}:{{ postgres_database_port | default('') }}?sslmode=disable"
volumes:
- "{{ datasaker_docker_path }}:/var/datasaker/"
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
- "{{ datasaker_docker_path }}/dsk-docker-postgres-config.yml:/etc/datasaker/dsk-postgres-agent/agent-config.yml:ro"
- name: "Run dsk-plan-postgres-agent container"
docker_container:
name: dsk-docker-plan-postgres-agent
image: "datasaker/dsk-plan-postgres-agent:{{ plan_postgres_agent_image_tag }}"
state: started
restart_policy: "{{ plan_postgres_agent_restart_policy }}"
detach: true
env:
DKS_LOG_LEVEL: "info"
volumes:
- "{{ datasaker_docker_path }}:/var/datasaker/"
- "{{ datasaker_docker_global_config }}:/etc/datasaker/global-config.yml:ro"
- "{{ datasaker_docker_path }}/dsk-docker-plan-postgres-config.yml:/etc/datasaker/dsk-plan-postgres-agent/agent-config.yml:ro"