library/roles/ssh-keys/tasks/non-root-ssh-keys.yml: do not try to install ssh keys if they do not exist.

library/roles/tomcat-multiple-instances/handlers/main.yml: Ignore errors.
This commit is contained in:
Andrea Dell'Amico 2015-10-01 17:56:38 +02:00
parent 5e6ddbf01a
commit f0f94260c5
4 changed files with 24 additions and 14 deletions

View File

@ -1,13 +1,13 @@
---
- name: Install the ssh keys for non root users
authorized_key: user={{ item.0.name }} key="{{ item.1 }}" state=present
when: non_root_users
when:
- authorized_keys is defined
- non_root_users
with_subelements:
- ssh_users_list
- authorized_keys
tags:
- pubkeys
- ssh_keys
tags: [ "pubkeys", "ssh_keys" ]
- name: Remove obsolete ssh keys if there are any
authorized_key: user={{ item.0.name }} key="{{ item.1 }}" state=absent
@ -17,7 +17,4 @@
with_subelements:
- ssh_users_list
- authorized_keys
tags:
- pubkeys
- ssh_keys
tags: [ "pubkeys", "ssh_keys" ]

View File

@ -30,6 +30,8 @@ tomcat_m_java_gc_opts: "-XX:+UseConcMarkSweepGC"
tomcat_m_other_java_opts: ""
tomcat_m_webapps_autodeploy: False
tomcat_m_webapps_unpack: False
tomcat_m_start_instances: True
tomcat_m_enable_instances: True
# JMX and debugging
tomcat_m_enable_remote_debugging: False

View File

@ -3,21 +3,26 @@
service: name=tomcat-instance-'{{ item.item.http_port }}' state=restarted sleep=20
with_items: restart_needed.results
when: item.changed
ignore_errors: True
- name: tomcat restart instances with changed jmx config
service: name=tomcat-instance-'{{ item.item.http_port }}' state=restarted sleep=20
with_items: jmx_restart_needed.results
when: item.changed
ignore_errors: True
- name: tomcat instances restart
service: name=tomcat-instance-'{{ item.http_port }}' state=restarted sleep=20
with_items: tomcat_m_instances
ignore_errors: True
- name: enable tomcat instances
service: name=tomcat-instance-'{{ item.http_port }}' state=started enabled=yes sleep 20
with_items: tomcat_m_instances
ignore_errors: True
- name: disable tomcat instances
service: name=tomcat-instance-'{{ item.http_port }}' state=stopped enabled=no sleep 20
with_items: tomcat_m_instances
ignore_errors: True

View File

@ -166,11 +166,17 @@
- tomcat restart instances with changed jmx config
tags: [ 'tomcat', 'tomcat_instances', 'tomcat_jmx' ]
- name: Start and enable all the tomcat instances
service: name=tomcat-instance-'{{ item.http_port }}' state=started sleep=20 enabled=yes
- name: Start all the tomcat instances
service: name=tomcat-instance-'{{ item.http_port }}' state=started sleep=20
with_items: tomcat_m_instances
when: tomcat_first_install.changed
tags:
- tomcat
- tomcat_instances
when:
- tomcat_first_install.changed
- tomcat_m_start_instances
tags: [ 'tomcat', 'tomcat_instances']
ignore_errors: True
- name: Enable all the tomcat instances
service: name=tomcat-instance-'{{ item.http_port }}' enabled=yes
with_items: tomcat_m_instances
when: tomcat_m_enable_instances
tags: [ 'tomcat', 'tomcat_instances']