Skip to content

Commit 4ccf208

Browse files
Merge pull request #108 from sassoftware/develop
merge develop to main in prep for release
2 parents f299ad6 + 8bb77b0 commit 4ccf208

File tree

5 files changed

+152
-3
lines changed

5 files changed

+152
-3
lines changed

CONTRIBUTING.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project. There are
4+
just a few small guidelines you need to follow.
5+
6+
## Contributor License Agreement
7+
8+
Contributions to this project must be accompanied by a signed
9+
[Contributor Agreement](ContributorAgreement.txt).
10+
You (or your employer) retain the copyright to your contribution,
11+
this simply gives us permission to use and redistribute your contributions as
12+
part of the project.
13+
14+
## Code reviews
15+
16+
All submissions, including submissions by project members, require review. We
17+
use GitHub pull requests for this purpose. Consult
18+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
19+
information on using pull requests.

ContributorAgreement.txt

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Contributor Agreement
2+
3+
Version 1.1
4+
5+
Contributions to this software are accepted only when they are
6+
properly accompanied by a Contributor Agreement. The Contributor
7+
Agreement for this software is the Developer's Certificate of Origin
8+
1.1 (DCO) as provided with and required for accepting contributions
9+
to the Linux kernel.
10+
11+
In each contribution proposed to be included in this software, the
12+
developer must include a "sign-off" that denotes consent to the
13+
terms of the Developer's Certificate of Origin. The sign-off is
14+
a line of text in the description that accompanies the change,
15+
certifying that you have the right to provide the contribution
16+
to be included. For changes provided in source code control (for
17+
example, via a Git pull request) the sign-off must be included in
18+
the commit message in source code control. For changes provided
19+
in email or issue tracking, the sign-off must be included in the
20+
email or the issue, and the sign-off will be incorporated into the
21+
permanent commit message if the contribution is accepted into the
22+
official source code.
23+
24+
If you can certify the below:
25+
26+
Developer's Certificate of Origin 1.1
27+
28+
By making a contribution to this project, I certify that:
29+
30+
(a) The contribution was created in whole or in part by me and I
31+
have the right to submit it under the open source license
32+
indicated in the file; or
33+
34+
(b) The contribution is based upon previous work that, to the best
35+
of my knowledge, is covered under an appropriate open source
36+
license and I have the right under that license to submit that
37+
work with modifications, whether created in whole or in part
38+
by me, under the same open source license (unless I am
39+
permitted to submit under a different license), as indicated
40+
in the file; or
41+
42+
(c) The contribution was provided directly to me by some other
43+
person who certified (a), (b) or (c) and I have not modified
44+
it.
45+
46+
(d) I understand and agree that this project and the contribution
47+
are public and that a record of the contribution (including all
48+
personal information I submit with it, including my sign-off) is
49+
maintained indefinitely and may be redistributed consistent with
50+
this project or the open source license(s) involved.
51+
52+
then you just add a line saying
53+
54+
Signed-off-by: Random J Developer <[email protected]>
55+
56+
using your real name (sorry, no pseudonyms or anonymous contributions.)

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ The following issues are known and may impact the expected usage or performance
4141
* SAS Viya 3.5 supports Linux on Power on a limited availability basis. The SAS Viya ARK tools do not support Linux on Power in the Viya35-ark-1.0 release.
4242
* Viya ARK Pre-Install Playbook SSL check play may fail to complete if multiple sets of SSL configuration files exist. The playbook will not fail, but subsequent tasks related to SSL Certificate check will be skipped. Workaround the issue by ensuring only one configuration file specifying ``SSLCertificateFile`` exist under ``/etc/[httpd|apache2]`` root directory.
4343

44+
## Contributing
45+
We welcome your contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to submit contributions to this project.
46+
47+
This project is in maintenance mode. If you have an enhancement request you will need to submit a contribution for consideration.
48+
4449
## License
4550

