Compare commits
8 Commits
24d69d8d66
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b95015c0f | |||
| 58d4ca0cf7 | |||
| a99dbaee07 | |||
| f0a6a7d51a | |||
| 3c2d85f480 | |||
| 56beaa8208 | |||
| 7016ab2464 | |||
| 032cc44c2b |
+19
-35
@@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------TEMPLATES----------------------------------
|
#----------------------------------TEMPLATES----------------------------------
|
||||||
#Only copy template files if there are templates defined in the incoming defintion dict
|
#Only copy template files if there are templates defined in the incoming defintion dict
|
||||||
- set_fact: templates_Defined=0
|
- set_fact: templates_Defined=0
|
||||||
@@ -79,13 +80,9 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: outer_item
|
loop_var: outer_item
|
||||||
when: templates_Defined ==1 and outer_item.value.generic is not defined
|
when: templates_Defined ==1 and outer_item.value.generic is not defined
|
||||||
register: fileChanged
|
|
||||||
tags: always
|
tags: always
|
||||||
- name: Set the flag to restart the container if file was changed
|
register: regular_template
|
||||||
set_fact: containerRestart='yes'
|
notify: Restart container
|
||||||
when: fileChanged is defined and fileChanged.changed
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
#Copy templates form a generic dir, allow ansible to search
|
#Copy templates form a generic dir, allow ansible to search
|
||||||
- name: "Generic template mappings for {{ container_Name }}"
|
- name: "Generic template mappings for {{ container_Name }}"
|
||||||
#Files will be copied to the 'config' dir as defined by container_configDir, they will be stored using their template file name but with the '.j2' stripped
|
#Files will be copied to the 'config' dir as defined by container_configDir, they will be stored using their template file name but with the '.j2' stripped
|
||||||
@@ -95,13 +92,9 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: outer_item
|
loop_var: outer_item
|
||||||
when: templates_Defined ==1 and outer_item.value.generic is defined
|
when: templates_Defined ==1 and outer_item.value.generic is defined
|
||||||
register: fileChanged
|
|
||||||
tags: always
|
tags: always
|
||||||
- name: Set the flag to restart the container if file was changed
|
register: generic_template
|
||||||
set_fact: containerRestart='yes'
|
notify: Restart container
|
||||||
when: fileChanged is defined and fileChanged.changed
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
- name: Append templated files to the mapping list
|
- name: Append templated files to the mapping list
|
||||||
set_fact:
|
set_fact:
|
||||||
#build a list to pass to docker containing the source of the file(As on disk on the host) and the destination mount within the container
|
#build a list to pass to docker containing the source of the file(As on disk on the host) and the destination mount within the container
|
||||||
@@ -141,12 +134,9 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: outer_item
|
loop_var: outer_item
|
||||||
when: files_Defined == 1 and outer_item.value.generic is not defined and outer_item.value.src_text is not defined
|
when: files_Defined == 1 and outer_item.value.generic is not defined and outer_item.value.src_text is not defined
|
||||||
register: fileChanged
|
|
||||||
tags: always
|
|
||||||
- name: Set the flag to restart the container if file was changed
|
|
||||||
set_fact: containerRestart='yes'
|
|
||||||
when: fileChanged is defined and fileChanged.changed
|
|
||||||
tags: always
|
tags: always
|
||||||
|
register: file_copy
|
||||||
|
notify: Restart container
|
||||||
#Copy files from a generic dir, allow ansible to search
|
#Copy files from a generic dir, allow ansible to search
|
||||||
- name: "Generic File mappings for {{ container_Name }}"
|
- name: "Generic File mappings for {{ container_Name }}"
|
||||||
#Files will be copied to the 'config' dir as defined by container_configDir, they will be stored using their file name
|
#Files will be copied to the 'config' dir as defined by container_configDir, they will be stored using their file name
|
||||||
@@ -156,13 +146,9 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: outer_item
|
loop_var: outer_item
|
||||||
when: files_Defined == 1 and outer_item.value.generic is defined and outer_item.value.src_text is not defined
|
when: files_Defined == 1 and outer_item.value.generic is defined and outer_item.value.src_text is not defined
|
||||||
register: fileChanged
|
|
||||||
tags: always
|
tags: always
|
||||||
- name: Set the flag to restart the container if file was changed
|
register: generic_copy
|
||||||
set_fact: containerRestart='yes'
|
notify: Restart container
|
||||||
when: fileChanged is defined and fileChanged.changed
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
#Create files based on the suplied src_text param
|
#Create files based on the suplied src_text param
|
||||||
- name: "Text based file creation for {{ container_Name }}"
|
- name: "Text based file creation for {{ container_Name }}"
|
||||||
#Files will be copied to the 'config' dir as defined by container_configDir, they will be stored using their file name
|
#Files will be copied to the 'config' dir as defined by container_configDir, they will be stored using their file name
|
||||||
@@ -172,12 +158,9 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: outer_item
|
loop_var: outer_item
|
||||||
when: files_Defined == 1 and outer_item.value.src_text is defined
|
when: files_Defined == 1 and outer_item.value.src_text is defined
|
||||||
register: fileChanged
|
|
||||||
tags: always
|
|
||||||
- name: Set the flag to restart the container if file was changed
|
|
||||||
set_fact: containerRestart='yes'
|
|
||||||
when: fileChanged is defined and fileChanged.changed
|
|
||||||
tags: always
|
tags: always
|
||||||
|
register: text_copy
|
||||||
|
notify: Restart container
|
||||||
|
|
||||||
- name: Append static remote files to the mapping list
|
- name: Append static remote files to the mapping list
|
||||||
set_fact:
|
set_fact:
|
||||||
@@ -218,14 +201,7 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: outer_item
|
loop_var: outer_item
|
||||||
when: local_Defined == 1
|
when: local_Defined == 1
|
||||||
register: fileChanged
|
|
||||||
tags: always
|
tags: always
|
||||||
|
|
||||||
- name: Set the flag to restart the container if file was changed
|
|
||||||
set_fact: containerRestart='yes'
|
|
||||||
when: fileChanged is defined and fileChanged.changed
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
#----------------------------------/LOCAL----------------------------------
|
#----------------------------------/LOCAL----------------------------------
|
||||||
|
|
||||||
|
|
||||||
@@ -267,9 +243,17 @@
|
|||||||
network_mode: "{{ item.value.network_mode | default ('default') }}"
|
network_mode: "{{ item.value.network_mode | default ('default') }}"
|
||||||
shm_size: "{{ item.value.shm_size | default ('64M') }}"
|
shm_size: "{{ item.value.shm_size | default ('64M') }}"
|
||||||
ports: "{{ item.value.ports | default ([]) }}"
|
ports: "{{ item.value.ports | default ([]) }}"
|
||||||
|
cpu_period: "{{ item.value.cpu_period | default(0) }}"
|
||||||
|
cpu_quota: "{{ item.value.cpu_quota | default(0) }}"
|
||||||
|
cpu_shares: "{{ item.value.cpu_shares | default(0) }}"
|
||||||
|
cpus: "{{ item.value.cpus | default(0) }}"
|
||||||
|
cpuset_cpus: "{{ item.value.cpuset_cpus | default('') }}"
|
||||||
|
mem_limit: "{{ item.value.mem_limit | default(0) }}"
|
||||||
|
mem_reservation: "{{ item.value.mem_reservation | default(0) }}"
|
||||||
#log_driver: fluentd
|
#log_driver: fluentd
|
||||||
#"{{item.value.ports | default ([json-file])}}"
|
#"{{item.value.ports | default ([json-file])}}"
|
||||||
#log_options:
|
#log_options:
|
||||||
# fluentd-sub-second-precision: true
|
# fluentd-sub-second-precision: true
|
||||||
# tag: myservice
|
# tag: myservice
|
||||||
tags: always
|
tags: always
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user