Skip to content

Commit

Permalink
check_mode for WAL-G (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Dec 13, 2024
1 parent 6748f4f commit 86b8cf0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions automation/roles/wal-g/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
dest: /tmp/
timeout: 60
validate_certs: false
check_mode: false
vars:
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"
Expand All @@ -55,6 +56,7 @@
extra_opts:
- --no-same-owner
remote_src: true
check_mode: false

- name: Copy WAL-G binary file to "{{ wal_g_path.split(' ')[0] }}"
ansible.builtin.copy:
Expand Down Expand Up @@ -191,6 +193,7 @@
- (wal_g_installation_method == "src" or (ansible_os_family == "RedHat" and ansible_distribution_major_version == '8'))
- wal_g_version is version('1.0', '>=')
- (wal_g_installed_version.stderr is search("command not found") or wal_g_installed_version.stdout != wal_g_version)
- not ansible_check_mode
tags: wal-g, wal_g, wal_g_install

# older versions of WAL-G (for compatibility)
Expand All @@ -202,6 +205,7 @@
timeout: 60
validate_certs: false
environment: "{{ proxy_env | default({}) }}"
check_mode: false

- name: Extract WAL-G into /tmp
ansible.builtin.unarchive:
Expand All @@ -210,6 +214,7 @@
extra_opts:
- --no-same-owner
remote_src: true
check_mode: false

- name: Copy WAL-G binary file to "{{ wal_g_path.split(' ')[0] }}"
ansible.builtin.copy:
Expand Down Expand Up @@ -241,6 +246,7 @@
dest: "{{ wal_g_path.split(' ')[0] }}"
mode: u+x,g+x,o+x
remote_src: true
check_mode: false
when:
- installation_method == "file"
- wal_g_version is version('1.0', '>=')
Expand All @@ -264,6 +270,7 @@
dest: "{{ wal_g_path.split(' ')[0] }}"
mode: u+x,g+x,o+x
remote_src: true
check_mode: false
when:
- installation_method == "file"
- wal_g_version is version('0.2.19', '<=')
Expand Down

0 comments on commit 86b8cf0

Please sign in to comment.