Skip to content

Commit

Permalink
Merge branch 'main' into efm_pgpool_integration_patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Ianvdl authored Apr 25, 2024
2 parents b13620e + 113cc0c commit 55e06c4
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
- name: Check that all required packages have been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ package_list }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/install_dbserver/tasks/validate_install_dbserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

- name: Install python-apt package
ansible.builtin.package:
name: python-apt
name: python3-apt
state: present
when:
- ansible_os_family == 'Debian'
Expand Down Expand Up @@ -187,7 +187,7 @@
- name: Check that all required packages have been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ package_list }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/setup_dbt2/tasks/validate_setup_dbt2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- name: Check that all packages in dbt2_db_pkg_list has been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ dbt2_db_pkg_list }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Check that all packages in dbt2_client_pkg_list has been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ dbt2_client_pkg_list }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Check that all packages in dbt2_driver_pkg_list has been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ dbt2_driver_pkg_list }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/setup_dbt3/tasks/validate_setup_dbt3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Check that all packages in dbt3_db_pkg_list has been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ dbt3_db_pkg_list }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/setup_dbt7/tasks/validate_setup_dbt7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Check that all packages in dbt7_db_pkg_list has been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ dbt7_db_pkg_list }}"
Expand Down
6 changes: 5 additions & 1 deletion roles/setup_efm/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ primary_public_ip: ""
primary_private_ip: ""
input_password: ""
pg_allow_ip_addresses: []
ping_server_ip: "8.8.8.8"
efm_user_email: "[email protected]"

# setting validate_only to true allows you to validate setup on an existing node
# use_validation flag applies to deployment configuration and validation after setup
Expand All @@ -46,7 +48,7 @@ efm_default_parameters:
- {name: db.bin, value: "{{ pg_bin_path }}"}
- {name: db.recovery.dir, value: "{{ pg_data }}"}
- {name: db.data.dir, value: "{{ pg_data }}"}
- {name: user.email, value: "[email protected]"}
- {name: user.email, value: "{{ efm_user_email }}"}
- {name: auto.allow.hosts, value: true}
- {name: stable.nodes.file, value: true}
- {name: local.period, value: "3"}
Expand All @@ -55,6 +57,7 @@ efm_default_parameters:
- {name: remote.timeout, value: "5"}
- {name: node.timeout, value: "5"}
- {name: admin.port, value: "{{ efm_admin_port }}"}
- {name: ping.server.ip, value: "{{ ping_server_ip }}"}

efm_physical_slot_param:
- {name: update.physical.slots.period, value: "5"}
Expand Down Expand Up @@ -110,6 +113,7 @@ pcp_passfile_mode: "0600"
pgpool2_pcp_port: 9898
efm_pgpool2_lb_attach: "{{ efm_bin_path }}/pcp_attach_all.sh %h %t"
efm_pgpool2_lb_detach: ""
detach_on_agent_failure: true

supported_os:
- CentOS7
Expand Down
1 change: 1 addition & 0 deletions roles/setup_efm/tasks/efm_configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
- {name: pcp.pass.file, value: "{{ pcp_passfile }}"}
- {name: script.load.balancer.attach, value: "{{ efm_pgpool2_lb_attach }}"}
- {name: script.load.balancer.detach, value: "{{ efm_pgpool2_lb_detach }}"}
- {name: detach.on.agent.failure, value: "{{ detach_on_agent_failure }}"}
when:
- efm_pgpool2_integration

Expand Down
2 changes: 1 addition & 1 deletion roles/setup_pgpool2/tasks/pgpool2_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- name: Install pgpool-II-pcp package on RedHat
ansible.builtin.package:
name: "pgpool-II-pcp"
name: "{{ pgpool2_pcp_package_name }}"
state: present
when:
- ansible_os_family == 'RedHat'
Expand Down
4 changes: 3 additions & 1 deletion roles/setup_pgpool2/tasks/validate_setup_pgpool2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
- name: Check that all required pgpool2 packages have been installed
ansible.builtin.assert:
that:
- "{{ ansible_facts.packages[package] }} is defined"
- ansible_facts.packages[package] is defined
fail_msg: "Package {{ package }} has not been installed."
success_msg: "Package {{ package }} has been installed."
loop: "{{ pgpool2_packages_check }}"
Expand Down Expand Up @@ -123,6 +123,7 @@
pg_database: "{{ pg_pgpool_database }}"
no_log: "{{ disable_logging }}"
when: pgpool2_test_user_password|length > 1
run_once: true

- name: Add pgpool2_test_user
ansible.builtin.include_role:
Expand Down Expand Up @@ -181,6 +182,7 @@
state: absent
no_log: "{{ disable_logging }}"
when: pgpool2_test_user_password|length > 1
run_once: true

- name: Remove pgpool2_test_user from pgpool2
ansible.builtin.include_role:
Expand Down
1 change: 1 addition & 0 deletions roles/setup_pgpool2/vars/PG_RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pgpool2_version: 4.3
# We don't have the choice of the version with community PostgreSQL
pgpool2_package_name: "pgpool-II"
pgpool2_pcp_package_name: "pgpool-II-pcp"
pgpool2_configuration_file: "/etc/pgpool-II/pgpool.conf"
pgpool2_pool_passwd_file: "/etc/pgpool-II/pool_passwd"
pgpool2_user: "postgres"
Expand Down

0 comments on commit 55e06c4

Please sign in to comment.