mirror of
https://github.com/valitydev/salt-common.git
synced 2024-11-06 10:25:23 +00:00
yaml anchors disable
This commit is contained in:
parent
70f5e07327
commit
96f423a396
@ -3,6 +3,10 @@
|
||||
from salt.utils import dictupdate
|
||||
import yaml
|
||||
|
||||
class NoAliasDumper(yaml.SafeDumper):
|
||||
def ignore_aliases(self, data):
|
||||
return True
|
||||
|
||||
conf_path = '/etc/elasticsearch/'
|
||||
log_path = '/var/log/elasticsearch/'
|
||||
data_path = '/var/lib/elasticsearch/'
|
||||
@ -26,7 +30,7 @@ File.directory(
|
||||
fqdn = grains('fqdn')
|
||||
fqdn_ipv6 = grains('fqdn_ipv6')
|
||||
nodes = pillar('elastic:nodes', {})
|
||||
master_nodes = nodes.get('master', {})
|
||||
master_nodes = nodes.get('master', [])
|
||||
if not 'data' in nodes:
|
||||
nodes['data'] = master_nodes
|
||||
if not 'ingest' in nodes:
|
||||
@ -126,7 +130,7 @@ dictupdate.update(config, pillar('elastic:config'))
|
||||
File.managed(
|
||||
conf_path + 'elasticsearch.yml',
|
||||
mode=644, user='root', group='root',
|
||||
contents="# This file is generated by Salt\n" + yaml.dump(config),
|
||||
contents="# This file is generated by Salt\n" + yaml.dump(config, Dumper=NoAliasDumper),
|
||||
require=[File(conf_path)])
|
||||
|
||||
File.managed(
|
||||
|
Loading…
Reference in New Issue
Block a user