4651
This project is licensed under the [Apache 2.0 License](LICENSE).

playbooks/merge-playbook/library/merge_viya_deployment_files.py

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22

33
#
4-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
4+
# Copyright (c) 2019-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
55
# SPDX-License-Identifier: Apache-2.0
66
#
77

@@ -60,6 +60,7 @@
6060
PCP_PORT_LINE = " - PCP_PORT"
6161
PGPOOL_PORT_LINE_BEFORE = "PGPOOL_PORT:"
6262
POOL_NUMBER_LINE = " POOL_NUMBER: '0'\n"
63+
PGPOOL_HEARTBEAT_LINE = " HA_PGPOOL_HEARTBEAT_PORT: ''\n"
6364

6465
############################################################
6566
# Get Local Environment
@@ -524,6 +525,21 @@ def add_perms_override_property_invocation_variable (vars_file):
524525
line = PERMS_OVERRIDE_LINE + line
525526
out_file.write(line)
526527

528+
529+
############################################################
530+
# Add a new HA_PGPOOL_HEARTBEAT_PORT property to cpspgpoolc and pgpoolc in the vars.yml
531+
############################################################
532+
def add_pgpool_heartbeat_property_invocation_variable (vars_file):
533+
with open(vars_file, "r") as in_file:
534+
buf = in_file.readlines()
535+
536+
with open(vars_file, "w") as out_file:
537+
for line in buf:
538+
temp_line = line.lstrip()
539+
if temp_line.startswith("POOL_NUMBER:"):
540+
line = PGPOOL_HEARTBEAT_LINE + line
541+
out_file.write(line)
542+
527543
############################################################
528544
# Main
529545
############################################################
@@ -534,6 +550,7 @@ def main():
534550
"current_files_dir": {"required": True, "type": "str"},
535551
"add_ha_properties": {"required": True, "type": "bool"},
536552
"add_perms_override": {"required": True, "type": "bool"},
553+
"add_pgpool_heartbeat": {"required": True, "type": "bool"},
537554
"log_file_name": {"required": True, "type": "str"},
538555
"tenant_id_string": {"required": False, "type": "str"},
539556
"merge_default_host": {"required": False, "type": "str"},
@@ -545,6 +562,7 @@ def main():
545562
current_files_dir = module.params['current_files_dir']
546563
add_ha_properties = module.params['add_ha_properties']
547564
add_perms_override = module.params['add_perms_override']
565+
add_pgpool_heartbeat = module.params['add_pgpool_heartbeat']
548566

549567
if not current_inventory_file.startswith(os.sep):
550568
# force working with absolution path location
@@ -644,6 +662,11 @@ def main():
644662
add_perms_override_property_invocation_variable(new_vars_yml)
645663
LOG.info("The new postgres perms_override property was added to the newer vars.yml file.")
646664

665+
# add pgpool_heartbeat properties
666+
if add_pgpool_heartbeat:
667+
add_pgpool_heartbeat_property_invocation_variable(new_vars_yml)
668+
LOG.info("The new postgres pgpool_heartbeat property was added to the newer vars.yml file.")
669+
647670
# Get the tenant_id_list and do merge the tenant_vars.yml files
648671
tenant_string = module.params['tenant_id_string']
649672
try:

playbooks/merge-playbook/merge-viya-deployment-files.yml

+48-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# Optional: The default_host can be designated for newly created host groups. Run:
3535
# -e "merge_default_host=deployTarget"
3636
#
37-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
37+
# Copyright (c) 2019-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3838
# SPDX-License-Identifier: Apache-2.0
3939
#
4040
####################################################################
@@ -296,10 +296,32 @@
296296
check_mode: yes
297297
failed_when: false
298298

