Skip to content

Commit

Permalink
Merge pull request #108 from sassoftware/develop
Browse files Browse the repository at this point in the history
merge develop to main in prep for release
  • Loading branch information
kevinlinglesas authored Nov 8, 2023
2 parents f299ad6 + 8bb77b0 commit 4ccf208
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 3 deletions.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a signed
[Contributor Agreement](ContributorAgreement.txt).
You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
56 changes: 56 additions & 0 deletions ContributorAgreement.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Contributor Agreement

Version 1.1

Contributions to this software are accepted only when they are
properly accompanied by a Contributor Agreement. The Contributor
Agreement for this software is the Developer's Certificate of Origin
1.1 (DCO) as provided with and required for accepting contributions
to the Linux kernel.

In each contribution proposed to be included in this software, the
developer must include a "sign-off" that denotes consent to the
terms of the Developer's Certificate of Origin. The sign-off is
a line of text in the description that accompanies the change,
certifying that you have the right to provide the contribution
to be included. For changes provided in source code control (for
example, via a Git pull request) the sign-off must be included in
the commit message in source code control. For changes provided
in email or issue tracking, the sign-off must be included in the
email or the issue, and the sign-off will be incorporated into the
permanent commit message if the contribution is accepted into the
official source code.

If you can certify the below:

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

then you just add a line saying

Signed-off-by: Random J Developer <[email protected]>

using your real name (sorry, no pseudonyms or anonymous contributions.)
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ The following issues are known and may impact the expected usage or performance
* 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.
* 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.

## Contributing
We welcome your contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to submit contributions to this project.

This project is in maintenance mode. If you have an enhancement request you will need to submit a contribution for consideration.

## License

This project is licensed under the [Apache 2.0 License](LICENSE).
25 changes: 24 additions & 1 deletion playbooks/merge-playbook/library/merge_viya_deployment_files.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

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

Expand Down Expand Up @@ -60,6 +60,7 @@
PCP_PORT_LINE = " - PCP_PORT"
PGPOOL_PORT_LINE_BEFORE = "PGPOOL_PORT:"
POOL_NUMBER_LINE = " POOL_NUMBER: '0'\n"
PGPOOL_HEARTBEAT_LINE = " HA_PGPOOL_HEARTBEAT_PORT: ''\n"

############################################################
# Get Local Environment
Expand Down Expand Up @@ -524,6 +525,21 @@ def add_perms_override_property_invocation_variable (vars_file):
line = PERMS_OVERRIDE_LINE + line
out_file.write(line)


############################################################
# Add a new HA_PGPOOL_HEARTBEAT_PORT property to cpspgpoolc and pgpoolc in the vars.yml
############################################################
def add_pgpool_heartbeat_property_invocation_variable (vars_file):
with open(vars_file, "r") as in_file:
buf = in_file.readlines()

with open(vars_file, "w") as out_file:
for line in buf:
temp_line = line.lstrip()
if temp_line.startswith("POOL_NUMBER:"):
line = PGPOOL_HEARTBEAT_LINE + line
out_file.write(line)

############################################################
# Main
############################################################
Expand All @@ -534,6 +550,7 @@ def main():
"current_files_dir": {"required": True, "type": "str"},
"add_ha_properties": {"required": True, "type": "bool"},
"add_perms_override": {"required": True, "type": "bool"},
"add_pgpool_heartbeat": {"required": True, "type": "bool"},
"log_file_name": {"required": True, "type": "str"},
"tenant_id_string": {"required": False, "type": "str"},
"merge_default_host": {"required": False, "type": "str"},
Expand All @@ -545,6 +562,7 @@ def main():
current_files_dir = module.params['current_files_dir']
add_ha_properties = module.params['add_ha_properties']
add_perms_override = module.params['add_perms_override']
add_pgpool_heartbeat = module.params['add_pgpool_heartbeat']

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

# add pgpool_heartbeat properties
if add_pgpool_heartbeat:
add_pgpool_heartbeat_property_invocation_variable(new_vars_yml)
LOG.info("The new postgres pgpool_heartbeat property was added to the newer vars.yml file.")

