提交初版
This commit is contained in:
@@ -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 }}"
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
- include: init.yml
|
||||
when: operation == 'install'
|
||||
- include: check.yml
|
||||
Reference in New Issue
Block a user