Skip to content
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ exclude_paths:
warn_list:
- yaml[line-length]
- var-naming[no-role-prefix]
- jinja[spacing]
- command-instead-of-module
- meta-runtime[unsupported-version]
- run-once[task]
506 changes: 506 additions & 0 deletions docs/certcheck_README.md

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions playbooks/certcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright (c) 2025, Itential, Inc
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
# IAG5 TLS Certificate Verification
#
# Runs after deployment to verify that all TLS certificates are correctly
# configured across all IAG5 node types. All variables are defined in each
# role's defaults/main.yml and derived from the deployer's existing variables.
#
# Runs automatically as the final step of site.yml.
# Can also be run standalone:
#
# ansible-playbook itential.iag5.certcheck -i <inventory>
#
# Or for a specific check suite only:
# ansible-playbook itential.iag5.certcheck -i <inventory> --tags cluster_server_to_runner
# ansible-playbook itential.iag5.certcheck -i <inventory> --tags cluster_client_to_server
# ansible-playbook itential.iag5.certcheck -i <inventory> --tags connect_server_to_gwm

# -----------------------------------------------------------------------
# CLUSTER TLS — SERVER ↔ RUNNER (gRPC mTLS)
# -----------------------------------------------------------------------
- name: "CERTCHECK | Cluster TLS — SERVER to RUNNER — SERVER node"
hosts: iag5_servers
become: true
tags: [certcheck, cluster_server_to_runner]
roles:
- role: itential.iag5.gateway
tags: always
- role: itential.iag5.certcheck_cluster_server_to_runner
when: gateway_server_use_tls | bool

- name: "CERTCHECK | Cluster TLS — SERVER to RUNNER — RUNNER node"
hosts: iag5_runners
become: true
tags: [certcheck, cluster_server_to_runner]
roles:
- role: itential.iag5.gateway
tags: always
- role: itential.iag5.certcheck_cluster_server_to_runner
when: gateway_server_use_tls | bool

# -----------------------------------------------------------------------
# CLUSTER TLS — CLIENT ↔ SERVER (gRPC mTLS)
# -----------------------------------------------------------------------
- name: "CERTCHECK | Cluster TLS — CLIENT to SERVER — CLIENT node"
hosts: iag5_clients
become: true
tags: [certcheck, cluster_client_to_server]
roles:
- role: itential.iag5.gateway
tags: always
- role: itential.iag5.certcheck_cluster_client_to_server
when: gateway_client_use_tls | bool

- name: "CERTCHECK | Cluster TLS — CLIENT to SERVER — SERVER node"
hosts: iag5_servers
become: true
tags: [certcheck, cluster_client_to_server]
roles:
- role: itential.iag5.gateway
tags: always
- role: itential.iag5.certcheck_cluster_client_to_server
when: gateway_client_use_tls | bool

# -----------------------------------------------------------------------
# CONNECT TLS — SERVER → Gateway Manager (WebSocket)
# Only runs when gateway_manager group is defined in inventory.
# -----------------------------------------------------------------------
- name: "CERTCHECK | Connect TLS — SERVER to Gateway Manager"
hosts: iag5_servers
become: true
tags: [certcheck, connect_server_to_gwm]
pre_tasks:
- name: "CERTCHECK | Skip connect checks if gateway_manager group not in inventory"
ansible.builtin.meta: end_host
when: "'gateway_manager' not in groups or groups['gateway_manager'] | length == 0"
roles:
- role: itential.iag5.gateway
tags: always
- role: itential.iag5.certcheck_connect_server_to_gwm
when: gateway_server_use_tls | bool
3 changes: 3 additions & 0 deletions playbooks/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

- name: Install and configure Gateway5 clients
import_playbook: itential.iag5.clients

- name: Verify IAG5 TLS certificates post-deployment
import_playbook: itential.iag5.certcheck
24 changes: 24 additions & 0 deletions roles/certcheck_cluster_client_to_server/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2025, Itential, Inc
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
---
########################################################
# certcheck_cluster_client_to_server default variables
########################################################

# Inventory group names — must match the deployer's group names
iag5_server_group: "iag5_servers"

Check warning on line 9 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: iag5_server_group)
iag5_client_group: "iag5_clients"

Check warning on line 10 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: iag5_client_group)

# Gateway config file paths — derived from deployer role variables
server_gateway_conf: "{{ gateway_server_config_dir }}/gateway.conf"

Check warning on line 13 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: server_gateway_conf)
client_gateway_conf: "{{ gateway_client_working_dir }}/gateway.conf"

Check warning on line 14 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: client_gateway_conf)

# Service name — matches the systemd unit installed by the deployer
service_name: iagctl

Check warning on line 17 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: service_name)

# Port the server listens on — derived from deployer default
server_port: "{{ gateway_server_port }}"

Check warning on line 20 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: server_port)

# private_ip — used for SAN validation and no_proxy checks.
# Defaults to ansible_host since the deployer does not define private_ip.
private_ip: "{{ hostvars[inventory_hostname]['private_ip'] | default(ansible_host) }}"

Check warning on line 24 in roles/certcheck_cluster_client_to_server/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use certcheck_cluster_client_to_server_ as a prefix. (vars: private_ip)
Loading
Loading