提交初版

This commit is contained in:
qidaijie
2024-02-22 10:53:59 +08:00
parent b368a1e16a
commit f8c919d9d0
416 changed files with 10167 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
- name: Set arangodb check variable
set_fact:
pin: "root:{{ arangodb_default_pin }}"
- name: Check if collection exists in ArangoDB
uri:
url: "http://{{ groups.arangodb[0] }}:8529/_db/{{ arangodb_database }}/_api/collection/{{ item }}"
method: GET
headers:
Authorization: Basic {{ pin | b64encode }}
loop: "{{ arangodb_collections }}"

View File

@@ -0,0 +1,21 @@
- name: Creating directory
file:
state: directory
path: '{{ deploy_dir }}/{{ container_name }}/init'
- name: Copying init files
template:
src: "create_database.sh.j2"
dest: "{{ deploy_dir }}/{{ container_name }}/init/create_database.sh"
mode: 0755
force: true
- name: Creating database and collection
shell: 'cd {{ deploy_dir }}/{{ container_name }}/init && sh create_database.sh'
register: response
until: response.rc == 0
retries: 3
delay: 3
failed_when: response.rc != 0
run_once: true

View File

@@ -0,0 +1,3 @@
- include: init.yml
when: operation == 'install'
- include: check.yml