# Get the tenant_id_list and do merge the tenant_vars.yml files
tenant_string = module.params['tenant_id_string']
try:
Expand Down
50 changes: 48 additions & 2 deletions playbooks/merge-playbook/merge-viya-deployment-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Optional: The default_host can be designated for newly created host groups. Run:
# -e "merge_default_host=deployTarget"
#
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# Copyright (c) 2019-2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
####################################################################
Expand Down Expand Up @@ -296,10 +296,32 @@
check_mode: yes
failed_when: false

- name: Check whether the HA_PGPOOL_HEARTBEAT_PORT property exists in the pre merged vars.yml
lineinfile:
path: "{{ merged_vars_yml }}"
regexp: 'HA_PGPOOL_HEARTBEAT_PORT:'
state: absent
register: pgpool_heartbeat_property_exists
check_mode: yes
failed_when: false

- name: Check whether the HA_PGPOOL_HEARTBEAT_PORT property exists in the current vars.yml
lineinfile:
path: "{{ current_vars_yml }}"
regexp: 'HA_PGPOOL_HEARTBEAT_PORT:'
state: absent
register: curr_pgpool_heartbeat_property_exists
check_mode: yes
failed_when: false

- set_fact:
add_perms_override: true
when: perms_override_property_exists.changed == True and curr_perms_override_property_exists.changed == False

- set_fact:
add_pgpool_heartbeat: true
when: pgpool_heartbeat_property_exists.changed == True and curr_pgpool_heartbeat_property_exists.changed == False and ha_properties_exist.changed == True

- name: Uncomment out the vars.yml properties in the merged folder if they are activated in the current vars.yml
replace:
path: "{{ merged_vars_yml }}"
Expand Down Expand Up @@ -400,6 +422,7 @@
current_files_dir: "{{ current_files_dir }}"
add_ha_properties: "{{ ha_properties_exist.changed }}"
add_perms_override: "{{ add_perms_override is defined | default(false) }}"
add_pgpool_heartbeat: "{{ add_pgpool_heartbeat is defined | default(false) }}"
log_file_name: "{{ merged_folder }}/merge_viya_deployment_files.log"
tenant_id_string: "{{ tenant_id_string if tenantID_list is defined | default(false) else omit }}"
merge_default_host: "{{ merge_default_host if merge_default_host is defined | default(false) else omit }}"
Expand Down Expand Up @@ -638,7 +661,30 @@
SANMOUNT: '{{ "{{ SAS_CONFIG_ROOT }}/data/sasdatasvrc" }}'
SERVICE_NAME: cpspostgres
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


# case 3-2-3 For 19w43 to 23w44 adding cps
- name: Move CommonPlanningService Invocation variables to INVOCATION_VARIABLES
blockinfile:
path: "{{ merged_vars_yml }}"
insertafter: "{{ merge_default_host }}:"
block: |3
cpsdatasvrc:
- NODE_NUMBER: '0'
PG_PORT: '5442'
SANMOUNT: '{{ "{{ SAS_CONFIG_ROOT }}/data/sasdatasvrc" }}'
SERVICE_NAME: cpspostgres
cpspgpoolc:
- HA_PGPOOL_VIRTUAL_IP: ''
HA_PGPOOL_WATCHDOG_PORT: ''
HA_PGPOOL_HEARTBEAT_PORT: ''
PERMS_OVERRIDE: 'false'
POOL_NUMBER: '0'
PCP_PORT: '5440'
PGPOOL_PORT: '5441'
SANMOUNT: '{{ "{{ SAS_CONFIG_ROOT }}/data/sasdatasvrc" }}'
SERVICE_NAME: cpspostgres
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

- name: Check whether the NODE_TYPE property exists in the merged vars.yml
lineinfile:
path: "{{ merged_vars_yml }}"
Expand Down

0 comments on commit 4ccf208

Please sign in to comment.