Vendor Galaxy Roles and Collections
This commit is contained in:
parent
c1e1897cda
commit
2aed20393f
3553 changed files with 387444 additions and 2 deletions
19
ansible_collections/debops/debops/roles/salt/COPYRIGHT
Normal file
19
ansible_collections/debops/debops/roles/salt/COPYRIGHT
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
debops.salt - Manage Salt Master service using Ansible
|
||||
|
||||
Copyright (C) 2014-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
Copyright (C) 2014-2017 DebOps <https://debops.org/>
|
||||
SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
This Ansible role is part of DebOps.
|
||||
|
||||
DebOps is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 3, as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
DebOps is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with DebOps. If not, see https://www.gnu.org/licenses/.
|
||||
203
ansible_collections/debops/debops/roles/salt/defaults/main.yml
Normal file
203
ansible_collections/debops/debops/roles/salt/defaults/main.yml
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
---
|
||||
# .. vim: foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
||||
# .. Copyright (C) 2014-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# .. Copyright (C) 2014-2017 DebOps <https://debops.org/>
|
||||
# .. SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
# .. _salt__ref_defaults:
|
||||
|
||||
# debops.salt default variables [[[
|
||||
# =================================
|
||||
|
||||
# .. contents:: Sections
|
||||
# :local:
|
||||
#
|
||||
# .. include:: ../../../../includes/global.rst
|
||||
|
||||
|
||||
# Upstream configuration [[[
|
||||
# --------------------------
|
||||
|
||||
# .. envvar:: salt__upstream [[[
|
||||
#
|
||||
# Enable or disable upstream APT repository.
|
||||
salt__upstream: '{{ True
|
||||
if (ansible_distribution_release in ["trusty"])
|
||||
else False }}'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__upstream_branch [[[
|
||||
#
|
||||
# Specify the SaltStack "branch" to install from upstream APT repository.
|
||||
# See https://repo.saltstack.com/#debian for more details about available
|
||||
# upstream branches.
|
||||
salt__upstream_branch: 'latest'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__upstream_arch_map [[[
|
||||
#
|
||||
# A YAML dictionary that maps the ``ansible_architecture`` variable with its
|
||||
# corresponding processor architecture used in the SaltStack repository URLs.
|
||||
salt__upstream_arch_map:
|
||||
'x86_64': 'amd64'
|
||||
'armhf': 'armhf'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__upstream_apt_key_id [[[
|
||||
#
|
||||
# Specify the upstream APT repository GPG key id to configure.
|
||||
salt__upstream_apt_key_id: '754A1A7AE731F165D5E6D4BD0E08A149DE57BFBE'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__upstream_apt_repo_map [[[
|
||||
#
|
||||
# A YAML dictionary that defines the upstream APT repository URLs depending on
|
||||
# the current OS distribution, release and processor architecture.
|
||||
salt__upstream_apt_repo_map:
|
||||
Debian: '{{ "deb http://repo.saltstack.com/apt/debian/"
|
||||
+ ansible_distribution_major_version + "/" + salt__upstream_arch_map[ansible_architecture]
|
||||
+ "/" + salt__upstream_branch + " " + ansible_distribution_release + " main" }}'
|
||||
Ubuntu: '{{ "deb http://repo.saltstack.com/apt/ubuntu/"
|
||||
+ ansible_distribution_version + "/" + salt__upstream_arch_map[ansible_architecture]
|
||||
+ "/" + salt__upstream_branch + " " + ansible_distribution_release + " main" }}'
|
||||
# ]]]
|
||||
# ]]]
|
||||
# APT packages [[[
|
||||
# ----------------
|
||||
|
||||
# .. envvar:: salt__base_packages [[[
|
||||
#
|
||||
# List of base APT packages to install for Salt Master service.
|
||||
salt__base_packages: [ 'salt-master' ]
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__packages [[[
|
||||
#
|
||||
# List of additional APT packages to install with Salt Master.
|
||||
salt__packages: []
|
||||
# ]]]
|
||||
# ]]]
|
||||
# Firewall configuration [[[
|
||||
# --------------------------
|
||||
|
||||
# .. envvar:: salt__allow [[[
|
||||
#
|
||||
# List of IP addresses or CIDR subnets that can connect to the Salt Master
|
||||
# service. If the list is empty, any host is allowed to connect.
|
||||
salt__allow: []
|
||||
# ]]]
|
||||
# ]]]
|
||||
# Salt Master configuration [[[
|
||||
# -----------------------------
|
||||
|
||||
# .. envvar:: salt__configuration [[[
|
||||
#
|
||||
# Enable or disable configuration of Salt Master by Ansible.
|
||||
salt__configuration: True
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__configuration_file [[[
|
||||
#
|
||||
# Absolute path of the Salt Master configuration file which will be managed by
|
||||
# Ansible.
|
||||
salt__configuration_file: '/etc/salt/master.d/ansible.conf'
|
||||
# ]]]
|
||||
# ]]]
|
||||
# Salt configuration options [[[
|
||||
# ------------------------------
|
||||
|
||||
# .. envvar:: salt__interface [[[
|
||||
#
|
||||
# Specify the network interface the Salt Master will listen on for connections,
|
||||
# using an IP address specification.
|
||||
salt__interface: '{{ "::" if salt__ipv6 | bool else "0.0.0.0" }}'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__ipv6 [[[
|
||||
#
|
||||
# Enable/disable IPv6 support in Salt Master.
|
||||
salt__ipv6: True
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__publish_port [[[
|
||||
#
|
||||
# The network port to set up the publication interface.
|
||||
salt__publish_port: '4505'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__return_port [[[
|
||||
#
|
||||
# The port used by the return server, this is the server used by Salt to
|
||||
# receive execution returns and command executions.
|
||||
salt__return_port: '4506'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__worker_threads [[[
|
||||
#
|
||||
# Number of Salt Master workers to run.
|
||||
salt__worker_threads: '{{ ansible_processor_vcpus }}'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__custom_options [[[
|
||||
#
|
||||
# Additional Salt Master options in YAML text block format.
|
||||
salt__custom_options: ''
|
||||
# ]]]
|
||||
# ]]]
|
||||
# Configuration for other Ansible roles [[[
|
||||
# -----------------------------------------
|
||||
|
||||
# .. envvar:: salt__keyring__dependent_apt_keys [[[
|
||||
#
|
||||
# Configuration for the :ref:`debops.keyring` Ansible role.
|
||||
salt__keyring__dependent_apt_keys:
|
||||
|
||||
- id: '{{ salt__upstream_apt_key_id }}'
|
||||
repo: '{{ salt__upstream_apt_repo_map[ansible_distribution] }}'
|
||||
state: '{{ "present" if salt__upstream | bool else "absent" }}'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__python__dependent_packages3 [[[
|
||||
#
|
||||
# Configuration for the :ref:`debops.python` Ansible role.
|
||||
salt__python__dependent_packages3:
|
||||
|
||||
- 'python3-tornado'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__python__dependent_packages2 [[[
|
||||
#
|
||||
# Configuration for the :ref:`debops.python` Ansible role.
|
||||
salt__python__dependent_packages2:
|
||||
|
||||
- 'python-tornado'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__etc_services__dependent_list [[[
|
||||
#
|
||||
# Configuration for the :ref:`debops.etc_services` Ansible role.
|
||||
salt__etc_services__dependent_list:
|
||||
|
||||
- name: 'salt-publish'
|
||||
port: '{{ salt__publish_port }}'
|
||||
comment: 'Salt Master (publish)'
|
||||
|
||||
- name: 'salt-return'
|
||||
port: '{{ salt__return_port }}'
|
||||
comment: 'Salt Master (return)'
|
||||
|
||||
# ]]]
|
||||
# .. envvar:: salt__ferm__dependent_rules [[[
|
||||
#
|
||||
# Configuration for the :ref:`debops.ferm` Ansible role.
|
||||
salt__ferm__dependent_rules:
|
||||
|
||||
- type: 'accept'
|
||||
dport: [ 'salt-publish', 'salt-return' ]
|
||||
saddr: '{{ salt__allow }}'
|
||||
accept_any: True
|
||||
name: 'salt_accept'
|
||||
# ]]]
|
||||
# ]]]
|
||||
# ]]]
|
||||
31
ansible_collections/debops/debops/roles/salt/meta/main.yml
Normal file
31
ansible_collections/debops/debops/roles/salt/meta/main.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
# Copyright (C) 2014-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2014-2022 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
# Ensure that custom Ansible plugins and modules included in the main DebOps
|
||||
# collection are available to roles in other collections.
|
||||
collections: [ 'debops.debops' ]
|
||||
|
||||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
|
||||
author: 'Maciej Delmanowski'
|
||||
description: 'Install and configure Salt Master service'
|
||||
company: 'DebOps'
|
||||
license: 'GPL-3.0-only'
|
||||
min_ansible_version: '2.2.0'
|
||||
|
||||
platforms:
|
||||
|
||||
- name: 'Ubuntu'
|
||||
versions: [ 'all' ]
|
||||
|
||||
- name: 'Debian'
|
||||
versions: [ 'all' ]
|
||||
|
||||
galaxy_tags:
|
||||
- system
|
||||
- saltstack
|
||||
- configuration
|
||||
33
ansible_collections/debops/debops/roles/salt/tasks/main.yml
Normal file
33
ansible_collections/debops/debops/roles/salt/tasks/main.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
# Copyright (C) 2014-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2014-2017 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
- name: Import DebOps global handlers
|
||||
ansible.builtin.import_role:
|
||||
name: 'global_handlers'
|
||||
|
||||
- name: Install Salt Master packages
|
||||
ansible.builtin.package:
|
||||
name: '{{ q("flattened", (salt__base_packages
|
||||
+ salt__packages)) }}'
|
||||
state: 'present'
|
||||
register: salt__register_packages
|
||||
until: salt__register_packages is succeeded
|
||||
|
||||
- name: Configure Salt Master using Ansible
|
||||
ansible.builtin.template:
|
||||
src: 'etc/salt/master.d/ansible.conf.j2'
|
||||
dest: '{{ salt__configuration_file }}'
|
||||
owner: 'root'
|
||||
group: 'root'
|
||||
mode: '0644'
|
||||
notify: [ 'Restart salt-master' ]
|
||||
when: salt__configuration | bool
|
||||
|
||||
- name: Remove Salt Master configuration file if disabled
|
||||
ansible.builtin.file:
|
||||
path: '{{ salt__configuration_file }}'
|
||||
state: 'absent'
|
||||
notify: [ 'Restart salt-master' ]
|
||||
when: not salt__configuration | bool
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{# Copyright (C) 2014-2017 Maciej Delmanowski <drybjed@gmail.com>
|
||||
# Copyright (C) 2014-2017 DebOps <https://debops.org/>
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#}
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# The address of the interface to bind to
|
||||
interface: '{{ salt__interface }}'
|
||||
|
||||
# Whether the master should listen for IPv6 connections. If this is set to True,
|
||||
# the interface option must be adjusted too (for example: "interface: '::'")
|
||||
ipv6: {{ salt__ipv6 | bool }}
|
||||
|
||||
# The TCP port used by the publisher
|
||||
publish_port: {{ salt__publish_port }}
|
||||
|
||||
# The number of worker threads to start, these threads are used to manage
|
||||
# return calls made from minions to the master, if the master seems to be
|
||||
# running slowly, increase the number of threads
|
||||
worker_threads: {{ salt__worker_threads }}
|
||||
|
||||
# The port used by the communication interface. The ret (return) port is the
|
||||
# interface used for the file server, authentication, job returns, etc.
|
||||
ret_port: {{ salt__return_port }}
|
||||
|
||||
{% if salt__options | d() %}
|
||||
# Custom Salt Master options
|
||||
{{ salt__custom_options }}
|
||||
{% endif %}
|
||||
Loading…
Reference in a new issue