Skip to content

Commit

Permalink
Fix variables expand and postgresql template (#3411)
Browse files Browse the repository at this point in the history
* Fix variables expand and postgresql template

Bug introduced in (f0f45d7)
  • Loading branch information
sbbroot authored Nov 7, 2023
1 parent f0f45d7 commit c587435
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 32 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN : INSTALL HELM BINARY \
&& aws --version

RUN : INSTALL GEM REQUIREMENTS \
&& gem install net-ssh -v 6.1.0 \
&& gem install \
bcrypt_pbkdf ed25519 rake rspec_junit_formatter rubocop rubocop-junit_formatter serverspec solargraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
state: present
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
purge: true
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"

- name: Install firewalld package
block:
Expand All @@ -27,8 +27,8 @@
state: present
register: install_firewalld
until: install_firewalld is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ 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 @@ -5,5 +5,5 @@
state: present
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
allow_downgrade: true
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
4 changes: 2 additions & 2 deletions ansible/playbooks/roles/postgres_exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
when: ansible_os_family == 'Debian'
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"

- name: Create postgres_exporter system group
group:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,9 @@ 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
{% if specification.custom_postgresql_config %}
include_if_exists = '{{ specification.custom_postgresql_config }}'
{% endif %}


#------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
state: present
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
4 changes: 2 additions & 2 deletions ansible/playbooks/roles/repository/tasks/Debian/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
cache_valid_time: 3600 # 1 h
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
when: not offline_mode

- name: Create epirepo repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
{{ packages_to_install.items() | map('join', '=') | list }}
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ 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 @@ -9,8 +9,8 @@
or packages_to_downgrade | length
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
vars:
target_packages:
kubeadm: "{{ version }}-00" # kubeadm may be removed as dependency and then has to be reinstalled
Expand Down Expand Up @@ -58,8 +58,8 @@
state: absent
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ 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 @@ -6,5 +6,5 @@
state: absent
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"
8 changes: 4 additions & 4 deletions ci/ansible/playbooks/os/ubuntu/upgrade-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
upgrade: safe # equivalent of 'apt upgrade'
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"

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

Expand Down Expand Up @@ -91,8 +91,8 @@
purge: true
register: result
until: result is succeeded
retries: "{{ specification.retries }}"
delay: "{{ specification.delay }}"
retries: "{{ retries }}"
delay: "{{ delay }}"

# 6) Upgrade OS release

Expand Down
4 changes: 4 additions & 0 deletions schema/common/defaults/configuration/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ specification:
value: 10
comment: maximum number of simultaneously running WAL sender processes
when: replication
- name: max_replication_slots
value: 10
comment: maximum number of replication slots that a server can support
when: replication
- name: wal_keep_size
value: 500
comment: the size of WAL files held for standby servers (MB)
Expand Down
6 changes: 2 additions & 4 deletions tests/spec/spec/applications/rabbitmq/rabbitmq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,13 @@ def callRabbitMQDeploymentTests
describe 'Checking node health using RabbitMQ API' do
service_replicas.times do |i|
describe command("curl -o /dev/null -s -w '%{http_code}' -u #{user}#{i}:#{pass} \
#{host_inventory['hostname']}:#{service_management_port}/api/healthchecks/node/rabbit@$(kubectl describe pods rabbitmq-cluster-#{i} \
--namespace=#{service_namespace} | awk '/^IP:/ {print $2}')") do
#{host_inventory['hostname']}:#{service_management_port}/api/healthchecks/node/rabbit@rabbitmq-cluster-#{i}.#{service_name}.#{service_namespace}.svc.cluster.local") do
it 'is expected to be equal' do
expect(subject.stdout.to_i).to eq 200
end
end
describe command("curl -u #{user}#{i}:#{pass} \
#{host_inventory['hostname']}:#{service_management_port}/api/healthchecks/node/rabbit@$(kubectl describe pods rabbitmq-cluster-#{i} \
--namespace=#{service_namespace} | awk '/^IP:/ {print $2}')") do
#{host_inventory['hostname']}:#{service_management_port}/api/healthchecks/node/rabbit@rabbitmq-cluster-#{i}.#{service_name}.#{service_namespace}.svc.cluster.local") do
its(:stdout_as_json) { should include('status' => /ok/) }
its(:stdout_as_json) { should_not include('status' => /failed/) }
its(:exit_status) { should eq 0 }
Expand Down

0 comments on commit c587435

Please sign in to comment.