From 670a98fa2a48f09c640f0cadd82c8ea4b89b6732 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 8 Mar 2016 10:58:57 +0100 Subject: [PATCH] library/roles: Ansible 2 compatibility. --- .../tasks/d4s-smartgears-node.yml | 4 +- oracle-jdk/tasks/main.yml | 37 ++++++++----------- postgresql/templates/pcp.conf.j2 | 1 + tomcat-multiple-instances/tasks/main.yml | 2 +- 4 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 postgresql/templates/pcp.conf.j2 diff --git a/d4s_user_services_perms/tasks/d4s-smartgears-node.yml b/d4s_user_services_perms/tasks/d4s-smartgears-node.yml index 1edc1bfc..53055ec6 100644 --- a/d4s_user_services_perms/tasks/d4s-smartgears-node.yml +++ b/d4s_user_services_perms/tasks/d4s-smartgears-node.yml @@ -26,12 +26,12 @@ - name: Set the read/write permissions on the tomcat default options files acl: name=/etc/default/tomcat-instance-{{ item.http_port }} entity={{ item.user }} etype=user permissions=rw state=present - with_items: tomcat_m_instances + with_items: '{{ tomcat_m_instances }}' tags: [ 'tomcat', 'd4science', 'acl' ] - name: Set the read/write permissions on the tomcat default local options files acl: name=/etc/default/tomcat-instance-{{ item.http_port }}.local entity={{ item.user }} etype=user permissions=rw state=present - with_items: tomcat_m_instances + with_items: '{{ tomcat_m_instances }}' tags: [ 'tomcat', 'd4science', 'acl' ] ignore_errors: True diff --git a/oracle-jdk/tasks/main.yml b/oracle-jdk/tasks/main.yml index c1cbde15..411df8e2 100644 --- a/oracle-jdk/tasks/main.yml +++ b/oracle-jdk/tasks/main.yml @@ -1,55 +1,48 @@ --- - name: setup the Oracle JDK repository on ubuntu - apt_repository: repo='ppa:webupd8team/java' state=present + apt_repository: repo='ppa:webupd8team/java' state=present update_cache=yes when: is_ubuntu - register: update_apt_cache - tags: jdk + tags: [ 'oracle_jdk', 'jdk' ] - name: setup the Oracle JDK repository on debian - apt_repository: repo='deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' state=present + apt_repository: repo='deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' state=present update_cache=yes when: is_debian - register: update_apt_cache - tags: jdk + tags: [ 'oracle_jdk', 'jdk' ] - name: Accept the Oracle Java license debconf: name='oracle-java{{ item }}-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select' - with_items: jdk_version - tags: jdk - -- name: Update the apt cache - apt: update_cache=yes - when: update_apt_cache.changed or jdk_pkg_state == 'latest' - tags: jdk + with_items: '{{ jdk_version }}' + tags: [ 'oracle_jdk', 'jdk' ] - name: Install the latest version of Oracle JDK apt: pkg={{ item }} state={{ jdk_pkg_state }} force=yes when: not jdk_use_tarfile - with_items: oracle_jdk_packages - tags: jdk + with_items: '{{ oracle_jdk_packages }}' + tags: [ 'oracle_jdk', 'jdk' ] - name: Install the extended security JCE Oracle JDK package apt: pkg=oracle-java{{ item }}-unlimited-jce-policy state={{ jdk_pkg_state }} force=yes - with_items: jdk_version + with_items: '{{ jdk_version }}' when: - not jdk_use_tarfile - jdk_install_strong_encryption_policy - tags: jdk + tags: [ 'oracle_jdk', 'jdk' ] - name: Set the JDK default via update-alternatives apt: pkg=oracle-java{{ item }}-set-default state={{ jdk_pkg_state }} force=yes - with_items: jdk_default + with_items: '{{ jdk_default }}' when: - not jdk_use_tarfile - jdk_default is defined notify: Set the default Oracle JDK - tags: jdk + tags: [ 'oracle_jdk', 'jdk' ] - name: Install a custom version of Oracle JDK from a tar file unarchive: src={{ jdk_tarfile }} dest={{ jdk_java_home_prefix }} - when: jdk_use_tarfile - tags: jdk + when: '{{ jdk_use_tarfile }}' + tags: [ 'oracle_jdk', 'jdk' ] - name: Set fact jdk_installed set_fact: jdk_installed=True - tags: jdk + tags: [ 'oracle_jdk', 'jdk' ] diff --git a/postgresql/templates/pcp.conf.j2 b/postgresql/templates/pcp.conf.j2 new file mode 100644 index 00000000..e4506de6 --- /dev/null +++ b/postgresql/templates/pcp.conf.j2 @@ -0,0 +1 @@ +{{ pgpool_pcp_user }}:{{ '{{ pcp_pwd }}' | hash('md5') }} diff --git a/tomcat-multiple-instances/tasks/main.yml b/tomcat-multiple-instances/tasks/main.yml index a7a635fc..0c1c38e1 100644 --- a/tomcat-multiple-instances/tasks/main.yml +++ b/tomcat-multiple-instances/tasks/main.yml @@ -28,7 +28,7 @@ - name: Create the instances directory trees file: dest={{ item.0.instance_path }}/{{ item[1] }} owner={{ item.0.user }} group={{ item.0.user }} mode=0755 state=directory with_nested: - - tomcat_m_instances + - '{{ tomcat_m_instances }}' - [ 'common/classes', 'conf/Catalina/localhost', 'conf/policy.d', 'lib', 'server/classes', 'shared/classes', 'webapps' ] register: tomcat_first_install tags: [ 'tomcat', 'tomcat_instances' ]