Merge "Ansible bug workaround, fix typo in uri module"

This commit is contained in:
Jenkins 2016-09-02 13:04:25 +00:00 committed by Gerrit Code Review
commit 2f15fa88b4
2 changed files with 5 additions and 20 deletions

View File

@ -78,7 +78,7 @@
- firewall-cmd --reload
ignore_errors: true
become: true
when: firewalld_in_use.rc == 0 and firewalld_is_active.rc == 0 and firewalld_tcp9200_exists.rc != 0 and es_listen_external
when: es_listen_external and firewalld_in_use.rc == 0 and firewalld_is_active.rc == 0 and firewalld_tcp9200_exists.rc != 0
# iptables-services
- name: check firewall rules for TCP/{{es_local_port}} (iptables-services)
@ -96,33 +96,18 @@
regexp: '^INPUT -i lo -j ACCEPT'
insertbefore: '-A INPUT -i lo -j ACCEPT'
backup: yes
when: firewalld_in_use.rc != 0 and firewalld_is_active.rc != 0 and iptables_tcp9200_exists.stdout|int == 0 and es_listen_external
when: es_listen_external and firewalld_in_use.rc != 0 and firewalld_is_active.rc != 0 and iptables_tcp9200_exists.stdout|int == 0
register: iptables_needs_restart
- name: Restart iptables-services for TCP/{{es_local_port}} (iptables-services)
shell: systemctl restart iptables.service
ignore_errors: true
when: iptables_needs_restart != 0 and firewalld_in_use.rc != 0 and firewalld_is_active.rc != 0 and es_listen_external
when: es_listen_external and iptables_needs_restart != 0 and firewalld_in_use.rc != 0 and firewalld_is_active.rc != 0
tags:
# Skip ANSIBLE0013 Use shell only when shell functionality is required
# No systemctl module available in current stable release (Ansible 2.1)
- skip_ansible_lint
# Firewalld
- name: Determine if firewalld is in use
shell: systemctl is-enabled firewalld.service | egrep -qv 'masked|disabled'
ignore_errors: true
register: firewalld_in_use
no_log: true
when: es_listen_external
- name: Determine if firewalld is active
shell: systemctl is-active firewalld.service | grep -vq inactive
ignore_errors: true
register: firewalld_is_active
no_log: true
when: es_listen_external
## end firewall rules ##
- name: Start elasticsearch service

View File

@ -94,8 +94,8 @@
- name: Load filebeat JSON index template
uri:
url: http://localhost:9200/_template/filebeat?pretty
method: post
body: "{{ lookups('file', 'filebeat-index-template.json') }}"
method: POST
body: "{{ lookup('file', 'filebeat-index-template.json') }}"
body_format: json
ignore_errors: true
become: true