From 0fd430f4c1aa1593e8993c7f3717264a95279d76 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 1 Sep 2017 18:25:31 +0200 Subject: [PATCH 1/5] Change the tasks execution order. --- d4s_user_services_perms/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d4s_user_services_perms/tasks/main.yml b/d4s_user_services_perms/tasks/main.yml index 1dde899e..de7de2da 100644 --- a/d4s_user_services_perms/tasks/main.yml +++ b/d4s_user_services_perms/tasks/main.yml @@ -1,12 +1,12 @@ --- +- include: d4s-basic-node.yml + when: gcore_node or d4s_additional_users - include: d4s-smartgears-node.yml when: smartgears_node - include: d4s-tomcat-node.yml when: d4s_tomcat_node - include: d4s-service-node.yml when: d4s_service_node -- include: d4s-basic-node.yml - when: gcore_node or d4s_additional_users - include: users-data-dirs.yml when: d4s_users_data_directories is defined - include: security_limits.yml From 0e9276fe23401d89438cccd01e4a82ff9339725d Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 1 Sep 2017 19:03:56 +0200 Subject: [PATCH 2/5] Fix a typo. --- nginx/tasks/nginx-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/tasks/nginx-config.yml b/nginx/tasks/nginx-config.yml index 10ced7cb..6edd9d53 100644 --- a/nginx/tasks/nginx-config.yml +++ b/nginx/tasks/nginx-config.yml @@ -4,7 +4,7 @@ file: dest={{ nginx_snippets_dir }} state=directory - name: Create the pki directory - file: dest={{ {{ pki_dir }}/nginx }} state=directory + file: dest={{ pki_dir }}/nginx state=directory - name: Create a dhparams file 2048 bits long shell: openssl dhparam -out {{ pki_dir }}/nginx/dhparams.pem 2048 From d0879ec7550fa431553459d1e8205425cae6eda6 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 1 Sep 2017 19:09:24 +0200 Subject: [PATCH 3/5] catalina.properties is now a template in the tomcat-multiple-instances role. --- tomcat-multiple-instances/tasks/main.yml | 11 +++++++++++ .../catalina.properties.j2} | 7 +++++++ 2 files changed, 18 insertions(+) rename tomcat-multiple-instances/{files/catalina.properties => templates/catalina.properties.j2} (97%) diff --git a/tomcat-multiple-instances/tasks/main.yml b/tomcat-multiple-instances/tasks/main.yml index b469515a..59ba45cd 100644 --- a/tomcat-multiple-instances/tasks/main.yml +++ b/tomcat-multiple-instances/tasks/main.yml @@ -66,6 +66,17 @@ - tomcat restart instances with changed configs tags: [ 'tomcat', 'tomcat_instances' ] +- name: Install catalina.properties + template: src={{ item[1] }}.j2 dest={{ item.0.instance_path }}/conf/{{ item[1] }} owner={{ item.0.user }} group={{ item.0.user }} mode=0640 + with_nested: + - '{{ tomcat_m_instances }}' + - [ 'catalina.properties' ] + register: restart_needed + notify: + - tomcat restart instances with changed configs + tags: [ 'tomcat', 'tomcat_instances', 'tomcat_catalina_properties' ] + + - name: Populate the instances conf/policy.d directory copy: src=policy.d/{{ item[1] }} dest={{ item.0.instance_path }}/conf/policy.d/{{ item[1] }} owner={{ item.0.user }} group={{ item.0.user }} mode=0640 with_nested: diff --git a/tomcat-multiple-instances/files/catalina.properties b/tomcat-multiple-instances/templates/catalina.properties.j2 similarity index 97% rename from tomcat-multiple-instances/files/catalina.properties rename to tomcat-multiple-instances/templates/catalina.properties.j2 index a3bb7bc4..bc1d2045 100644 --- a/tomcat-multiple-instances/files/catalina.properties +++ b/tomcat-multiple-instances/templates/catalina.properties.j2 @@ -126,3 +126,10 @@ tomcat.util.buf.StringCache.byte.enabled=true #tomcat.util.buf.StringCache.char.enabled=true #tomcat.util.buf.StringCache.trainThreshold=500000 #tomcat.util.buf.StringCache.cacheSize=5000 + +{% if tomcat_m_catalina_opts is defined %} +# Custom configurations +{% for opt in tomcat_m_catalina_opts %} +{{ opt }} +{% endfor %} +{% endif %} From b6e4b89965b4fa093381baf533648a92f8fb3fce Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 1 Sep 2017 19:30:54 +0200 Subject: [PATCH 4/5] Fix a typo. --- tomcat-multiple-instances/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tomcat-multiple-instances/tasks/main.yml b/tomcat-multiple-instances/tasks/main.yml index 59ba45cd..ee42680e 100644 --- a/tomcat-multiple-instances/tasks/main.yml +++ b/tomcat-multiple-instances/tasks/main.yml @@ -60,7 +60,7 @@ copy: src={{ item[1] }} dest={{ item.0.instance_path }}/conf/{{ item[1] }} owner={{ item.0.user }} group={{ item.0.user }} mode=0640 with_nested: - '{{ tomcat_m_instances }}' - - [ 'catalina.properties', 'context.xml', 'tomcat-users.xml', 'web.xml' ] + - [ 'context.xml', 'tomcat-users.xml', 'web.xml' ] register: restart_needed notify: - tomcat restart instances with changed configs From 9a779358c423161582f3087ab1b92dacc2217ca3 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 2 Sep 2017 17:15:03 +0200 Subject: [PATCH 5/5] python-env role: Add a task that permits to install specific versions of pip packages. --- python-env/tasks/main.yml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/python-env/tasks/main.yml b/python-env/tasks/main.yml index b675ca12..074cad3f 100644 --- a/python-env/tasks/main.yml +++ b/python-env/tasks/main.yml @@ -12,20 +12,6 @@ apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 with_items: '{{ py_pip_deps | default([]) }}' - - name: Fix the ssl warnings installing some ssl libraries - pip: name={{ item }} - with_items: '{{ py_env_pip_fix_ssl_warnings | default ([]) }}' - when: - - not py_env_trusty_workaround - - is_trusty - - - name: Install a list of pip packages - pip: name={{ item }} - with_items: '{{ py_env_pip_pkgs | default ([]) }}' - when: - - not py_env_trusty_workaround - - is_trusty - when: py_env_install tags: [ "python", "py_env" ] @@ -51,6 +37,13 @@ - name: Install setuptools version 33.1.1 pip: name=setuptools version=33.1.1 state=present + when: + - py_env_trusty_workaround + - py_env_install + - is_trusty + tags: [ "python", "py_env" ] + +- block: - name: Fix the ssl warnings installing some ssl libraries pip: name={{ item }} with_items: '{{ py_env_pip_fix_ssl_warnings | default ([]) }}' @@ -59,8 +52,9 @@ pip: name={{ item }} with_items: '{{ py_env_pip_pkgs | default ([]) }}' - when: - - py_env_trusty_workaround - - py_env_install - - is_trusty - tags: [ "python", "py_env" ] + - name: Install a list of versioned pip packages + pip: name={{ item.pkg }} version={{ item.version }} + with_items: '{{ py_env_versioned_pip_pkgs | default ([]) }}' + + when: py_env_install + tags: [ "python", "py_env", "py_env_pkgs" ]