|
| 1 | +--- |
| 2 | +- name: Ensuring config directories exist |
| 3 | + file: |
| 4 | + path: "{{ node_config_directory }}/{{ item.key }}" |
| 5 | + state: "directory" |
| 6 | + owner: "{{ config_owner_user }}" |
| 7 | + group: "{{ config_owner_group }}" |
| 8 | + mode: "0770" |
| 9 | + become: true |
| 10 | + when: |
| 11 | + - inventory_hostname in groups[item.value.group] |
| 12 | + - item.value.enabled | bool |
| 13 | + with_dict: "{{ caso_services }}" |
| 14 | + |
| 15 | +- name: Copying over config.json files for services |
| 16 | + template: |
| 17 | + src: "{{ item.key }}.json.j2" |
| 18 | + dest: "{{ node_config_directory }}/{{ item.key }}/config.json" |
| 19 | + mode: "0660" |
| 20 | + become: true |
| 21 | + register: caso_config_jsons |
| 22 | + when: |
| 23 | + - inventory_hostname in groups[item.value.group] |
| 24 | + - item.value.enabled | bool |
| 25 | + with_dict: "{{ caso_services }}" |
| 26 | + notify: |
| 27 | + - Restart caso container |
| 28 | + |
| 29 | +- name: Copying over caso config |
| 30 | + merge_configs: |
| 31 | + sources: |
| 32 | + - "{{ role_path }}/templates/caso.conf.j2" |
| 33 | + - "{{ node_custom_config }}//caso/caso.conf" |
| 34 | + - "{{ node_custom_config }}/{{ item.key }}/{{ inventory_hostname }}/caso.conf" |
| 35 | + dest: "{{ node_config_directory }}/{{ item.key }}/caso.conf" |
| 36 | + mode: "0660" |
| 37 | + become: true |
| 38 | + register: caso_conf |
| 39 | + when: |
| 40 | + - inventory_hostname in groups[item.value.group] |
| 41 | + - item.value.enabled | bool |
| 42 | + with_dict: "{{ caso_services }}" |
| 43 | + notify: |
| 44 | + - Restart caso container |
| 45 | + |
| 46 | +- name: Copying over caso crontab |
| 47 | + template: |
| 48 | + src: "{{ role_path }}/templates/caso.crontab.j2" |
| 49 | + dest: "{{ node_config_directory }}/{{ item.key }}/caso.crontab" |
| 50 | + mode: "0660" |
| 51 | + become: true |
| 52 | + register: caso_crontab |
| 53 | + when: |
| 54 | + - inventory_hostname in groups[item.value.group] |
| 55 | + - item.value.enabled | bool |
| 56 | + with_dict: "{{ caso_services }}" |
| 57 | + notify: |
| 58 | + - Restart caso container |
| 59 | + |
| 60 | +- name: Copying over caso voms file |
| 61 | + template: |
| 62 | + src: "{{ role_path }}/templates/voms.json.j2" |
| 63 | + dest: "{{ node_config_directory }}/{{ item.key }}/voms.json" |
| 64 | + mode: "0660" |
| 65 | + become: true |
| 66 | + register: caso_vom_conf |
| 67 | + when: |
| 68 | + - inventory_hostname in groups[item.value.group] |
| 69 | + - item.value.enabled | bool |
| 70 | + with_dict: "{{ caso_services }}" |
| 71 | + notify: |
| 72 | + - Restart caso container |
| 73 | + |
| 74 | +- name: Check caso containers |
| 75 | + become: true |
| 76 | + kolla_docker: |
| 77 | + action: "compare_container" |
| 78 | + common_options: "{{ docker_common_options }}" |
| 79 | + name: "{{ item.value.container_name }}" |
| 80 | + image: "{{ item.value.image }}" |
| 81 | + volumes: "{{ item.value.volumes }}" |
| 82 | + dimensions: "{{ item.value.dimensions }}" |
| 83 | + register: check_caso_containers |
| 84 | + when: |
| 85 | + - kolla_action != "config" |
| 86 | + - inventory_hostname in groups[item.value.group] |
| 87 | + - item.value.enabled | bool |
| 88 | + with_dict: "{{ caso_services }}" |
| 89 | + notify: |
| 90 | + - Restart caso container |
0 commit comments