Add retries to all tasks with external deps
The tasks with external deps should all have a retry so to cater for cases of intermittent service interruptions. This change adds retires and tags to of the tasks with external deps. Change-Id: Icd0a8143347bcbffc2a1e0a02da92091b59ed483 Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
778002714c
commit
cf78fd744d
@ -17,15 +17,33 @@
|
|||||||
apt_key:
|
apt_key:
|
||||||
url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
|
url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
|
||||||
state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
|
state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: enable apt-transport-https
|
- name: enable apt-transport-https
|
||||||
apt:
|
apt:
|
||||||
name: apt-transport-https
|
name: apt-transport-https
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: add elk repo to apt sources list
|
- name: add elk repo to apt sources list
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: "{{ elk_repo.repo }}"
|
repo: "{{ elk_repo.repo }}"
|
||||||
state: "{{ elk_repo.state }}"
|
state: "{{ elk_repo.state }}"
|
||||||
filename: "{{ elk_repo.filename | default(omit) }}"
|
filename: "{{ elk_repo.filename | default(omit) }}"
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
@ -25,6 +25,12 @@
|
|||||||
url: "https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz"
|
url: "https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz"
|
||||||
dest: "/opt/go1.10.1.linux-amd64.tar.gz"
|
dest: "/opt/go1.10.1.linux-amd64.tar.gz"
|
||||||
checksum: "sha256:72d820dec546752e5a8303b33b009079c15c2390ce76d67cf514991646c6127b"
|
checksum: "sha256:72d820dec546752e5a8303b33b009079c15c2390ce76d67cf514991646c6127b"
|
||||||
|
register: _get_task
|
||||||
|
until: _get_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: Create go directory
|
- name: Create go directory
|
||||||
file:
|
file:
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
update_cache: true
|
update_cache: true
|
||||||
with_items:
|
with_items:
|
||||||
- apm-server
|
- apm-server
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- audispd-plugins
|
- audispd-plugins
|
||||||
- auditbeat
|
- auditbeat
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
@ -41,6 +41,12 @@
|
|||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
extra_args: --isolated
|
extra_args: --isolated
|
||||||
virtualenv: /opt/elasticsearch-curator
|
virtualenv: /opt/elasticsearch-curator
|
||||||
|
register: _pip_task
|
||||||
|
until: _pip_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: exit playbook after uninstall
|
- name: exit playbook after uninstall
|
||||||
meta: end_play
|
meta: end_play
|
||||||
|
@ -71,6 +71,12 @@
|
|||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
install_recommends: yes
|
install_recommends: yes
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- include_tasks: common_task_install_elk_repo.yml
|
- include_tasks: common_task_install_elk_repo.yml
|
||||||
|
|
||||||
@ -79,6 +85,12 @@
|
|||||||
name: elasticsearch
|
name: elasticsearch
|
||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: Drop elasticsearch conf file
|
- name: Drop elasticsearch conf file
|
||||||
template:
|
template:
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
update_cache: true
|
update_cache: true
|
||||||
with_items:
|
with_items:
|
||||||
- filebeat
|
- filebeat
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
name: "heartbeat-elastic"
|
name: "heartbeat-elastic"
|
||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
@ -35,6 +35,10 @@
|
|||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
with_items:
|
with_items:
|
||||||
- git
|
- git
|
||||||
- libsystemd-dev
|
- libsystemd-dev
|
||||||
|
@ -19,6 +19,12 @@
|
|||||||
- nginx
|
- nginx
|
||||||
- apache2-utils
|
- apache2-utils
|
||||||
- python-passlib
|
- python-passlib
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: create kibana user to access web interface
|
- name: create kibana user to access web interface
|
||||||
htpasswd:
|
htpasswd:
|
||||||
@ -44,6 +50,12 @@
|
|||||||
name: kibana
|
name: kibana
|
||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: Drop kibana conf file
|
- name: Drop kibana conf file
|
||||||
template:
|
template:
|
||||||
|
@ -59,12 +59,24 @@
|
|||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
install_recommends: yes
|
install_recommends: yes
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: Ensure Logstash is installed
|
- name: Ensure Logstash is installed
|
||||||
apt:
|
apt:
|
||||||
name: logstash
|
name: logstash
|
||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
|
tags:
|
||||||
|
- package_install
|
||||||
|
|
||||||
- name: Drop Logstash conf for beats input
|
- name: Drop Logstash conf for beats input
|
||||||
template:
|
template:
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
name: metricbeat
|
name: metricbeat
|
||||||
state: "{{ elk_package_state | default('present') }}"
|
state: "{{ elk_package_state | default('present') }}"
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- tcpdump
|
- tcpdump
|
||||||
- packetbeat
|
- packetbeat
|
||||||
|
register: _apt_task
|
||||||
|
until: _apt_task is success
|
||||||
|
retries: 3
|
||||||
|
delay: 2
|
||||||
tags:
|
tags:
|
||||||
- package_install
|
- package_install
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user