Vendor Galaxy Roles and Collections
This commit is contained in:
parent
c1e1897cda
commit
2aed20393f
3 changed files with 387444 additions and 2 deletions
|
|
@ -0,0 +1,27 @@
|
|||
{# Copyright (C) 2015-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2015-2017 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#}
|
||||
{% set mariadb__tpl_client = ansible_local.mariadb.client | d(mariadb__client) %}
|
||||
{% set mariadb__tpl_delegate_to = ansible_local.mariadb.delegate_to | d(mariadb__delegate_to) %}
|
||||
{% set mariadb__tpl_host = ansible_local.mariadb.host | d(mariadb__client) %}
|
||||
{% set mariadb__tpl_server = ansible_local.mariadb.server | d(mariadb__server) %}
|
||||
{% if mariadb__register_version.stdout %}
|
||||
{% set mariadb__tpl_client = "localhost" %}
|
||||
{% set mariadb__tpl_delegate_to = mariadb__delegate_to %}
|
||||
{% set mariadb__tpl_host = "localhost" %}
|
||||
{% set mariadb__tpl_server = "localhost" %}
|
||||
{% elif mariadb__register_tunnel | d() and mariadb__register_tunnel.rc == 0 %}
|
||||
{% set mariadb__tpl_client = "localhost" %}
|
||||
{% set mariadb__tpl_delegate_to = mariadb__delegate_to %}
|
||||
{% set mariadb__tpl_host = "localhost" %}
|
||||
{% set mariadb__tpl_server = "localhost" %}
|
||||
{% endif %}
|
||||
{
|
||||
"client": "{{ mariadb__tpl_client }}",
|
||||
"delegate_to": "{{ mariadb__tpl_delegate_to }}",
|
||||
"flavor": "{{ ansible_local.mariadb.flavor | d(mariadb__flavor) }}",
|
||||
"host": "{{ mariadb__tpl_host }}",
|
||||
"port": "{{ ansible_local.mariadb.port | d(mariadb__port) }}",
|
||||
"server": "{{ mariadb__tpl_server }}"
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
{# Copyright (C) 2015-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2015-2017 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#}
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% macro print_config(config) %}
|
||||
{% if config is mapping %}
|
||||
{% if 'section' in config.keys() %}
|
||||
{% if config.state | d('present') == 'present' %}
|
||||
{% if config.comment | d() %}
|
||||
{{ config.comment | comment(postfix='') -}}
|
||||
{% endif %}
|
||||
[{{ config.section }}]
|
||||
|
||||
{% if config.options | d() %}
|
||||
{% if config.options is mapping %}
|
||||
{{ print_config(config.options) -}}
|
||||
{% else %}
|
||||
{% for element in config.options %}
|
||||
{{ print_config(element) -}}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% elif 'name' in config.keys() %}
|
||||
{% if config.state | d('present') == 'present' %}
|
||||
{% if config.comment | d() %}
|
||||
{{ config.comment | comment(postfix='') -}}
|
||||
{% endif %}
|
||||
{% if config.options | d() %}
|
||||
{% if config.options is mapping %}
|
||||
{{ print_config(config.options) -}}
|
||||
{% else %}
|
||||
{% for element in config.options %}
|
||||
{{ print_config(element) -}}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% elif config.value | d() %}
|
||||
{{ '%-30s = "%s"' | format(config.name, config.value) }}
|
||||
{% else %}
|
||||
{{ config.name }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if config %}
|
||||
{% for option in config.keys() | sort %}
|
||||
{% if config[option] is not none %}
|
||||
{{ '%-30s = "%s"' | format(option, config[option]) }}
|
||||
{% else %}
|
||||
{{ option }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for element in config %}
|
||||
{{ print_config(element) -}}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
{% for item in mariadb__client_options %}
|
||||
{{ print_config(item) -}}
|
||||
{% endfor %}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
{# Copyright (C) 2015-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2015-2017 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#}
|
||||
{% set item = item.0 %}
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[client]
|
||||
|
||||
{% if mariadb__server != "localhost" %}
|
||||
host={{ item.server | d(mariadb__server) }}
|
||||
port={{ item.server_port | d(mariadb__port) }}
|
||||
{% else %}
|
||||
# host={{ item.server | d(mariadb__server) }}
|
||||
# port={{ item.server_port | d(mariadb__port) }}
|
||||
{% endif %}
|
||||
user={{ item.user | d(item.name) }}
|
||||
password="{{ item.password | default(lookup('password', secret + '/mariadb/' + mariadb__delegate_to | d('undefined') + '/credentials/' + item.user | d(item.name) + '/password ' + 'length=' + mariadb__password_length)) }}"
|
||||
{% if item.database | d(False) %}
|
||||
database={{ item.database }}
|
||||
{% endif %}
|
||||
{% if item.options | d(False) %}
|
||||
{{ item.options }}
|
||||
{% endif %}
|
||||
Loading…
Reference in a new issue