diff --git a/thredds/tasks/main.yml b/thredds/tasks/main.yml index 48abfb27..51d91f4a 100644 --- a/thredds/tasks/main.yml +++ b/thredds/tasks/main.yml @@ -17,12 +17,23 @@ file: path={{ thredds_data_content_dir }} state=directory owner={{ item.user }} group={{ item.user }} with_items: '{{ tomcat_m_instances }}' + - name: Check if the configuration files were already initialized with our versions + stat: path={{ thredds_data_content_dir }}/thredds/.conf_initialized + register: thredds_skip_conf + tags: [ 'thredds', 'tomcat', 'thredds_conf' ] + - name: Install the Thredds configuration files - template: src={{ item }}.j2 dest={{ thredds_data_content_dir }}/thredds/{{ item }} mode=444 + template: src={{ item }}.j2 dest={{ thredds_data_content_dir }}/thredds/{{ item }} owner={{ item.user }} group={{ item.user }} mode=644 with_items: - threddsConfig.xml - catalog.xml notify: tomcat instances restart + when: not thredds_skip_conf.stat.exists + tags: [ 'thredds', 'tomcat', 'thredds_conf' ] + + - name: Create the file that states that the thredds instance has been configured + copy: content="initialized by ansible" dest={{ thredds_data_content_dir }}/thredds/.conf_initialized mode=0400 + register: thredds_skip_conf tags: [ 'thredds', 'tomcat', 'thredds_conf' ] - name: Get the thredds war file