Skip to content

Commit

Permalink
Merge pull request #87 from sassoftware/staging
Browse files Browse the repository at this point in the history
3.5.0 - September 21, 2023
  • Loading branch information
jarpat authored Sep 21, 2023
2 parents 53787b6 + 7ce0061 commit 772107d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
8 changes: 5 additions & 3 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ postgres_servers = {

**NOTE**: The `default = {}` element is always required when creating external databases. This is the system's default database server.

Each server element, like `foo = {}`, can contain none, some, or all of the parameters listed
Each server element, like `foo = {}`, can contain none, some, or all of the parameters listed. When naming the server element, it must follow a valid naming scheme, the name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character.

| Name | Description | Type | Default | Notes |
| :--- | :--- | :--- | :--- | :--- |
Expand All @@ -311,15 +311,17 @@ Each server element, like `foo = {}`, can contain none, some, or all of the para
- The Ansible tasks that are performed include copying the certificate and key from the PostgreSQL VM into your local workspace directory.
2. If you are planning to use the [viya4-deployment repository](https://github.com/sassoftware/viya4-deployment) to perform a SAS Viya platform deployment where you have [full-stack TLS](https://github.com/sassoftware/viya4-deployment/blob/main/docs/CONFIG-VARS.md#tls) configured, make sure that the `V4_CFG_TLS_TRUSTED_CA_CERTS` variable in the viya4-deployment ansible-vars.yaml file points to a directory that contains the server_ssl_cert_file.

Here is an example of the `postgres_servers` variable where the `default` entry only overrides the `administrator_password` parameter, and the `another-server` entry overrides all parameters:
Multiple SAS offerings require a second PostgreSQL instance referred to as SAS Common Data Store, or CDS PostgreSQL. For more information, see [Common Customizations](https://go.documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=dplyml0phy0dkr&docsetTarget=n08u2yg8tdkb4jn18u8zsi6yfv3d.htm#p0wkxxi9s38zbzn19ukjjaxsc0kl). A list of SAS offerings that require CDS PostgreSQL is provided in [SAS Common Data Store Requirements](https://go.documentation.sas.com/?cdcId=itopscdc&cdcVersion=default&docsetId=itopssr&docsetTarget=p05lfgkwib3zxbn1t6nyihexp12n.htm#n03wzanutmc6gon1val5fykas9aa). To create and configure an external CDS PostgreSQL instance in addition to the external platform PostgreSQL instance named `default`, specify `cds-postgres` as a second PostgreSQL instance, as shown in the example below.

Here is an example of the `postgres_servers` variable with the `default` server entry overriding only the `administrator_password` parameter and the `cds-postgres` entry overriding all the parameters:

```terraform
postgres_servers = {
default = {
administrator_password = "D0ntL00kTh1sWay"
server_ip = "10.10.10.10" # Assigned values for static IPs
},
another_server = {
cds-postgres = {
server_num_cpu = 8 # 8 CPUs
server_memory = 16384 # 16 GB
server_disk_size = 250 # 256 GB
Expand Down
2 changes: 1 addition & 1 deletion roles/kubernetes/node/labels_taints/tasks/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
- name: Applying labels
ansible.builtin.shell: |
kubectl label nodes {{ ansible_hostname }} {{ label }} --overwrite
kubectl label nodes -l 'kubernetes.io/hostname in ({{ ansible_hostname }},{{ ansible_fqdn }})' {{ label }} --overwrite
with_items: "{{ labels }}"
loop_control:
loop_var: label
Expand Down
4 changes: 2 additions & 2 deletions roles/kubernetes/node/labels_taints/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
vars:
labels: "{{ item.value }}"
with_dict: "{{ node_labels }}"
when: ansible_nodename.find(item.key) != -1
when: ansible_nodename is search(item.key)
tags:
- install
- update
Expand All @@ -19,7 +19,7 @@
vars:
taints: "{{ item.value }}"
with_dict: "{{ node_taints }}"
when: ansible_nodename.find(item.key) != -1
when: ansible_nodename is search(item.key)
tags:
- install
- update
2 changes: 1 addition & 1 deletion roles/kubernetes/node/labels_taints/tasks/taints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
- name: Applying taints
ansible.builtin.shell: |
kubectl taint nodes {{ ansible_hostname }} {{ taint }} --overwrite
kubectl taint nodes -l 'kubernetes.io/hostname in ({{ ansible_hostname }},{{ ansible_fqdn }})' {{ taint }} --overwrite
with_items: "{{ taints }}"
loop_control:
loop_var: taint
Expand Down
6 changes: 3 additions & 3 deletions templates/ansible/inventory.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ cr_server
# Postgres Servers
#
%{ for server_name, server_data in postgres_servers ~}
[${prefix}_${server_name}_pgsql]
[${prefix}_${replace(server_name, "-", "_")}_pgsql]
${server_data.server_ip}
[${prefix}_${server_name}_pgsql:vars]
[${prefix}_${replace(server_name, "-", "_")}_pgsql:vars]
postgres_server_name="${server_name}"
postgres_server_version="${server_data.server_version}"
postgres_server_ssl="${server_data.server_ssl}"
Expand All @@ -107,7 +107,7 @@ postgres_system_setting_${system_setting.name}="${system_setting.value}"
%{ endfor ~}
[postgres:children]
%{ for server_name, server_data in postgres_servers ~}
${prefix}_${server_name}_pgsql
${prefix}_${replace(server_name, "-", "_")}_pgsql
%{ endfor ~}

%{ endif ~}
Expand Down
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ variable "postgres_servers" {
description = "Map of PostgreSQL server objects"
type = any
default = null
validation {
condition = var.postgres_servers == null || can([for pg in keys(var.postgres_servers) : regex("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", pg)])
error_message = "ERROR: Postgres Server names must follow a valid naming scheme. Name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character"
}
}

# Regex for validation : ^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$
Expand Down

0 comments on commit 772107d

Please sign in to comment.