Skip to content

Commit

Permalink
Add ‘string’ filter
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Oct 3, 2024
1 parent 1e5e352 commit 727daf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion automation/roles/add-repository/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
- ansible_distribution == "OracleLinux"
- ansible_distribution_major_version is version('8', '>=')
vars:
pg_devel_package: "postgresql{{ postgresql_version | replace('.', '') }}-devel"
pg_devel_package: "postgresql{{ postgresql_version | string | replace('.', '') }}-devel"
when:
- pg_devel_package in postgresql_packages

Expand Down
2 changes: 1 addition & 1 deletion automation/roles/upgrade/tasks/rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
- "The old cluster will need to be restored from backup."
when:
- inventory_hostname in groups['primary']
- pg_control_version.stdout == pg_new_version | replace('.', '')
- pg_control_version.stdout == pg_new_version | string | replace('.', '')

# Restore the old Patroni configuration
- name: '[Rollback] Restore the old patroni.yml configuration file'
Expand Down
12 changes: 6 additions & 6 deletions automation/roles/wal-g/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
# (if 'wal_g_installation_method' is 'binary')
# Note: excluding RHEL 8 as GLIBC version 2.29 or higher is required.
- block:
- name: "Download WAL-G v{{ wal_g_version | replace('v', '') }} binary"
- name: "Download WAL-G v{{ wal_g_version | string | replace('v', '') }} binary"
ansible.builtin.get_url:
url: "{{ wal_g_repo }}/{{ wal_g_archive }}"
dest: /tmp/
timeout: 60
validate_certs: false
vars:
wal_g_repo: "https://github.com/wal-g/wal-g/releases/download/v{{ wal_g_version | replace('v', '') }}"
wal_g_repo: "https://github.com/wal-g/wal-g/releases/download/v{{ wal_g_version | string | replace('v', '') }}"
wal_g_archive: "wal-g-pg-ubuntu-20.04-amd64.tar.gz"
environment: "{{ proxy_env | default({}) }}"

Expand Down Expand Up @@ -145,10 +145,10 @@
when: go_installed_version.stderr is search("command not found") or
go_installed_version.stdout is version(wal_g_latest_version.stdout, '<')

- name: "Download WAL-G v{{ wal_g_version | replace('v', '') }} source code"
- name: "Download WAL-G v{{ wal_g_version | string | replace('v', '') }} source code"
ansible.builtin.git:
repo: https://github.com/wal-g/wal-g.git
version: v{{ wal_g_version | replace('v', '') }}
version: v{{ wal_g_version | string | replace('v', '') }}
dest: /tmp/wal-g
force: true

Expand Down Expand Up @@ -195,9 +195,9 @@

# older versions of WAL-G (for compatibility)
- block:
- name: "Download WAL-G v{{ wal_g_version | replace('v', '') }} binary"
- name: "Download WAL-G v{{ wal_g_version | string | replace('v', '') }} binary"
ansible.builtin.get_url:
url: "https://github.com/wal-g/wal-g/releases/download/v{{ wal_g_version | replace('v', '') }}/wal-g.linux-amd64.tar.gz"
url: "https://github.com/wal-g/wal-g/releases/download/v{{ wal_g_version | string | replace('v', '') }}/wal-g.linux-amd64.tar.gz"
dest: /tmp/
timeout: 60
validate_certs: false
Expand Down

0 comments on commit 727daf9

Please sign in to comment.