Skip to content

Commit

Permalink
Increase yum lock timeout (workaround) (hitachienergy#1879)
Browse files Browse the repository at this point in the history
* common: add yum lock_timeout (fix)

* docker: add yum lock_timeout (fix)

* elasticsearch: add yum lock_timeout (fix)

* elasticsearch_curator: add yum lock_timeout (fix)

* filebeat: add yum lock_timeout (fix)

* firewall: add yum lock_timeout (fix)

* grafana: add yum lock_timeout (fix)

* kafka: add yum lock_timeout (fix)

* kibana: add yum lock_timeout (fix)

* kubernetes_common: add yum lock_timeout (fix)

* logstash: add yum lock_timeout (fix)

* opendistro_for_elasticsearch: add yum lock_timeout (fix)

* postgresql: add yum lock_timeout (fix)

* repository: add yum lock_timeout (fix)

* upgrade: add yum lock_timeout (fix)

* zookeeper: add yum lock_timeout (fix)

* group_vars: make yum_lock_timeout configurable

* Update 0.10 changelog

* group_vars: coding-style adjustment
  • Loading branch information
sk4zuzu authored and sbbroot committed Aug 17, 2021
1 parent dfc3bbb commit 9030c2a
Show file tree
Hide file tree
Showing 44 changed files with 241 additions and 226 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-0.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [#1908](https://github.com/epiphany-platform/epiphany/issues/1908) - Research why Epiphany nodes hang when memory is overcommited
- [#1979](https://github.com/epiphany-platform/epiphany/issues/1979) - RabbitMQ fails on upgrade when 2 nodes are specified that are not clustered
- [#1984](https://github.com/epiphany-platform/epiphany/issues/1984) - RabbitMQ 3.7.10 fails on upgrade to 3.8.9: 'rabbitmqctl version' command not found
- [#1824](https://github.com/epiphany-platform/epiphany/issues/1824) - offline installation fails with error 'yum lockfile is held by another process' (Azure/RHEL)

### Updated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ image_registry_address: "{{ custom_image_registry_address | default(local_image_
kubeconfig:
local: "{{ inventory_dir }}/kubeconfig"
remote: /etc/kubernetes/admin.conf

# https://github.com/ansible/ansible/issues/57189
yum_lock_timeout: 300
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
name:
- build-essential
- python-selinux
update_cache: yes
update_cache: true
state: present
register: result
retries: 3
delay: 1
until: result is succeeded

- name: Install Debian family packages
apt:
Expand Down Expand Up @@ -36,8 +40,11 @@
- tmux
- unzip
- vim
update_cache: yes
state: present
register: result
retries: 3
delay: 1
until: result is succeeded

- name: Append prompt to .profile
lineinfile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

- name: Install the latest version of ca-certificates package
yum:
name: ca-certificates
name:
- ca-certificates
update_cache: true
state: latest
register: result
retries: 3
delay: 1
until: result is succeeded

- name: Install RedHat family packages
yum:
Expand Down Expand Up @@ -36,7 +42,6 @@
- vim
- yum-utils
- yum-versionlock
update_cache: yes
state: present
register: result
retries: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

# Common main as the entry point

- include_tasks: "{{ ansible_os_family }}.yml"
- name: Execute OS-specific tasks (common)
block:
- include_tasks: "{{ ansible_os_family }}.yml"
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- name: Print environment variables
debug:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@

- name: Install Docker packages
package:
name: "{{ packages[ansible_os_family] }}"
name: "{{ _packages[ansible_os_family] }}"
state: present
vars:
packages:
RedHat:
- containerd.io
- docker-ce-cli-{{ docker_version.RedHat }}
- docker-ce-{{ docker_version.RedHat }}
_packages:
Debian:
- containerd.io
- docker-ce-cli={{ docker_version.Debian }}
- docker-ce={{ docker_version.Debian }}
- containerd.io
- docker-ce-cli={{ docker_version.Debian }}
- docker-ce={{ docker_version.Debian }}
RedHat:
- containerd.io
- docker-ce-cli-{{ docker_version.RedHat }}
- docker-ce-{{ docker_version.RedHat }}
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- include_tasks: configure-docker.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
# splitted to separate tasks to make it work on Debian/Ubuntu:
# https://github.com/elastic/elasticsearch/issues/33607#issue-359124678

- name: Install Elasticsearch prerequisites
apt:
name:
- openjdk-8-jre-headless
update_cache: true
state: present

- name: Install Elasticsearch package
apt:
name:
- elasticsearch-oss={{ specification.elasticsearch_version }}
state: present
register: install_elasticsearch_package
register: install_elasticsearch_package
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
- name: Install Elasticsearch package
yum:
name:
- java-1.8.0-openjdk-headless
- elasticsearch-oss-{{ specification.elasticsearch_version }}
update_cache: yes
update_cache: true
state: present
exclude: elasticsearch-oss-7* # v7 is installed by opendistro_for_elasticsearch role
register: install_elasticsearch_package
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
- { limit_type: 'soft', limit_item: 'memlock', value: unlimited }
- { limit_type: 'hard', limit_item: 'memlock', value: unlimited }

- name: Install Elasticsearch ({{ ansible_os_family }})
include_tasks: "{{ ansible_os_family }}.yml"
- name: Execute OS-specific tasks (elasticsearch)
block:
- include_tasks: "{{ ansible_os_family }}.yml"
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
---
# This file is meant to be also used by upgrade playbook

- name: Install Elasticsearch Curator ({{ ansible_os_family }})
include_tasks: "{{ ansible_os_family }}.yml"
- name: Install Elasticsearch-Curator package
package:
name: "{{ _packages[ansible_os_family] }}"
state: present
vars:
_packages:
Debian:
- elasticsearch-curator={{ specification.curator_version }}
RedHat:
- elasticsearch-curator-{{ specification.curator_version }}
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
---
# This file is meant to be also used by upgrade playbook

- name: Install Filebeat ({{ ansible_os_family }})
include_tasks: "{{ ansible_os_family }}.yml"
- name: Install Filebeat package
package:
name: "{{ _packages[ansible_os_family] }}"
state: present
vars:
_packages:
Debian:
- filebeat={{ filebeat_version }}
RedHat:
- filebeat-{{ filebeat_version }}
register: install_filebeat_package
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- name: Install Auditd package
package:
name: "{{ _packages[ansible_os_family] }}"
state: present
vars:
_packages:
Debian:
- auditd
RedHat:
- audit
register: install_auditd_package
until: install_auditd_package is success
retries: 3 # Installing auditd sometimes fails in post-inst: https://bugs.launchpad.net/ubuntu/+source/auditd/+bug/1848330
delay: 1
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- name: Install firewalld package
block:
- name: Install firewalld package
package:
apt:
name: firewalld
state: present
register: install_firewalld
Expand All @@ -42,4 +42,4 @@
when:
- install_firewalld.changed
when:
- specification.Debian.install_firewalld
- specification.Debian.install_firewalld
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Install firewalld package
package:
yum:
name: firewalld
state: present
state: present
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
- name: Include installation tasks ({{ ansible_os_family }})
include_tasks: "{{ ansible_os_family }}/install-firewall.yml"
- name: Execute OS-specific tasks (firewall)
block:
- include_tasks: "{{ ansible_os_family }}/install-firewall.yml"
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- name: Include configuration tasks
include_tasks: configure-firewall.yml
include_tasks: configure-firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- grafana={{ grafana_version }}
RedHat:
- grafana-{{ grafana_version }}
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- name: Recursively chown /etc/grafana (fix permissions)
file:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Setup group
group:
name: "{{ specification.kafka_var.group }}"
Expand All @@ -12,18 +11,18 @@
group: "{{ specification.kafka_var.group }}"
shell: "/usr/sbin/nologin"


- name: Install Java package
package:
name: "java-1.8.0-openjdk-headless"
name: "{{ _packages[ansible_os_family] }}"
state: present
when: ansible_os_family == "RedHat"

- name: Install Java package
package:
name: "openjdk-8-jre-headless"
state: present
when: ansible_os_family == "Debian"
vars:
_packages:
Debian:
- openjdk-8-jre-headless
RedHat:
- java-1.8.0-openjdk-headless
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- name: Set Kafka file name to install
set_fact:
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@
file: roles/opendistro_for_elasticsearch/defaults/main.yml
name: opendistro_for_elasticsearch_defaults

- name: Include Kibana package installation task
include_tasks: "{{ ansible_os_family }}.yml"
- name: Install Kibana package
package:
name: "{{ _packages[ansible_os_family] }}"
state: present
vars:
kibana_package_version: "{{ opendistro_for_elasticsearch_defaults.versions[ansible_os_family].opendistro }}"
_kibana_version: >-
{{ opendistro_for_elasticsearch_defaults.versions[ansible_os_family].opendistro }}
_packages:
Debian:
- opendistroforelasticsearch-kibana={{ _kibana_version }}
RedHat:
- opendistroforelasticsearch-kibana-{{ _kibana_version }}
module_defaults:
yum: { lock_timeout: "{{ yum_lock_timeout }}" }

- name: Update Kibana configuration file
template:
Expand Down

This file was deleted.

Loading

0 comments on commit 9030c2a

Please sign in to comment.