299+
- name: Check whether the HA_PGPOOL_HEARTBEAT_PORT property exists in the pre merged vars.yml
300+
lineinfile:
301+
path: "{{ merged_vars_yml }}"
302+
regexp: 'HA_PGPOOL_HEARTBEAT_PORT:'
303+
state: absent
304+
register: pgpool_heartbeat_property_exists
305+
check_mode: yes
306+
failed_when: false
307+
308+
- name: Check whether the HA_PGPOOL_HEARTBEAT_PORT property exists in the current vars.yml
309+
lineinfile:
310+
path: "{{ current_vars_yml }}"
311+
regexp: 'HA_PGPOOL_HEARTBEAT_PORT:'
312+
state: absent
313+
register: curr_pgpool_heartbeat_property_exists
314+
check_mode: yes
315+
failed_when: false
316+
299317
- set_fact:
300318
add_perms_override: true
301319
when: perms_override_property_exists.changed == True and curr_perms_override_property_exists.changed == False
302320

321+
- set_fact:
322+
add_pgpool_heartbeat: true
323+
when: pgpool_heartbeat_property_exists.changed == True and curr_pgpool_heartbeat_property_exists.changed == False and ha_properties_exist.changed == True
324+
303325
- name: Uncomment out the vars.yml properties in the merged folder if they are activated in the current vars.yml
304326
replace:
305327
path: "{{ merged_vars_yml }}"
@@ -400,6 +422,7 @@
400422
current_files_dir: "{{ current_files_dir }}"
401423
add_ha_properties: "{{ ha_properties_exist.changed }}"
402424
add_perms_override: "{{ add_perms_override is defined | default(false) }}"
425+
add_pgpool_heartbeat: "{{ add_pgpool_heartbeat is defined | default(false) }}"
403426
log_file_name: "{{ merged_folder }}/merge_viya_deployment_files.log"
404427
tenant_id_string: "{{ tenant_id_string if tenantID_list is defined | default(false) else omit }}"
405428
merge_default_host: "{{ merge_default_host if merge_default_host is defined | default(false) else omit }}"
@@ -638,7 +661,30 @@
638661
SANMOUNT: '{{ "{{ SAS_CONFIG_ROOT }}/data/sasdatasvrc" }}'
639662
SERVICE_NAME: cpspostgres
640663
when: cps_invocation|length > 0 and cpspostgres_props_exist.changed == False and ha_properties_exist.changed == True and merge_default_host is defined and perms_override_property_exists.changed == True
641-
664+
665+
# case 3-2-3 For 19w43 to 23w44 adding cps
666+
- name: Move CommonPlanningService Invocation variables to INVOCATION_VARIABLES
667+
blockinfile:
668+
path: "{{ merged_vars_yml }}"
669+
insertafter: "{{ merge_default_host }}:"
670+
block: |3
671+
cpsdatasvrc:
672+
- NODE_NUMBER: '0'
673+
PG_PORT: '5442'
674+
SANMOUNT: '{{ "{{ SAS_CONFIG_ROOT }}/data/sasdatasvrc" }}'
675+
SERVICE_NAME: cpspostgres
676+
cpspgpoolc:
677+
- HA_PGPOOL_VIRTUAL_IP: ''
678+
HA_PGPOOL_WATCHDOG_PORT: ''
679+
HA_PGPOOL_HEARTBEAT_PORT: ''
680+
PERMS_OVERRIDE: 'false'
681+
POOL_NUMBER: '0'
682+
PCP_PORT: '5440'
683+
PGPOOL_PORT: '5441'
684+
SANMOUNT: '{{ "{{ SAS_CONFIG_ROOT }}/data/sasdatasvrc" }}'
685+
SERVICE_NAME: cpspostgres
686+
when: cps_invocation|length > 0 and cpspostgres_props_exist.changed == False and merge_default_host is defined and curr_pgpool_heartbeat_property_exists.changed == False and ha_properties_exist.changed == True
687+
642688
- name: Check whether the NODE_TYPE property exists in the merged vars.yml
643689
lineinfile:
644690
path: "{{ merged_vars_yml }}"

0 commit comments

Comments
 (0)