Skip to content

Commit

Permalink
More stylistic updates and fix retries not working
Browse files Browse the repository at this point in the history
 - You need until: for retries to work (oops)
 - Change more key=value syntax into colon syntax
  • Loading branch information
xenithorb committed Sep 26, 2016
1 parent a1ecf90 commit 4e98980
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
15 changes: 10 additions & 5 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
---
# handlers/main.yml: Handlers for RocketChat.Ansible
- name: Reload the Nginx service
service: name=nginx state=reloaded
service:
name: nginx
state: reloaded

- name: Restart the MongoDB service
service: name=mongod state=restarted
service:
name: mongod
state: restarted

- name: Upgrade Rocket.Chat
include: upgrade.yml
when: rocket_chat_deploy_state.stat.exists
tags:
- upgrade
tags: upgrade

- name: Update the Rocket.Chat service configuration
shell: "{{ rocket_chat_service_update_command }}"
when: rocket_chat_service_update_command is defined

- name: Restart the Rocket.Chat service
service: name=rocketchat state=restarted
service:
name: rocketchat
state: restarted
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
package:
name: "{{ rocket_chat_dep_packages }}"
state: present
register: result
until: result | succeeded
retries: 2

- name: Ensure link /bin/node -> /bin/nodejs exists
Expand Down Expand Up @@ -104,7 +106,8 @@
become: true
become_user: "{{ rocket_chat_service_user }}"
register: result
retries: 3
retries: 2
until: result | succeeded
changed_when: (result|changed)
or (not rocket_chat_tarball_check_checksum)

Expand Down
8 changes: 4 additions & 4 deletions tasks/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
- name: Grant Nginx permissions to proxy requests to an upstream [SELinux]
shell: setsebool httpd_can_network_connect on -P
changed_when: false
when: (ansible_selinux is defined) and
(ansible_selinux.status != "disabled")
when: ansible_selinux.status == "enabled"

- name: Ensure Nginx is present
package:
Expand All @@ -25,8 +24,9 @@
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
when: not rocket_chat_ssl_generate_certs|bool and
rocket_chat_ssl_deploy_data|bool
when:
- not rocket_chat_ssl_generate_certs|bool
- rocket_chat_ssl_deploy_data|bool
with_items:
- src: "{{ rocket_chat_ssl_key_file }}"
dest: "{{ rocket_chat_ssl_key_path }}"
Expand Down

0 comments on commit 4e98980

Please sign in to comment.