Merge "Simplify sshd, timemaster and timesync service templates"

This commit is contained in:
Zuul 2021-05-27 21:29:41 +00:00 committed by Gerrit Code Review
commit e1ee3c9268
4 changed files with 28 additions and 28 deletions

View File

@ -72,9 +72,10 @@ parameters:
type: boolean
conditions:
ssh_firewall_allow_all: {equals: [{get_param: SshFirewallAllowAll}, true]}
ssh_banner_text_empty: {equals: [{get_param: BannerText}, '']}
ssh_motd_text_empty: {equals: [{get_param: MessageOfTheDay}, '']}
ssh_banner_text_set:
not: {equals: [{get_param: BannerText}, '']}
ssh_motd_text_set:
not: {equals: [{get_param: MessageOfTheDay}, '']}
outputs:
role_data:
@ -86,7 +87,7 @@ outputs:
proto: 'tcp'
dport: 22
extras:
ensure: {if: [ssh_firewall_allow_all, 'present', 'absent']}
ensure: {if: [{get_param: SshFirewallAllowAll}, 'present', 'absent']}
host_prep_config:
- include_role:
name: tripleo_ssh
@ -98,13 +99,13 @@ outputs:
tripleo_sshd_password_authentication: {get_param: PasswordAuthentication}
tripleo_sshd_banner_enabled:
if:
- ssh_banner_text_empty
- ssh_banner_text_set
- true
- false
tripleo_sshd_banner_text: {get_param: BannerText}
tripleo_sshd_motd_enabled:
if:
- ssh_motd_text_empty
- ssh_motd_text_set
- true
- false
tripleo_sshd_message_of_the_day: {get_param: MessageOfTheDay}

View File

@ -71,9 +71,6 @@ parameters:
description: Set this to true to open up ssh access from all sources.
type: boolean
conditions:
ssh_firewall_allow_all: {equals: [{get_param: SshFirewallAllowAll}, true]}
outputs:
role_data:
description: Role data for the ssh
@ -84,7 +81,7 @@ outputs:
proto: 'tcp'
dport: 22
extras:
ensure: {if: [ssh_firewall_allow_all, 'present', 'absent']}
ensure: {if: [{get_param: SshFirewallAllowAll}, 'present', 'absent']}
config_settings:
tripleo::profile::base::sshd::bannertext: {get_param: BannerText}
tripleo::profile::base::sshd::motd: {get_param: MessageOfTheDay}

View File

@ -119,9 +119,10 @@ resources:
PTPMessageTransport: {get_param: PTPMessageTransport}
conditions:
chrony_global_server_settings_is_empty: {equals: [{get_param: ChronyGlobalServerOptions}, '']}
chrony_global_pool_settings_is_empty: {equals: [{get_param: ChronyGlobalPoolOptions}, '']}
ntp_iburst: {equals: [{get_param: NtpIburstEnable}, true]}
chrony_global_server_settings_set:
not: {equals: [{get_param: ChronyGlobalServerOptions}, '']}
chrony_global_pool_settings_set:
not: {equals: [{get_param: ChronyGlobalPoolOptions}, '']}
outputs:
role_data:
@ -139,32 +140,32 @@ outputs:
tripleo_timemaster_role_action: all
chrony_global_server_settings:
if:
- chrony_global_server_settings_is_empty
- chrony_global_server_settings_set
- {get_param: ChronyGlobalServerOptions}
- str_replace:
template: IBURST minpoll MINPOLL maxpoll MAXPOLL
params:
IBURST:
if:
- ntp_iburst
- {get_param: NtpIburstEnable}
- iburst
- ''
MINPOLL: { get_param: MinPoll }
MAXPOLL: { get_param: MaxPoll }
- {get_param: ChronyGlobalServerOptions}
chrony_global_pool_settings:
if:
- chrony_global_pool_settings_is_empty
- chrony_global_pool_settings_set
- {get_param: ChronyGlobalPoolOptions}
- str_replace:
template: IBURST minpoll MINPOLL maxpoll MAXPOLL
params:
IBURST:
if:
- ntp_iburst
- {get_param: NtpIburstEnable}
- iburst
- ''
MINPOLL: { get_param: MinPoll }
MAXPOLL: { get_param: MaxPoll }
- {get_param: ChronyGlobalPoolOptions}
chrony_manage_package: {get_param: EnablePackageInstall}
chrony_acl_rules: {get_param: ChronyAclRules}
ptp_interfaces: {get_attr: [RoleParametersValue, value, tripleo_ptp_interfaces]}

View File

@ -89,9 +89,10 @@ parameters:
type: comma_delimited_list
conditions:
chrony_global_server_settings_is_empty: {equals: [{get_param: ChronyGlobalServerOptions}, '']}
chrony_global_pool_settings_is_empty: {equals: [{get_param: ChronyGlobalPoolOptions}, '']}
ntp_iburst: {equals: [{get_param: NtpIburstEnable}, true]}
chrony_global_server_settings_set:
not: {equals: [{get_param: ChronyGlobalServerOptions}, '']}
chrony_global_pool_settings_set:
not: {equals: [{get_param: ChronyGlobalPoolOptions}, '']}
outputs:
role_data:
@ -127,31 +128,31 @@ outputs:
chrony_ntp_pools: {get_param: NtpPool}
chrony_global_server_settings:
if:
- chrony_global_server_settings_is_empty
- chrony_global_server_settings_set
- {get_param: ChronyGlobalServerOptions}
- str_replace:
template: IBURST minpoll MINPOLL maxpoll MAXPOLL
params:
IBURST:
if:
- ntp_iburst
- {get_param: NtpIburstEnable}
- iburst
- ''
MINPOLL: { get_param: MinPoll }
MAXPOLL: { get_param: MaxPoll }
- {get_param: ChronyGlobalServerOptions}
chrony_global_pool_settings:
if:
- chrony_global_pool_settings_is_empty
- chrony_global_pool_settings_set
- {get_param: ChronyGlobalPoolOptions}
- str_replace:
template: IBURST minpoll MINPOLL maxpoll MAXPOLL
params:
IBURST:
if:
- ntp_iburst
- {get_param: NtpIburstEnable}
- iburst
- ''
MINPOLL: { get_param: MinPoll }
MAXPOLL: { get_param: MaxPoll }
- {get_param: ChronyGlobalPoolOptions}
chrony_manage_package: {get_param: EnablePackageInstall}
chrony_acl_rules: {get_param: ChronyAclRules}