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 type: boolean
conditions: conditions:
ssh_firewall_allow_all: {equals: [{get_param: SshFirewallAllowAll}, true]} ssh_banner_text_set:
ssh_banner_text_empty: {equals: [{get_param: BannerText}, '']} not: {equals: [{get_param: BannerText}, '']}
ssh_motd_text_empty: {equals: [{get_param: MessageOfTheDay}, '']} ssh_motd_text_set:
not: {equals: [{get_param: MessageOfTheDay}, '']}
outputs: outputs:
role_data: role_data:
@ -86,7 +87,7 @@ outputs:
proto: 'tcp' proto: 'tcp'
dport: 22 dport: 22
extras: extras:
ensure: {if: [ssh_firewall_allow_all, 'present', 'absent']} ensure: {if: [{get_param: SshFirewallAllowAll}, 'present', 'absent']}
host_prep_config: host_prep_config:
- include_role: - include_role:
name: tripleo_ssh name: tripleo_ssh
@ -98,13 +99,13 @@ outputs:
tripleo_sshd_password_authentication: {get_param: PasswordAuthentication} tripleo_sshd_password_authentication: {get_param: PasswordAuthentication}
tripleo_sshd_banner_enabled: tripleo_sshd_banner_enabled:
if: if:
- ssh_banner_text_empty - ssh_banner_text_set
- true - true
- false - false
tripleo_sshd_banner_text: {get_param: BannerText} tripleo_sshd_banner_text: {get_param: BannerText}
tripleo_sshd_motd_enabled: tripleo_sshd_motd_enabled:
if: if:
- ssh_motd_text_empty - ssh_motd_text_set
- true - true
- false - false
tripleo_sshd_message_of_the_day: {get_param: MessageOfTheDay} 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. description: Set this to true to open up ssh access from all sources.
type: boolean type: boolean
conditions:
ssh_firewall_allow_all: {equals: [{get_param: SshFirewallAllowAll}, true]}
outputs: outputs:
role_data: role_data:
description: Role data for the ssh description: Role data for the ssh
@ -84,7 +81,7 @@ outputs:
proto: 'tcp' proto: 'tcp'
dport: 22 dport: 22
extras: extras:
ensure: {if: [ssh_firewall_allow_all, 'present', 'absent']} ensure: {if: [{get_param: SshFirewallAllowAll}, 'present', 'absent']}
config_settings: config_settings:
tripleo::profile::base::sshd::bannertext: {get_param: BannerText} tripleo::profile::base::sshd::bannertext: {get_param: BannerText}
tripleo::profile::base::sshd::motd: {get_param: MessageOfTheDay} tripleo::profile::base::sshd::motd: {get_param: MessageOfTheDay}

View File

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

View File

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