Skip to content

Commit

Permalink
Reapply Lumada-specific changes (hitachienergy#3407)
Browse files Browse the repository at this point in the history
* Reapply Lumada-specific changes

* Add retries and delay variables to shared_config

* Add net-ssh gem package

* Update docs
  • Loading branch information
sbbroot authored and przemyslavic committed Nov 15, 2023
1 parent 413912e commit 3b6d85a
Show file tree
Hide file tree
Showing 24 changed files with 265 additions and 175 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RUN : INSTALL APT REQUIREMENTS \
&& aws --version \
\
&& : INSTALL GEM REQUIREMENTS \
&& gem install net-ssh -v 6.1.0 \
&& gem install \
bcrypt_pbkdf ed25519 rake rspec_junit_formatter serverspec \
\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ data:
## Set to "hostname" to use pod hostnames.
## When this value is changed, so should the variable used to set the RABBITMQ_NODENAME
## environment variable.
cluster_formation.k8s.address_type = ip
cluster_formation.k8s.address_type = hostname
cluster_formation.k8s.hostname_suffix = .{{ rabbitmq_service_name }}.{{ namespace_name }}.svc.cluster.local
## How often should node cleanup checks run?
cluster_formation.node_cleanup.interval = 30
## Set to false if automatic removal of unknown/absent nodes
Expand Down Expand Up @@ -120,9 +121,6 @@ spec:
fieldPath: status.podIP
- name: RABBITMQ_USE_LONGNAME
value: "true"
# See a note on cluster_formation.k8s.address_type in the config file section
- name: RABBITMQ_NODENAME
value: "rabbit@$(MY_POD_IP)"
- name: K8S_SERVICE_NAME
value: "{{ rabbitmq_service_name }}"
- name: RABBITMQ_ERLANG_COOKIE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
apt:
name: "elasticsearch-curator={{ curator_version }}"
state: present
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
name: ufw
state: absent
purge: true
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"

- name: Install firewalld package
block:
Expand All @@ -22,6 +26,9 @@
name: firewalld
state: present
register: install_firewalld
until: install_firewalld is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"

- name: Stop and mask service for consistency with RHEL
block:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
apt:
name: "{{ _package_name }}"
state: present
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
- containerd.io={{ containerd_defaults.containerd_version }}-* # provides "runc"
state: present
allow_downgrade: true
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
4 changes: 4 additions & 0 deletions ansible/playbooks/roles/postgres_exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
state: present
install_recommends: no
when: ansible_os_family == 'Debian'
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"

- name: Create postgres_exporter system group
group:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ default_text_search_config = 'pg_catalog.english'
#include_if_exists = '...' # include file only if it exists
#include = '...' # include file
include = 'postgresql-epiphany.conf' # Epiphany managed configuration that overrides settings above
include_if_exists = '{{ specification.custom_postgresql_config }}'


#------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@
- rabbitmq-server={{ versions.debian.rabbitmq }}
update_cache: true
state: present
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
4 changes: 4 additions & 0 deletions ansible/playbooks/roles/repository/tasks/Debian/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- apache2
- libdpkg-perl # required by dpkg-scanpackages script
cache_valid_time: 3600 # 1 h
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
when: not offline_mode

- name: Create epirepo repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
vars:
packages_to_install_with_version: >-
{{ packages_to_install.items() | map('join', '=') | list }}
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"

- name: K8s/install | Include hold packages task
include_tasks: hold-packages.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- name: Install K8s packages
when: packages_to_install_or_upgrade | length
or packages_to_downgrade | length
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
vars:
target_packages:
kubeadm: "{{ version }}-00" # kubeadm may be removed as dependency and then has to be reinstalled
Expand Down Expand Up @@ -52,6 +56,10 @@
apt:
name: "{{ packages_to_downgrade }}"
state: absent
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
when: packages_to_downgrade | length

- name: "K8s/install | Install packages: {{ packages_to_install_with_version | join( ', ' ) }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
name: haproxy
update_cache: true
state: absent
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
8 changes: 8 additions & 0 deletions ci/ansible/playbooks/os/ubuntu/upgrade-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
- name: Install all updates
apt:
upgrade: safe # equivalent of 'apt upgrade'
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"

# 4) Reboot the system (to use the latest kernel)

Expand Down Expand Up @@ -85,6 +89,10 @@
apt:
autoremove: true
purge: true
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"

# 6) Upgrade OS release

Expand Down
Loading

0 comments on commit 3b6d85a

Please sign in to comment.