From c16167f3d9f7cb096b3a1e031484474d41225ec2 Mon Sep 17 00:00:00 2001 From: Jill Rouleau Date: Tue, 12 Jun 2018 10:45:18 -0700 Subject: [PATCH] Enable Ansible error handling per role Enable any_errors_fatal and max_fail_percentage Ansible options to be set per TripleO role. This change also provides a structure by which future per-role Ansible options can readily be added to group_vars. Closes-Bug: 1760989 Change-Id: I47954717f42f14bae8d9fd2bd17cd8ea1fd787b3 --- overcloud.j2.yaml | 7 +++++++ puppet/role.role.j2.yaml | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index 76b2e32f32..9e2dd60539 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -1011,6 +1011,13 @@ outputs: value: {% for role in roles %} {{role.name}}: {get_attr: [{{role.name}}IpListMap, net_ip_map]} +{% endfor %} + RoleGroupVars: + description: Mapping of roles to ansible group_vars to be applied config in those roles + value: +{% for role in roles %} + {{role.name}}: + map_merge: {get_attr: [{{role.name}}, role_group_vars]} {% endfor %} RoleNetHostnameMap: description: Mapping of each network to a list of hostnames for each role diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index 88a72b0f85..9f97fe7a93 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -236,6 +236,14 @@ parameters: description: | Name of the subnet on ctlplane network for this role. type: string + {{role.name}}AnyErrorsFatal: + default: yes + type: string + {#- We generally won't want any failures on HA Controller roles, 15% will cause any 1 node to fail the deploy, #} + {#- for a 3 or 5 node Role, making it a fairly safe default. #} + {{role.name}}MaxFailPercentage: + default: 15 + type: number {% if role.uses_deprecated_params|default(false) %} parameter_groups: @@ -754,3 +762,7 @@ outputs: description: IP address of the server in the {{network.name}} network value: {get_attr: [{{network.name}}Port, ip_address]} {%- endfor %} + role_group_vars: + value: + any_errors_fatal: {get_param: {{role.name}}AnyErrorsFatal} + max_fail_percentage: {get_param: {{role.name}}MaxFailPercentage}