Don't use custom vars for hiera_data
The scope in an ansible execution is global, which means the hiera module has access to the variables set in the execution. We don't need to wrap the hiera_data variables. Change-Id: Iec87c5c6e2d98aefc93d6f8726ad0ff5b0adaa4f
This commit is contained in:
parent
fb28a5859d
commit
feae1d9f83
|
@ -6,9 +6,6 @@ action: provision
|
||||||
service_name: mariadb
|
service_name: mariadb
|
||||||
namespace: openstack
|
namespace: openstack
|
||||||
|
|
||||||
hiera_data: {}
|
|
||||||
hiera_data_file: ''
|
|
||||||
|
|
||||||
mariadb_config:
|
mariadb_config:
|
||||||
host: '{{service_name}}'
|
host: '{{service_name}}'
|
||||||
root_password: weakpassword
|
root_password: weakpassword
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
- name: Translate hieradata
|
- name: Translate hieradata
|
||||||
include_role:
|
parse_tripleo_hiera:
|
||||||
name: 'ansible-role-k8s-tripleo'
|
hieradata_file: '{{ hieradata_file }}'
|
||||||
vars:
|
hieradata: '{{ hieradata }}'
|
||||||
hieradata: '{{hiera_data}}'
|
|
||||||
hieradata_file: '{{hiera_data_file}}'
|
|
||||||
schema:
|
schema:
|
||||||
tripleo::profile::base::database::mysql::bind_address: bind_address
|
tripleo::profile::base::database::mysql::bind_address: bind_address
|
||||||
tripleo::profile::base::database::mysql::mysql_server_options: mysql_server_options
|
tripleo::profile::base::database::mysql::mysql_server_options: mysql_server_options
|
||||||
|
@ -11,7 +9,17 @@
|
||||||
mysql_clustercheck_password: clustercheck_password
|
mysql_clustercheck_password: clustercheck_password
|
||||||
mysql_max_connections: mysql_max_connections
|
mysql_max_connections: mysql_max_connections
|
||||||
default: '{{mariadb_config}}'
|
default: '{{mariadb_config}}'
|
||||||
fact_variable: 'mariadb_config'
|
when:
|
||||||
|
- hieradata or hieradata_file
|
||||||
|
- schema
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Set facts
|
||||||
|
set_fact:
|
||||||
|
mariadb_config: '{{result.conf_dict}}'
|
||||||
|
when:
|
||||||
|
- result.conf_dict is defined
|
||||||
|
- fact_variable != ''
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
var: mariadb_config
|
var: mariadb_config
|
||||||
|
|
Loading…
Reference in New Issue