Compare commits

..

2 commits

Author SHA1 Message Date
Renich Bon Ciric
3aaeb2ace7 resources: deleted since they're, mostly, trash 2024-06-26 01:03:51 -06:00
Renich Bon Ciric
696a6df320 general cleanup
I've done the following:

* Moved files we don't use often to `resources/`.
* Added a README file to the `resources/` directory.
* Added better help messages on inventory files.
* Renamed a few things in order to be more precise and short.
* Deleted some specific files we do not need here.
2024-06-17 20:20:34 -06:00
30 changed files with 47 additions and 1745 deletions

View file

@ -1,5 +1,5 @@
[defaults]
inventory = inventory-infotec
inventory = inventory-example
remote_user = root
roles_path = ./roles
callbacks_enabled = timer, profile_tasks, profile_roles

View file

@ -1,663 +0,0 @@
[defaults]
# (boolean) By default Ansible will issue a warning when received from a task action (module or action plugin)
# These warnings can be silenced by adjusting this setting to False.
;action_warnings=True
# (list) Accept list of cowsay templates that are 'safe' to use, set to empty list if you want to enable all installed templates.
;cowsay_enabled_stencils=bud-frogs, bunny, cheese, daemon, default, dragon, elephant-in-snake, elephant, eyes, hellokitty, kitty, luke-koala, meow, milk, moofasa, moose, ren, sheep, small, stegosaurus, stimpy, supermilker, three-eyes, turkey, turtle, tux, udder, vader-koala, vader, www
# (string) Specify a custom cowsay path or swap in your cowsay implementation of choice
;cowpath=
# (string) This allows you to chose a specific cowsay stencil for the banners or use 'random' to cycle through them.
;cow_selection=default
# (boolean) This option forces color mode even when running without a TTY or the "nocolor" setting is True.
;force_color=False
# (boolean) This setting allows suppressing colorizing output, which is used to give a better indication of failure and status information.
;nocolor=False
# (boolean) If you have cowsay installed but want to avoid the 'cows' (why????), use this.
;nocows=False
# (boolean) Sets the default value for the any_errors_fatal keyword, if True, Task failures will be considered fatal errors.
;any_errors_fatal=False
# (path) The password file to use for the become plugin. --become-password-file.
# If executable, it will be run and the resulting stdout will be used as the password.
;become_password_file=
# (pathspec) Colon separated paths in which Ansible will search for Become Plugins.
;become_plugins=~/.ansible/plugins/become:/usr/share/ansible/plugins/become
# (string) Chooses which cache plugin to use, the default 'memory' is ephemeral.
;fact_caching=memory
# (string) Defines connection or path information for the cache plugin
;fact_caching_connection=
# (string) Prefix to use for cache plugin files/tables
;fact_caching_prefix=ansible_facts
# (integer) Expiration timeout for the cache plugin data
;fact_caching_timeout=86400
# (list) Whitelist of callable methods to be made available to template evaluation
;callable_enabled=
# (list) List of enabled callbacks, not all callbacks need enabling, but many of those shipped with Ansible do as we don't want them activated by default.
;callbacks_enabled=
# (string) When a collection is loaded that does not support the running Ansible version (via the collection metadata key `requires_ansible`), the default behavior is to issue a warning and continue anyway. Setting this value to `ignore` skips the warning entirely, while setting it to `fatal` will immediately halt Ansible execution.
;collections_on_ansible_version_mismatch=warning
# (pathspec) Colon separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``~/.ansible/collections``, and you want to add ``my.collection`` to that directory, it must be saved as ``~/.ansible/collections/ansible_collections/my/collection``.
;collections_path=~/.ansible/collections:/usr/share/ansible/collections
# (boolean) A boolean to enable or disable scanning the sys.path for installed collections
;collections_scan_sys_path=True
# (boolean) Ansible can issue a warning when the shell or command module is used and the command appears to be similar to an existing Ansible module.
# These warnings can be silenced by adjusting this setting to False. You can also control this at the task level with the module option ``warn``.
# As of version 2.11, this is disabled by default.
;command_warnings=False
# (path) The password file to use for the connection plugin. --connection-password-file.
;connection_password_file=
# (pathspec) Colon separated paths in which Ansible will search for Action Plugins.
;action_plugins=~/.ansible/plugins/action:/usr/share/ansible/plugins/action
# (boolean) When enabled, this option allows lookup plugins (whether used in variables as ``{{lookup('foo')}}`` or as a loop as with_foo) to return data that is not marked 'unsafe'.
# By default, such data is marked as unsafe to prevent the templating engine from evaluating any jinja2 templating language, as this could represent a security risk. This option is provided to allow for backward compatibility, however users should first consider adding allow_unsafe=True to any lookups which may be expected to contain data which may be run through the templating engine late
;allow_unsafe_lookups=False
# (boolean) This controls whether an Ansible playbook should prompt for a login password. If using SSH keys for authentication, you probably do not needed to change this setting.
;ask_pass=False
# (boolean) This controls whether an Ansible playbook should prompt for a vault password.
;ask_vault_pass=False
# (pathspec) Colon separated paths in which Ansible will search for Cache Plugins.
;cache_plugins=~/.ansible/plugins/cache:/usr/share/ansible/plugins/cache
# (pathspec) Colon separated paths in which Ansible will search for Callback Plugins.
;callback_plugins=~/.ansible/plugins/callback:/usr/share/ansible/plugins/callback
# (pathspec) Colon separated paths in which Ansible will search for Cliconf Plugins.
;cliconf_plugins=~/.ansible/plugins/cliconf:/usr/share/ansible/plugins/cliconf
# (pathspec) Colon separated paths in which Ansible will search for Connection Plugins.
;connection_plugins=~/.ansible/plugins/connection:/usr/share/ansible/plugins/connection
# (boolean) Toggles debug output in Ansible. This is *very* verbose and can hinder multiprocessing. Debug output can also include secret information despite no_log settings being enabled, which means debug mode should not be used in production.
;debug=False
# (string) This indicates the command to use to spawn a shell under for Ansible's execution needs on a target. Users may need to change this in rare instances when shell usage is constrained, but in most cases it may be left as is.
;executable=/bin/sh
# (string) This option allows you to globally configure a custom path for 'local_facts' for the implied M(ansible.builtin.setup) task when using fact gathering.
# If not set, it will fallback to the default from the M(ansible.builtin.setup) module: ``/etc/ansible/facts.d``.
# This does **not** affect user defined tasks that use the M(ansible.builtin.setup) module.
;fact_path=
# (pathspec) Colon separated paths in which Ansible will search for Jinja2 Filter Plugins.
;filter_plugins=~/.ansible/plugins/filter:/usr/share/ansible/plugins/filter
# (boolean) This option controls if notified handlers run on a host even if a failure occurs on that host.
# When false, the handlers will not run if a failure has occurred on a host.
# This can also be set per play or on the command line. See Handlers and Failure for more details.
;force_handlers=False
# (integer) Maximum number of forks Ansible will use to execute tasks on target hosts.
;forks=5
# (string) This setting controls the default policy of fact gathering (facts discovered about remote systems).
# When 'implicit' (the default), the cache plugin will be ignored and facts will be gathered per play unless 'gather_facts: False' is set.
# When 'explicit' the inverse is true, facts will not be gathered unless directly requested in the play.
# The 'smart' value means each new host that has no facts discovered will be scanned, but if the same host is addressed in multiple plays it will not be contacted again in the playbook run.
# This option can be useful for those wishing to save fact gathering time. Both 'smart' and 'explicit' will use the cache plugin.
;gathering=implicit
# (list) Set the `gather_subset` option for the M(ansible.builtin.setup) task in the implicit fact gathering. See the module documentation for specifics.
# It does **not** apply to user defined M(ansible.builtin.setup) tasks.
;gather_subset=all
# (integer) Set the timeout in seconds for the implicit fact gathering.
# It does **not** apply to user defined M(ansible.builtin.setup) tasks.
;gather_timeout=10
# (string) This setting controls how duplicate definitions of dictionary variables (aka hash, map, associative array) are handled in Ansible.
# This does not affect variables whose values are scalars (integers, strings) or arrays.
# **WARNING**, changing this setting is not recommended as this is fragile and makes your content (plays, roles, collections) non portable, leading to continual confusion and misuse. Don't change this setting unless you think you have an absolute need for it.
# We recommend avoiding reusing variable names and relying on the ``combine`` filter and ``vars`` and ``varnames`` lookups to create merged versions of the individual variables. In our experience this is rarely really needed and a sign that too much complexity has been introduced into the data structures and plays.
# For some uses you can also look into custom vars_plugins to merge on input, even substituting the default ``host_group_vars`` that is in charge of parsing the ``host_vars/`` and ``group_vars/`` directories. Most users of this setting are only interested in inventory scope, but the setting itself affects all sources and makes debugging even harder.
# All playbooks and roles in the official examples repos assume the default for this setting.
# Changing the setting to ``merge`` applies across variable sources, but many sources will internally still overwrite the variables. For example ``include_vars`` will dedupe variables internally before updating Ansible, with 'last defined' overwriting previous definitions in same file.
# The Ansible project recommends you **avoid ``merge`` for new projects.**
# It is the intention of the Ansible developers to eventually deprecate and remove this setting, but it is being kept as some users do heavily rely on it. New projects should **avoid 'merge'**.
;hash_behaviour=replace
# (pathlist) Comma separated list of Ansible inventory sources
;inventory=/etc/ansible/hosts
# (pathspec) Colon separated paths in which Ansible will search for HttpApi Plugins.
;httpapi_plugins=~/.ansible/plugins/httpapi:/usr/share/ansible/plugins/httpapi
# (float) This sets the interval (in seconds) of Ansible internal processes polling each other. Lower values improve performance with large playbooks at the expense of extra CPU load. Higher values are more suitable for Ansible usage in automation scenarios, when UI responsiveness is not required but CPU usage might be a concern.
# The default corresponds to the value hardcoded in Ansible <= 2.1
;internal_poll_interval=0.001
# (pathspec) Colon separated paths in which Ansible will search for Inventory Plugins.
;inventory_plugins=~/.ansible/plugins/inventory:/usr/share/ansible/plugins/inventory
# (string) This is a developer-specific feature that allows enabling additional Jinja2 extensions.
# See the Jinja2 documentation for details. If you do not know what these do, you probably don't need to change this setting :)
;jinja2_extensions=[]
# (boolean) This option preserves variable types during template operations. This requires Jinja2 >= 2.10.
;jinja2_native=False
# (boolean) Enables/disables the cleaning up of the temporary files Ansible used to execute the tasks on the remote.
# If this option is enabled it will disable ``ANSIBLE_PIPELINING``.
;keep_remote_files=False
# (boolean) Controls whether callback plugins are loaded when running /usr/bin/ansible. This may be used to log activity from the command line, send notifications, and so on. Callback plugins are always loaded for ``ansible-playbook``.
;bin_ansible_callbacks=False
# (tmppath) Temporary directory for Ansible to use on the controller.
;local_tmp=~/.ansible/tmp
# (list) List of logger names to filter out of the log file
;log_filter=
# (path) File to which Ansible will log on the controller. When empty logging is disabled.
;log_path=
# (pathspec) Colon separated paths in which Ansible will search for Lookup Plugins.
;lookup_plugins=~/.ansible/plugins/lookup:/usr/share/ansible/plugins/lookup
# (string) Sets the macro for the 'ansible_managed' variable available for M(ansible.builtin.template) and M(ansible.windows.win_template) modules. This is only relevant for those two modules.
;ansible_managed=Ansible managed
# (string) This sets the default arguments to pass to the ``ansible`` adhoc binary if no ``-a`` is specified.
;module_args=
# (string) Compression scheme to use when transferring Python modules to the target.
;module_compression=ZIP_DEFLATED
# (string) Module to use with the ``ansible`` AdHoc command, if none is specified via ``-m``.
;module_name=command
# (pathspec) Colon separated paths in which Ansible will search for Modules.
;library=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
# (pathspec) Colon separated paths in which Ansible will search for Module utils files, which are shared by modules.
;module_utils=~/.ansible/plugins/module_utils:/usr/share/ansible/plugins/module_utils
# (pathspec) Colon separated paths in which Ansible will search for Netconf Plugins.
;netconf_plugins=~/.ansible/plugins/netconf:/usr/share/ansible/plugins/netconf
# (boolean) Toggle Ansible's display and logging of task details, mainly used to avoid security disclosures.
;no_log=False
# (boolean) Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts this will disable a newer style PowerShell modules from writting to the event log.
;no_target_syslog=False
# (none) What templating should return as a 'null' value. When not set it will let Jinja2 decide.
;null_representation=
# (integer) For asynchronous tasks in Ansible (covered in Asynchronous Actions and Polling), this is how often to check back on the status of those tasks when an explicit poll interval is not supplied. The default is a reasonably moderate 15 seconds which is a tradeoff between checking in frequently and providing a quick turnaround when something may have completed.
;poll_interval=15
# (path) Option for connections using a certificate or key file to authenticate, rather than an agent or passwords, you can set the default value here to avoid re-specifying --private-key with every invocation.
;private_key_file=
# (boolean) Makes role variables inaccessible from other roles.
# This was introduced as a way to reset role variables to default values if a role is used more than once in a playbook.
;private_role_vars=False
# (integer) Port to use in remote connections, when blank it will use the connection plugin default.
;remote_port=
# (string) Sets the login user for the target machines
# When blank it uses the connection plugin's default, normally the user currently executing Ansible.
;remote_user=
# (pathspec) Colon separated paths in which Ansible will search for Roles.
;roles_path=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
# (string) Set the main callback used to display Ansible output, you can only have one at a time.
# You can have many other callbacks, but just one can be in charge of stdout.
;stdout_callback=default
# (string) Set the default strategy used for plays.
;strategy=linear
# (pathspec) Colon separated paths in which Ansible will search for Strategy Plugins.
;strategy_plugins=~/.ansible/plugins/strategy:/usr/share/ansible/plugins/strategy
# (boolean) Toggle the use of "su" for tasks.
;su=False
# (string) Syslog facility to use when Ansible logs to the remote target
;syslog_facility=LOG_USER
# (pathspec) Colon separated paths in which Ansible will search for Terminal Plugins.
;terminal_plugins=~/.ansible/plugins/terminal:/usr/share/ansible/plugins/terminal
# (pathspec) Colon separated paths in which Ansible will search for Jinja2 Test Plugins.
;test_plugins=~/.ansible/plugins/test:/usr/share/ansible/plugins/test
# (integer) This is the default timeout for connection plugins to use.
;timeout=10
# (string) Default connection plugin to use, the 'smart' option will toggle between 'ssh' and 'paramiko' depending on controller OS and ssh versions
;transport=smart
# (boolean) When True, this causes ansible templating to fail steps that reference variable names that are likely typoed.
# Otherwise, any '{{ template_expression }}' that contains undefined variables will be rendered in a template or ansible action line exactly as written.
;error_on_undefined_vars=True
# (pathspec) Colon separated paths in which Ansible will search for Vars Plugins.
;vars_plugins=~/.ansible/plugins/vars:/usr/share/ansible/plugins/vars
# (string) The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The --encrypt-vault-id cli option overrides the configured value.
;vault_encrypt_identity=
# (string) The label to use for the default vault id label in cases where a vault id label is not provided
;vault_identity=default
# (list) A list of vault-ids to use by default. Equivalent to multiple --vault-id args. Vault-ids are tried in order.
;vault_identity_list=
# (string) If true, decrypting vaults with a vault id will only try the password from the matching vault-id
;vault_id_match=False
# (path) The vault password file to use. Equivalent to --vault-password-file or --vault-id
# If executable, it will be run and the resulting stdout will be used as the password.
;vault_password_file=
# (integer) Sets the default verbosity, equivalent to the number of ``-v`` passed in the command line.
;verbosity=0
# (boolean) Toggle to control the showing of deprecation warnings
;deprecation_warnings=True
# (boolean) Toggle to control showing warnings related to running devel
;devel_warning=True
# (boolean) Normally ``ansible-playbook`` will print a header for each task that is run. These headers will contain the name: field from the task if you specified one. If you didn't then ``ansible-playbook`` uses the task's action to help you tell which task is presently running. Sometimes you run many of the same action and so you want more information about the task to differentiate it from others of the same action. If you set this variable to True in the config then ``ansible-playbook`` will also include the task's arguments in the header.
# This setting defaults to False because there is a chance that you have sensitive values in your parameters and you do not want those to be printed.
# If you set this to True you should be sure that you have secured your environment's stdout (no one can shoulder surf your screen and you aren't saving stdout to an insecure file) or made sure that all of your playbooks explicitly added the ``no_log: True`` parameter to tasks which have sensitive values See How do I keep secret data in my playbook? for more information.
;display_args_to_stdout=False
# (boolean) Toggle to control displaying skipped task/host entries in a task in the default callback
;display_skipped_hosts=True
# (string) Root docsite URL used to generate docs URLs in warning/error text; must be an absolute URL with valid scheme and trailing slash.
;docsite_root_url=https://docs.ansible.com/ansible-core/
# (pathspec) Colon separated paths in which Ansible will search for Documentation Fragments Plugins.
;doc_fragment_plugins=~/.ansible/plugins/doc_fragments:/usr/share/ansible/plugins/doc_fragments
# (string) By default Ansible will issue a warning when a duplicate dict key is encountered in YAML.
# These warnings can be silenced by adjusting this setting to False.
;duplicate_dict_key=warn
# (boolean) Whether or not to enable the task debugger, this previously was done as a strategy plugin.
# Now all strategy plugins can inherit this behavior. The debugger defaults to activating when
# a task is failed on unreachable. Use the debugger keyword for more flexibility.
;enable_task_debugger=False
# (boolean) Toggle to allow missing handlers to become a warning instead of an error when notifying.
;error_on_missing_handler=True
# (list) Which modules to run during a play's fact gathering stage, using the default of 'smart' will try to figure it out based on connection type.
;facts_modules=smart
# (boolean) Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host
;host_key_checking=True
# (boolean) Facts are available inside the `ansible_facts` variable, this setting also pushes them as their own vars in the main namespace.
# Unlike inside the `ansible_facts` dictionary, these will have an `ansible_` prefix.
;inject_facts_as_vars=True
# (string) Path to the Python interpreter to be used for module execution on remote targets, or an automatic discovery mode. Supported discovery modes are ``auto`` (the default), ``auto_silent``, ``auto_legacy``, and ``auto_legacy_silent``. All discovery modes employ a lookup table to use the included system Python (on distributions known to include one), falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backwards-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter if present.
;interpreter_python=auto
# (boolean) If 'false', invalid attributes for a task will result in warnings instead of errors
;invalid_task_attribute_failed=True
# (boolean) Toggle to control showing warnings related to running a Jinja version older than required for jinja2_native
;jinja2_native_warning=True
# (boolean) By default Ansible will issue a warning when there are no hosts in the inventory.
# These warnings can be silenced by adjusting this setting to False.
;localhost_warning=True
# (int) Maximum size of files to be considered for diff display
;max_diff_size=104448
# (list) List of extensions to ignore when looking for modules to load
# This is for rejecting script and binary module fallback extensions
;module_ignore_exts={{(REJECT_EXTS + ('.yaml', '.yml', '.ini'))}}
# (list) TODO: write it
;network_group_modules=eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx, netconf, exos, voss, slxos
# (boolean) Previously Ansible would only clear some of the plugin loading caches when loading new roles, this led to some behaviours in which a plugin loaded in prevoius plays would be unexpectedly 'sticky'. This setting allows to return to that behaviour.
;old_plugin_cache_clear=False
# (path) A number of non-playbook CLIs have a ``--playbook-dir`` argument; this sets the default value for it.
;playbook_dir=
# (string) This sets which playbook dirs will be used as a root to process vars plugins, which includes finding host_vars/group_vars
# The ``top`` option follows the traditional behaviour of using the top playbook in the chain to find the root directory.
# The ``bottom`` option follows the 2.4.0 behaviour of using the current playbook to find the root directory.
# The ``all`` option examines from the first parent to the current playbook.
;playbook_vars_root=top
# (path) A path to configuration for filtering which plugins installed on the system are allowed to be used.
# See :ref:`plugin_filtering_config` for details of the filter file's format.
# The default is /etc/ansible/plugin_filters.yml
;plugin_filters_cfg=
# (string) Attempts to set RLIMIT_NOFILE soft limit to the specified value when executing Python modules (can speed up subprocess usage on Python 2.x. See https://bugs.python.org/issue11284). The value will be limited by the existing hard limit. Default value of 0 does not attempt to adjust existing system-defined limits.
;python_module_rlimit_nofile=0
# (bool) This controls whether a failed Ansible playbook should create a .retry file.
;retry_files_enabled=False
# (path) This sets the path in which Ansible will save .retry files when a playbook fails and retry files are enabled.
# This file will be overwritten after each run with the list of failed hosts from all plays.
;retry_files_save_path=
# (str) This setting can be used to optimize vars_plugin usage depending on user's inventory size and play selection.
# Setting to C(demand) will run vars_plugins relative to inventory sources anytime vars are 'demanded' by tasks.
# Setting to C(start) will run vars_plugins relative to inventory sources after importing that inventory source.
;run_vars_plugins=demand
# (bool) This adds the custom stats set via the set_stats plugin to the default output
;show_custom_stats=False
# (string) Action to take when a module parameter value is converted to a string (this does not affect variables). For string parameters, values such as '1.00', "['a', 'b',]", and 'yes', 'y', etc. will be converted by the YAML parser unless fully quoted.
# Valid options are 'error', 'warn', and 'ignore'.
# Since 2.8, this option defaults to 'warn' but will change to 'error' in 2.12.
;string_conversion_action=warn
# (boolean) Allows disabling of warnings related to potential issues on the system running ansible itself (not on the managed hosts)
# These may include warnings about 3rd party packages or other conditions that should be resolved if possible.
;system_warnings=True
# (boolean) This option defines whether the task debugger will be invoked on a failed task when ignore_errors=True is specified.
# True specifies that the debugger will honor ignore_errors, False will not honor ignore_errors.
;task_debugger_ignore_errors=True
# (integer) Set the maximum time (in seconds) that a task can run for.
# If set to 0 (the default) there is no timeout.
;task_timeout=0
# (string) Make ansible transform invalid characters in group names supplied by inventory sources.
# If 'never' it will allow for the group name but warn about the issue.
# When 'ignore', it does the same as 'never', without issuing a warning.
# When 'always' it will replace any invalid characters with '_' (underscore) and warn the user
# When 'silently', it does the same as 'always', without issuing a warning.
;force_valid_group_names=never
# (boolean) Toggles the use of persistence for connections.
;use_persistent_connections=False
# (bool) A toggle to disable validating a collection's 'metadata' entry for a module_defaults action group. Metadata containing unexpected fields or value types will produce a warning when this is True.
;validate_action_group_metadata=True
# (list) Accept list for variable plugins that require it.
;vars_plugins_enabled=host_group_vars
# (list) Allows to change the group variable precedence merge order.
;precedence=all_inventory, groups_inventory, all_plugins_inventory, all_plugins_play, groups_plugins_inventory, groups_plugins_play
# (bool) Force 'verbose' option to use stderr instead of stdout
;verbose_to_stderr=False
# (integer) For asynchronous tasks in Ansible (covered in Asynchronous Actions and Polling), this is how long, in seconds, to wait for the task spawned by Ansible to connect back to the named pipe used on Windows systems. The default is 5 seconds. This can be too low on slower systems, or systems under heavy load.
# This is not the total time an async command can run for, but is a separate timeout to wait for an async command to start. The task will only start to be timed against its async_timeout once it has connected to the pipe, so the overall maximum duration the task can take will be extended by the amount specified here.
;win_async_startup_timeout=5
# (list) Check all of these extensions when looking for 'variable' files which should be YAML or JSON or vaulted versions of these.
# This affects vars_files, include_vars, inventory and vars plugins among others.
;yaml_valid_extensions=.yml, .yaml, .json
[privilege_escalation]
# (boolean) Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method
;agnostic_become_prompt=True
# (boolean) This setting controls if become is skipped when remote user and become user are the same. I.E root sudo to root.
# If executable, it will be run and the resulting stdout will be used as the password.
;become_allow_same_user=False
# (boolean) Toggles the use of privilege escalation, allowing you to 'become' another user after login.
;become=False
# (boolean) Toggle to prompt for privilege escalation password.
;become_ask_pass=False
# (string) executable to use for privilege escalation, otherwise Ansible will depend on PATH
;become_exe=
# (string) Flags to pass to the privilege escalation executable.
;become_flags=
# (string) Privilege escalation method to use when `become` is enabled.
;become_method=sudo
# (string) The user your login/remote user 'becomes' when using privilege escalation, most systems will use 'root' when no user is specified.
;become_user=root
[persistent_connection]
# (path) Specify where to look for the ansible-connection script. This location will be checked before searching $PATH.
# If null, ansible will start with the same directory as the ansible script.
;ansible_connection_path=
# (int) This controls the amount of time to wait for response from remote device before timing out persistent connection.
;command_timeout=30
# (integer) This controls the retry timeout for persistent connection to connect to the local domain socket.
;connect_retry_timeout=15
# (integer) This controls how long the persistent connection will remain idle before it is destroyed.
;connect_timeout=30
# (path) Path to socket to be used by the connection persistence system.
;control_path_dir=~/.ansible/pc
[connection]
# (boolean) Pipelining, if supported by the connection plugin, reduces the number of network operations required to execute a module on the remote server, by executing many Ansible modules without actual file transfer.
# This can result in a very significant performance improvement when enabled.
# However this conflicts with privilege escalation (become). For example, when using 'sudo:' operations you must first disable 'requiretty' in /etc/sudoers on all managed hosts, which is why it is disabled by default.
# This option is disabled if ``ANSIBLE_KEEP_REMOTE_FILES`` is enabled.
# This is a global option, each connection plugin can override either by having more specific options or not supporting pipelining at all.
;pipelining=False
[colors]
# (string) Defines the color to use on 'Changed' task status
;changed=yellow
# (string) Defines the default color to use for ansible-console
;console_prompt=white
# (string) Defines the color to use when emitting debug messages
;debug=dark gray
# (string) Defines the color to use when emitting deprecation messages
;deprecate=purple
# (string) Defines the color to use when showing added lines in diffs
;diff_add=green
# (string) Defines the color to use when showing diffs
;diff_lines=cyan
# (string) Defines the color to use when showing removed lines in diffs
;diff_remove=red
# (string) Defines the color to use when emitting error messages
;error=red
# (string) Defines the color to use for highlighting
;highlight=white
# (string) Defines the color to use when showing 'OK' task status
;ok=green
# (string) Defines the color to use when showing 'Skipped' task status
;skip=cyan
# (string) Defines the color to use on 'Unreachable' status
;unreachable=bright red
# (string) Defines the color to use when emitting verbose messages. i.e those that show with '-v's.
;verbose=blue
# (string) Defines the color to use when emitting warning messages
;warn=bright purple
[selinux]
# (boolean) This setting causes libvirt to connect to lxc containers by passing --noseclabel to virsh. This is necessary when running on systems which do not have SELinux.
;libvirt_lxc_noseclabel=False
# (list) Some filesystems do not support safe operations and/or return inconsistent errors, this setting makes Ansible 'tolerate' those in the list w/o causing fatal errors.
# Data corruption may occur and writes are not always verified when a filesystem is in the list.
;special_context_filesystems=fuse, nfs, vboxsf, ramfs, 9p, vfat
[diff]
# (bool) Configuration toggle to tell modules to show differences when in 'changed' status, equivalent to ``--diff``.
;always=False
# (integer) How many lines of context to show when displaying the differences between files.
;context=3
[galaxy]
# (path) The directory that stores cached responses from a Galaxy server.
# This is only used by the ``ansible-galaxy collection install`` and ``download`` commands.
# Cache files inside this dir will be ignored if they are world writable.
;cache_dir=~/.ansible/galaxy_cache
# (bool) Some steps in ``ansible-galaxy`` display a progress wheel which can cause issues on certain displays or when outputing the stdout to a file.
# This config option controls whether the display wheel is shown or not.
# The default is to show the display wheel if stdout has a tty.
;display_progress=
# (boolean) If set to yes, ansible-galaxy will not validate TLS certificates. This can be useful for testing against a server with a self-signed certificate.
;ignore_certs=False
# (path) Role or collection skeleton directory to use as a template for the ``init`` action in ``ansible-galaxy``, same as ``--role-skeleton``.
;role_skeleton=
# (list) patterns of files to ignore inside a Galaxy role or collection skeleton directory
;role_skeleton_ignore=^.git$, ^.*/.git_keep$
# (string) URL to prepend when roles don't specify the full URI, assume they are referencing this server as the source.
;server=https://galaxy.ansible.com
# (list) A list of Galaxy servers to use when installing a collection.
# The value corresponds to the config ini header ``[galaxy_server.{{item}}]`` which defines the server details.
# See :ref:`galaxy_server_config` for more details on how to define a Galaxy server.
# The order of servers in this list is used to as the order in which a collection is resolved.
# Setting this config option will ignore the :ref:`galaxy_server` config option.
;server_list=
# (path) Local path to galaxy access token file
;token_path=~/.ansible/galaxy_token
[inventory]
# (string) This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it
;host_pattern_mismatch=warning
# (boolean) If 'true', it is a fatal error when any given inventory source cannot be successfully parsed by any available inventory plugin; otherwise, this situation only attracts a warning.
;any_unparsed_is_failed=False
# (bool) Toggle to turn on inventory caching.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory configuration.
# This message will be removed in 2.16.
;cache=False
# (string) The plugin for caching inventory.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_plugin=
# (string) The inventory cache connection.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_connection=
# (string) The table prefix for the cache plugin.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_prefix=ansible_inventory_
# (string) Expiration timeout for the inventory cache plugin data.
# This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`.
# The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration.
# This message will be removed in 2.16.
;cache_timeout=3600
# (list) List of enabled inventory plugins, it also determines the order in which they are used.
;enable_plugins=host_list, script, auto, yaml, ini, toml
# (bool) Controls if ansible-inventory will accurately reflect Ansible's view into inventory or its optimized for exporting.
;export=False
# (list) List of extensions to ignore when using a directory as an inventory source
;ignore_extensions={{(REJECT_EXTS + ('.orig', '.ini', '.cfg', '.retry'))}}
# (list) List of patterns to ignore when using a directory as an inventory source
;ignore_patterns=
# (bool) If 'true' it is a fatal error if every single potential inventory source fails to parse, otherwise this situation will only attract a warning.
;unparsed_is_failed=False
[netconf_connection]
# (string) This variable is used to enable bastion/jump host with netconf connection. If set to True the bastion/jump host ssh settings should be present in ~/.ssh/config file, alternatively it can be set to custom ssh configuration file path to read the bastion/jump host settings.
;ssh_config=
[paramiko_connection]
# (boolean) TODO: write it
;host_key_auto_add=False
# (boolean) TODO: write it
;look_for_keys=True
[jinja2]
# (list) This list of filters avoids 'type conversion' when templating variables
# Useful when you want to avoid conversion into lists or dictionaries for JSON strings, for example.
;dont_type_filters=string, to_json, to_nice_json, to_yaml, to_nice_yaml, ppretty, json
[tags]
# (list) default list of tags to run in your plays, Skip Tags has precedence.
;run=
# (list) default list of tags to skip in your plays, has precedence over Run Tags
;skip=

View file

@ -1,60 +0,0 @@
- hosts: localhost
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
vars:
services:
- nginx
- postgresql
- redis
roles:
- name: certificates
- hosts: all
serial: 1
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: common
- hosts: postgresql
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: postgresql
- hosts: redis
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: redis
- hosts: coolwsd
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: coolwsd
- hosts: nextcloud
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: nextcloud
- name: coolwsd-nginx
- name: nextcloud-spreed
- hosts: turn
vars_files:
- vars/main.convergente.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: turn
- name: nats-server
- name: signaling-server
- name: janus

View file

@ -1,63 +0,0 @@
- hosts: localhost
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
vars:
services:
- nginx
- postgresql
- redis
roles:
- name: certificates
- hosts: all
serial: 1
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
roles:
- name: common
- hosts: postgresql
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
roles:
- name: postgresql
- hosts: redis
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
roles:
- name: redis
# Este es el collabora
- hosts: coolwsd
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
roles:
- name: coolwsd
- hosts: nextcloud
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
roles:
- name: nextcloud
- name: coolwsd-nginx
# Enable this for Talk HA
# - name: nextcloud-spreed
#- hosts: turn
# vars_files:
# - vars/main.example.yaml
# - "vars/{{ ansible_facts['os_family'] }}.yaml"
# roles:
# - name: turn
# - name: nats-server
# - name: signaling-server
# - name: janus

View file

@ -1,3 +1,6 @@
# example deploy
#
# This playbook deploys Nextcloud in a distributed yet simple form. It doesn't deploy talk.
- hosts: localhost
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
@ -46,15 +49,4 @@
roles:
- name: nextcloud
- name: coolwsd-nginx
- name: nextcloud-spreed
- hosts: turn
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
- vars/main.example.yaml
roles:
- name: turn
- name: nats-server
- name: signaling-server
- name: janus

View file

@ -1,6 +0,0 @@
- hosts: janus*
vars_files:
- vars/main.test.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: janus

View file

@ -1,60 +0,0 @@
- hosts: localhost
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
vars:
services:
- nginx
- postgresql
- redis
roles:
- name: certificates
- hosts: all
serial: 1
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: common
- hosts: postgresql
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: postgresql
- hosts: redis
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: redis
- hosts: coolwsd
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: coolwsd
- hosts: nextcloud
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: nextcloud
- name: coolwsd-nginx
- name: nextcloud-spreed
- hosts: turn
vars_files:
- vars/main.mixtli.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: turn
- name: nats-server
- name: signaling-server
- name: janus

View file

@ -1,6 +0,0 @@
- hosts: nats*
vars_files:
- vars/main.test.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: nats-server

View file

@ -1,6 +0,0 @@
- hosts: signaling*
vars_files:
- vars/main.test.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: signaling-server

View file

@ -1,5 +0,0 @@
- hosts: nextcloud
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: nextcloud-spreed

View file

@ -1,3 +1,6 @@
# test deploy
#
# This playbook deploys Nextcloud for testing purposes. Mainly used for development.
- hosts: localhost
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"

View file

@ -1,7 +0,0 @@
- hosts: turn
vars_files:
- vars/main.test.yaml
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: turn

View file

@ -1,11 +0,0 @@
[redis]
192.168.1.118
[postgresql]
192.168.1.118 pgsql_host=192.168.1.118
[nextcloud]
192.168.1.118
[coolswd]
192.168.1.118

View file

@ -1,23 +0,0 @@
[redis]
10.201.15.208
[postgresql]
10.201.15.208
[nextcloud]
10.201.15.208
[coolwsd]
10.201.15.208 ansible_host=10.201.15.208
[turn]
turn1.softwarelibre.mx
[nats]
nats1.softwarelibre.mx ansible_host=10.201.15.199
[signaling]
signaling1.softwarelibre.mx ansible_host=10.201.15.199
[janus]
janus1.softwarelibre.mx ansible_host=10.201.15.199

View file

@ -1,5 +1,6 @@
# If your FQDNs are resolvable, then you don't need the ansible_host= part. If they're not, you need to change the IPs and add all
# these entries to the /etc/hosts file of the deployment server (a.k.a. where the ansible-playbooks reside).
# If your FQDNs are resolvable, then you don't need the ansible_host= part. If they're not, one can just use ansible_host=<some-ip>
# in order to make them resolvable. Alternatively, you can change the IPs and add all these entries to the /etc/hosts file of the
# deployment server (a.k.a. where the ansible-playbooks reside) and not use ansible_host=.
#
# For example:
#

View file

@ -1,42 +0,0 @@
# If your FQDNs are resolvable, then you don't need the ansible_host= part. If they're not, you need to change the IPs and add all
# these entries to the /etc/hosts file of the deployment server (a.k.a. where the ansible-playbooks reside).
#
# For example:
#
# /etc/hosts:
# # Loopback entries; do not change.
# For historical reasons, localhost precedes localhost.localdomain:
# 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#
# # my nextcloud
# 192.168.0.10 nx0.example.com nx0
# 192.168.0.11 db0.example.com db0
# 192.168.0.12 rds0.example.com rds0
# 192.168.0.13 cl0.example.com cl0
# 192.168.0.14 turn0.example.com turn0
[nextcloud]
nx0.example.com ansible_host=192.168.0.10
[postgresql]
db0.example.com ansible_host=192.168.0.11
[redis]
rds0.example.com ansible_host=192.168.0.12
[coolwsd]
cl0.example.com ansible_host=192.168.0.13
# Nextcloud Talk
[turn]
turn0.example.com ansible_host=192.168.0.14
[nats]
turn0.example.com ansible_host=192.168.0.14
[signaling]
turn0.example.com ansible_host=192.168.0.14
[janus]
turn0.example.com ansible_host=192.168.0.14

View file

@ -1,11 +0,0 @@
[redis]
nextcloud
[postgresql]
nextcloud
[nextcloud]
nextcloud
[coolwsd]
nextcloud ansible_host=nextcloud

View file

@ -1,2 +0,0 @@
[janus]
jns0-softwarelibre-mx ansible_host=10.201.15.20

View file

@ -1,24 +0,0 @@
[redis]
rds0.softwarelibre.mx ansible_host=10.201.15.123
[postgresql]
db0.softwarelibre.mx ansible_host=10.201.15.227
[nextcloud]
nx0.softwarelibre.mx ansible_host=10.201.15.39
[coolwsd]
clwsd0.softwarelibre.mx ansible_host=10.201.15.217
[turn]
turn2.softwarelibre.mx
[nats]
nats0.softwarelibre.mx ansible_host=198.27.127.126
[signaling]
signaling0.softwarelibre.mx ansible_host=198.27.127.126
[janus]
janus0.softwarelibre.mx ansible_host=198.27.127.126

View file

@ -1,2 +0,0 @@
[nats]
nats1.softwarelibre.mx ansible_host=10.201.15.20

View file

@ -1,24 +0,0 @@
[nextcloud]
nx0.libreoffice.gob.mx ansible_host=10.201.15.86
[postgresql]
db0.libreoffice.gob.mx ansible_host=10.201.15.159
[redis]
rds0.libreoffice.gob.mx ansible_host=10.201.15.94
[coolwsd]
clwsd0.libreoffice.gob.mx ansible_host=10.201.15.118
[turn]
turn0.softwarelibre.mx
[nats]
nats0.softwarelibre.mx ansible_host=10.201.15.43
[signaling]
signaling0.softwarelibre.mx ansible_host=10.201.15.43
[janus]
janus0.softwarelibre.mx ansible_host=10.201.15.43

View file

@ -1,2 +0,0 @@
[nats]
signaling1.softwarelibre.mx ansible_host=10.201.15.20

View file

@ -1,23 +1,42 @@
# If your FQDNs are resolvable, then you don't need the ansible_host= part. If they're not, one can just use ansible_host=<some-ip>
# in order to make them resolvable. Alternatively, you can change the IPs and add all these entries to the /etc/hosts file of the
# deployment server (a.k.a. where the ansible-playbooks reside) and not use ansible_host=.
#
# For example:
#
# /etc/hosts:
# # Loopback entries; do not change.
# For historical reasons, localhost precedes localhost.localdomain:
# 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
# ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#
# # my nextcloud
# 192.168.0.10 nx0.example.com nx0
# 192.168.0.11 db0.example.com db0
# 192.168.0.12 rds0.example.com rds0
# 192.168.0.13 cl0.example.com cl0
# 192.168.0.14 turn0.example.com turn0
[nextcloud]
nx0.test.virt.g02.org ansible_host=192.168.0.41
nx0.test.virt.g02.org ansible_host=192.168.0.10
[postgresql]
db0.test.virt.g02.org ansible_host=192.168.0.40
db0.test.virt.g02.org ansible_host=192.168.0.11
[redis]
rds0.test.virt.g02.org ansible_host=192.168.0.39
rds0.test.virt.g02.org ansible_host=192.168.0.12
[coolwsd]
cl0.test.virt.g02.org ansible_host=192.168.0.42
cl0.test.virt.g02.org ansible_host=192.168.0.13
[turn]
turn0.test.virt.g02.org ansible_host=192.168.0.43
turn0.test.virt.g02.org ansible_host=192.168.0.14
[nats]
turn0.test.virt.g02.org ansible_host=192.168.0.43
turn0.test.virt.g02.org ansible_host=192.168.0.14
[signaling]
turn0.test.virt.g02.org ansible_host=192.168.0.43
turn0.test.virt.g02.org ansible_host=192.168.0.14
[janus]
turn0.test.virt.g02.org ansible_host=192.168.0.43
turn0.test.virt.g02.org ansible_host=192.168.0.14

View file

@ -1,2 +0,0 @@
[turn]
turn0-softwarelibre-mx ansible_host=10.201.15.43

View file

@ -1,2 +0,0 @@
[turn]
turn1-softwarelibre-mx ansible_host=10.201.15.199

View file

@ -1,12 +0,0 @@
[turn]
turn2.softwarelibre.mx
[nats]
nats2.softwarelibre.mx ansible_host=198.27.127.126
[signaling]
signaling2.softwarelibre.mx ansible_host=198.27.127.126
[janus]
janus2.softwarelibre.mx ansible_host=198.27.127.126

View file

@ -1,638 +0,0 @@
---
- hosts: all
vars:
nextcloud_path: "{{ '/usr/share/nginx/html' if ansible_distribution_file_variety == 'RedHat' else '/var/www/html' }}"
nextcloud_occ: "{{ nextcloud_path }}/occ"
nginx_path: "{{ '/etc/nginx/conf.d' if ansible_distribution_file_variety == 'RedHat' else '/etc/nginx/sites-enabled' }}"
# FIXME: Set PHP version from Debian version: 7.4 for Debian 11, 7.3 for Debian 10
php_ini_path: "{{ '/etc' if ansible_distribution_file_variety == 'RedHat' else '/etc/php/7.3/fpm' }}"
php_pool_path: "{{ '/etc/php-fpm.d' if ansible_distribution_file_variety == 'RedHat' else '/etc/php/7.3/fpm/pool.d' }}"
php_fpm_service: "{{ 'php-fpm' if ansible_distribution_file_variety == 'RedHat' else 'php7.3-fpm' }}"
document_root: "{{ '/usr/share/nginx/html' if ansible_distribution_file_variety == 'RedHat' else '/var/www/html' }}"
web_user: "{{ 'nginx' if ansible_distribution_file_variety == 'RedHat' else 'www-data' }}"
pg_hba_conf: "{{ '/var/lib/pgsql/data/pg_hba.conf' if ansible_distribution_file_variety == 'RedHat' else '/etc/postgresql/13/main/pg_hba.conf' }}"
redis_dir: "{{ '/etc' if ansible_distribution_file_variety == 'RedHat' else '/etc/redis' }}"
redis_user: "nextcloud"
redis_url: "https://127.0.0.1"
redis_password: "2XenoNNBtLJqrELTfmCLum/42Guz72Ym0RPMxXh5+pT"
nextcloud_version: "22.1.0"
nextcloud_checksum: "sha256:4820808f799146853604e1fa27d7f292449018a44dc73bf928a97b02028318ba"
nextcloud_database: "nextcloud"
nextcloud_database_user: "nextcloud"
nextcloud_database_user_password: "nVdUe6%Ua9c,Rd.8BVugPHPm2yqUSXWCAy%1GXOQGn8tg9F?k%R"
nextcloud_admin_user: "nextcloud_admin"
nextcloud_admin_password: "prueba123"
#nextcloud_fqdn: "{{ ansible_default_ipv4.address }}"
nextcloud_fqdn: "nextcloud"
# The only way to make notify_push work without a signed cert is to use plain http
notify_push_nextcloud_url: "http://localhost"
key_size: 4096
key_type: "RSA" # Others include DSA, ECC, Ed25519, Ed448, X25519, X448
country_name: "MX"
email_address: "ssl@{{ nextcloud_fqdn }}"
organization_name: "AnsibleNextcloud"
#server_hostname: "{{ ansible_hostname }}"
server_hostname: "{{ nextcloud_fqdn }}"
redis_cert_private_key: "/etc/pki/tls/private/redis-cert-private-key.pem"
redis_cert: "/etc/pki/tls/certs/redis-self-cert.crt"
redis_csr: "/etc/pki/tls/certs/redis-self.csr"
generate_self_signed_cert: true
nginx_cert: "/etc/pki/tls/private/nginx-self-signed.crt"
nginx_key: "/etc/pki/tls/certs/nginx-self-signed.key"
nginx_csr: "/etc/pki/tls/certs/nginx-self-signed.csr"
#nextcloud_domain: "cloud.example.com"
code_enable_ssl: false
code_enable_ssl_termination: true
code_ssl_key: ""
code_ssl_cert: ""
code_ssl_ca: ""
pre_tasks:
- name: Update the /etc/hosts file with node host name
tags: etchostsupdate
become: yes
become_user: root
lineinfile:
path: "/etc/hosts"
regexp: ".*\t{{ ansible_hostname }}"
line: "{{ ansible_env.SSH_CONNECTION.split(' ')[2] }}\t{{ ansible_hostname }}"
state: present
backup: yes
register: etchostsupdate
- name: Update the /etc/hosts file with node domain name
tags: etchostsupdate_domain
become: yes
become_user: root
lineinfile:
path: "/etc/hosts"
line: "{{ ansible_env.SSH_CONNECTION.split(' ')[2] }}\t{{ nextcloud_fqdn }}"
state: present
backup: yes
- name: Create fact directory
file:
path: /etc/ansible/facts.d/
state: directory
- name: Create nextcloud custom facts
copy:
dest: /etc/ansible/facts.d/nextcloud.fact
mode: 0775
force: yes
content: |
#!/usr/bin/bash
FACTS=''
INSTALLED=$(sudo -u www-data /usr/bin/php /var/www/html/occ status | grep installed | cut -d':' -f 2 | sed 's/ //')
if [[ "${INSTALLED}" == "true" ]]; then
FACTS="{\"is_installed\": true"
CODE_INSTALLED=$(sudo -u www-data /usr/bin/php /var/www/html/occ app:list | grep richdocuments)
if [[ "${CODE_INSTALLED}" == *"richdocuments"* ]]; then
FACTS="${FACTS},\n\"is_code_installed\": true}"
else
FACTS="${FACTS},\n\"is_code_installed\": false}"
fi
else
FACTS="{\"is_installed\": false"
FACTS="${FACTS},\n\"is_code_installed\": false}"
fi
echo -e "${FACTS}"
tags:
- check_facts
- name: Check if nextcloud is unpacked
stat:
path: /var/www/html/config/config.sample.php
register: nextcloud_is_unpacked
- name: Reload facts
setup:
tags:
- check_facts
- name: Include a play after another play
include: redhat_pre_tasks.yaml
when:
ansible_distribution_file_variety == 'RedHat'
tasks:
- name: Display local facts
debug: var=ansible_local
tags:
- check_facts
# System setup
- name: sysctl -w net.core.somaxconn=65535
sysctl:
name: net.core.somaxconn
value: "65535"
state: present
reload: true
sysctl_file: /etc/sysctl.conf
- name: Red Hat Distros Tasks
block:
- name: Install System Packages
action: package name={{item}} state=present
with_items:
- nginx
- sudo
- php-fpm
- postgresql
- postgresql-server
- python3-psycopg2
- redis
- php-pgsql
- php-cli
- php-curl
- php-dom
- php-exif
- php-fileinfo
- php-gd
- php-iconv
- php-json
- php-ldap
- php-mbstring
- php-openssl
- php-pcre
- php-pdo
- php-session
- php-simplexml
- php-xmlwriter
- php-spl
- php-zip
- php-filter
- php-ldap
- php-smbclient
- php-imap
- php-gmp
- php-process
- php-pecl-imagick
- php-pecl-memcached
- php-pecl-apcu
- php-pecl-redis
- python3-pyOpenSSL
- name: Import Collabora key
ansible.builtin.rpm_key:
state: present
key: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos8/repodata/repomd.xml.key
- name: Add Collabora repository for Red Hat distros
yum_repository:
name: CollaboraOnline
description: Collabora Online
baseurl: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos8
- name: Install Collabora Online Packages
action: package name={{item}} state=present
with_items:
- coolwsd
- CODE-brand
- name: Check if the '/var/lib/pgsql/data' directory exists
ansible.builtin.stat:
path: "/var/lib/pgsql/data"
register: pgsql_data_dir
- name: Initialize postgres database
ansible.builtin.shell:
cmd: /usr/bin/postgresql-setup --initdb
when: not pgsql_data_dir.stat.isdir is defined
when:
ansible_distribution_file_variety == 'RedHat'
- name: Debian Distros Tasks
block:
- name: Run the equivalent of "apt-get update" as a separate step
apt:
update_cache: yes
- name: Install System Packages
action: package name={{item}} state=present
with_items:
- dirmngr
- nginx
- sudo
- php-fpm
- postgresql-all
- python3-psycopg2
- php-pgsql
- php-cli
- php-curl
- php-gd
- php-json
- php-ldap
- php-mbstring
#- php7.4-xml # en Debián 10 la versión de PHP es 7.3 y en este paquete el 7.4 causa conflicto
- php-xml
#- php-xmlwriter
- php-zip
- php-ldap
#- php-smbclient
- php-imap
- php-gmp
#- php-process
- php-imagick
- php-memcached
- php-apcu
- php-redis
- python3-openssl
- name: Install Redis for Debian versions differen than 10
action: package name=redis state=present
when: ansible_distribution_version != "10"
- name: Install Redis for Debian 10
action: apt deb="{{ item }}" state=present
with_items:
- http://sandino.araico.net/parches/Debian/redis/redis-tools_5.0.3-4+deb10u4_amd64.deb
- http://sandino.araico.net/parches/Debian/redis/redis-server_5.0.3-4+deb10u4_amd64.deb
- http://sandino.araico.net/parches/Debian/redis/redis_5.0.3-4+deb10u4_all.deb
when: ansible_distribution_version == "10"
- name: Get php version
shell: "php -v | grep built | cut -d '.' -f 1,2 | sed 's/PHP //'"
register: php_version
tags:
- php_ver
- name: Get PostgreSQL version
shell: "psql -V | cut -d ' ' -f 3 | cut -d '.' -f 1"
register: postgres_version
tags:
- php_ver
- name: Update the php_ini_path variable
set_fact:
php_ini_path: "/etc/php/{{ php_version.stdout }}/fpm"
- name: Update the pg_hba_conf variable
set_fact:
pg_hba_conf: "/etc/postgresql/{{ postgres_version.stdout }}/main/pg_hba.conf"
- name: Update the php_pool_path variable
set_fact:
php_pool_path: "/etc/php/{{ php_version.stdout }}/fpm/pool.d"
- name: Update the php_fpm_service variable
set_fact:
php_fpm_service: "php{{ php_version.stdout }}-fpm"
- name: Add Collabora apt key by id from keyserver for Debian 10
ansible.builtin.apt_key:
#keyserver: keyserver.ubuntu.com
id: 0C54D189F4BA284D
data: "{{ lookup('file', 'files/0C54D189F4BA284D.asc') }}"
tags:
- debian-collabora-repos
- collabora
- name: Add Collabora repository for Debian distros (10)
ansible.builtin.apt_repository:
repo: deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./
state: present
tags:
- debian-collabora-repos
- collabora
- name: Install Collabora Online Packages
action: package name={{item}} state=present
with_items:
- coolwsd
- code-brand
tags:
- collabora
- name: Remove nginx default configuration
ansible.builtin.file:
path: /etc/nginx/sites-enabled/default
state: absent
tags:
- clean_defaults
when:
ansible_distribution_file_variety == 'Debian'
- name: Configure Nginx Nextcloud pool
template: src=files/nextcloud_nginx.conf.j2 dest="{{ nginx_path }}/nextcloud_nginx.conf"
tags:
- notify_push
- name: Configure PHP
template: src=files/php.ini.j2 dest="{{ php_ini_path }}/php.ini"
- name: Configure PHP FPM pool
template: src=files/www.conf.j2 dest="{{ php_pool_path }}/www.conf"
# nextcloud specific tasks
#- name: Ensure that Nextcloud target directory exists
# ansible.builtin.file:
# path: /var/www/nextcloud
# state: directory
# mode: '0755'
# owner: "{{ web_user }}"
- name: Download Nextcloud
get_url:
url: "https://download.nextcloud.com/server/releases/nextcloud-{{nextcloud_version}}.tar.bz2"
dest: "/usr/src/nextcloud-{{nextcloud_version}}.tar.bz2"
checksum: "{{ nextcloud_checksum }}"
when:
nextcloud_is_unpacked.stat.exists != true and ansible_local['nextcloud']['is_installed'] != true
- name: Unpack Nextcloud
ansible.builtin.unarchive:
src: "/usr/src/nextcloud-{{nextcloud_version}}.tar.bz2"
dest: "{{ nextcloud_path }}"
remote_src: yes
owner: "{{ web_user }}"
extra_opts:
- --strip-components=1
when:
nextcloud_is_unpacked.stat.exists != true and ansible_local['nextcloud']['is_installed'] != true
- name: Create nginx ssl directory
file:
path: /etc/ssl/nginx
state: directory
- name: Generate Nginx SSL Private Key
openssl_privatekey:
path: "{{ nginx_key }}"
size: "{{ key_size }}"
type: "{{ key_type }}"
backup: yes
- name: Generate Nginx SSL CSR
openssl_csr:
path: "{{ nginx_csr }}"
privatekey_path: "{{ nginx_key }}"
country_name: "{{ country_name }}"
organization_name: "{{ organization_name }}"
email_address: "{{ email_address }}"
common_name: "nextcloud"
subject_alt_name: "DNS:{{ ansible_hostname }},DNS:{{ nextcloud_fqdn }},DNS:{{ server_hostname }}"
- name: Generate Nginx Self Signed OpenSSL certificate
openssl_certificate:
path: "{{ nginx_cert }}"
privatekey_path: "{{ nginx_key }}"
csr_path: "{{ nginx_csr }}"
provider: selfsigned
- name: Enable nginx service
systemd:
name: nginx
enabled: yes
state: restarted
tags:
- notify_push
- name: Enable php-fpm service
systemd:
name: "{{ php_fpm_service }}"
enabled: yes
state: restarted
- name: Enable PostgreSQL service
systemd:
name: postgresql
enabled: yes
state: restarted
- name: Generate Redis SSL Private Key
openssl_privatekey:
path: "{{ redis_cert_private_key }}"
size: "{{ key_size }}"
type: "{{ key_type }}"
backup: yes
owner: redis
#FIXME versionar para debian 10 o crear un paquete de redis para debian 10 con soporte de TLS
- name: Generate Redis SSL CSR
openssl_csr:
path: "{{ redis_csr }}"
privatekey_path: "{{ redis_cert_private_key }}"
country_name: "{{ country_name }}"
organization_name: "{{ organization_name }}"
email_address: "{{ email_address }}"
common_name: "{{ server_hostname }}"
owner: redis
- name: Generate Redis Self Signed OpenSSL certificate
openssl_certificate:
path: "{{ redis_cert }}"
privatekey_path: "{{ redis_cert_private_key }}"
csr_path: "{{ redis_csr }}"
provider: selfsigned
owner: redis
- name: Set Redis Configuration
template: src=files/redis.conf.j2 dest="{{ redis_dir }}/redis.conf" owner=root group=root mode=0644
- name: Enable Redis service
systemd:
name: redis
enabled: yes
state: restarted
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
tags:
- check_redis
- name: "Create database user"
postgresql_user:
name: "{{ nextcloud_database_user }}"
password: "{{ nextcloud_database_user_password }}"
become_user: postgres
become: yes
tags:
- database
- name: "Create nextcloud database"
postgresql_db:
name: "{{ nextcloud_database }}"
encoding: UTF-8
template: template0
owner: "{{ nextcloud_database_user }}"
become_user: postgres
become: yes
tags:
- database
- name: Allow postgres user to connect to the database
blockinfile:
dest: "{{ pg_hba_conf }}"
block: |
host all all 0.0.0.0/0 md5
- name: Install nextcloud to database
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" maintenance:install --database "pgsql" --database-name "{{ nextcloud_database }}" --database-user "{{ nextcloud_database_user }}" --database-pass "{{ nextcloud_database_user_password}}" --admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_password }}"
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
when:
ansible_local['nextcloud']['is_installed'] != true
- name: Configure Nextcloud trusted domain
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" config:system:set trusted_domains 1 --value={{ nextcloud_fqdn}}
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
- name: Configure localhost as trusted proxy
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" config:system:set trusted_proxies 0 --value=127.0.0.1
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- notify_push
- name: "configure {{ nextcloud_domain }} as trusted proxy"
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" config:system:set trusted_proxies 1 --value={{ nextcloud_fqdn}}
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- notify_push
- name: "configure ::1 as trusted proxy"
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" config:system:set trusted_proxies 2 --value=::1
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- notify_push
- name: "Import certificate to Nextcloud instance"
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" security:certificates:import "{{ nginx_cert }}"
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- certificates
# Redis como memcache https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html?highlight=cache
- name: Configure Nextcloud Redis
ansible.builtin.shell:
cmd: |
/usr/bin/php "{{ nextcloud_occ }}" config:system:set redis host --value=localhost
/usr/bin/php "{{ nextcloud_occ }}" config:system:set redis port --value=6379
/usr/bin/php "{{ nextcloud_occ }}" config:system:set redis dbindex --value=0
/usr/bin/php "{{ nextcloud_occ }}" config:system:set redis user --value="{{ redis_user }}"
/usr/bin/php "{{ nextcloud_occ }}" config:system:set redis password --value="{{ redis_password }}"
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
tags:
- nextcloud_redis
- name: Enable Nextcloud High Performance Backend
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" app:enable notify_push
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
- name: Install Nextcloud High Performance Backend Systemd Service
template: src=files/notify_push.service.j2 dest=/etc/systemd/system/notify_push.service
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
- name: Set Nextcloud High Performance Backend Systemd Service environment
template: src=files/notify_push_environment.j2 dest="{{ nextcloud_path }}/apps/notify_push/environment"
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
- name: Enable Nextcloud Notify Push Service
systemd: state=restarted name=notify_push daemon_reload=yes
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
- name: Setup Nextcloud High Performance Backend
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" notify_push:setup "https://{{ nextcloud_fqdn }}/push"
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
#when: (ansible_distribution == "Debian" and ansible_distribution_version != "10") or ansible_distribution == "RedHat"
tags:
- redis
- notify_push
- name: Reload facts after Nextcloud installation
setup:
tags:
- check_facts
- name: Copy collabora configuration files
template: src=files/coolwsd.xml.j2 dest=/etc/coolwsd/coolwsd.xml
- name: Enable Libre Office Web services
systemd:
name: coolwsd
enabled: yes
state: restarted
tags:
- nextcloud_collabora
- name: Install Collabora Office nextcloud app
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" app:install richdocuments
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- nextcloud_collabora
when:
ansible_local['nextcloud']['is_code_installed'] != true
- name: Reload facts after Collabora Nextcloud app installation
setup:
tags:
- check_facts
- name: Configure Collabora Office nextcloud app
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" config:app:set --value "https://{{nextcloud_fqdn}}" richdocuments wopi_url
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- nextcloud_collabora
when:
ansible_local['nextcloud']['is_code_installed'] == true
- name: Activate Collabora Office nextcloud app
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" richdocuments:activate-config
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- nextcloud_collabora
when:
ansible_local['nextcloud']['is_code_installed'] == true
- name: Allow local remote servers for nextcloud
ansible.builtin.shell:
cmd: /usr/bin/php "{{ nextcloud_occ }}" config:system:set allow_local_remote_servers --value true --type bool
chdir: "{{ document_root }}"
become: true
become_user: "{{ web_user }}"
tags:
- nextcloud_collabora
when:
ansible_local['nextcloud']['is_code_installed'] == true

View file

@ -1,42 +0,0 @@
- hosts: localhost
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
vars:
services:
- nginx
- postgresql
- redis
roles:
- name: certificates
- hosts: all
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: common
- hosts: postgresql
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: postgresql
- hosts: redis
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: redis
- hosts: coolwsd
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: coolwsd
- hosts: nextcloud
vars_files:
- "vars/{{ ansible_facts['os_family'] }}.yaml"
roles:
- name: nextcloud
- name: coolwsd-nginx

View file

@ -15,12 +15,12 @@ nextcloud_admin_user: admin
nextcloud_admin_password: UnaContraseñaBienDifícil.
## domain
nextcloud_fqdn: cs9-nc-nx0.test.virt.g02.org
nextcloud_host_ip: "{{ hostvars['cs9-nc-nx0.test.virt.g02.org']['ansible_default_ipv4']['address'] }}"
nextcloud_hostname: cs9-nc-nx0
nextcloud_fqdn: cs9-nx0.test.virt.g02.org
nextcloud_host_ip: "{{ hostvars['cs9-nx0.test.virt.g02.org']['ansible_default_ipv4']['address'] }}"
nextcloud_hostname: cs9-nx0
## db
db_host: cs9-nc-db0.test.virt.g02.org
db_host: cs9-db0.test.virt.g02.org
nextcloud_db: nextcloud
nextcloud_db_user: nextcloud
nextcloud_db_user_password: Unacontraseñabien.
@ -62,7 +62,7 @@ nextcloud_firewalld_enabled: true
# Redis
redis_host: cs9-nc-rds0.test.virt.g02.org
redis_host: cs9-rds0.test.virt.g02.org
redis_user: nextcloud
redis_password: ParángariCutirimiNoMeAcuerdoCuaro
redis_url: "https://{{ redis_host }}"
@ -79,7 +79,7 @@ generate_self_signed_cert: true
# Colabora Online (coolwsd)
coolwsd_host: cs9-nc-cl0.test.virt.g02.org
coolwsd_host: cs9-cl0.test.virt.g02.org
code_enable_ssl: false
code_enable_ssl_termination: true
code_ssl_key: ""
@ -92,24 +92,24 @@ notify_push_nextcloud_url: http://localhost
# reverse proxy
reverse_proxy_ip: "{{ hostvars['cs9-nc-nx0.test.virt.g02.org']['ansible_default_ipv4']['address'] }}"
reverse_proxy_ip: "{{ hostvars['cs9-nx0.test.virt.g02.org']['ansible_default_ipv4']['address'] }}"
# turn
turn_fqdn: f40-nc-turn0.test.virt.g02.org
turn_fqdn: f40-turn0.test.virt.g02.org
turn_firewalld_enabled: false
turn_letsencrypt_certificate_enabled: false
turn_static_auth_secret: OtroSecretoBienSuperDifícilDeAdivinar
# nats
nats_fqdn: f40-nc-turn0.test.virt.g02.org
nats_fqdn: f40-turn0.test.virt.g02.org
nats_firewalld_enabled: false
nats_letsencrypt_certificate_enabled: false
# signaling
signaling_fqdn: f40-nc-turn0.test.virt.g02.org
signaling_fqdn: f40-turn0.test.virt.g02.org
signaling_debug: false
signaling_firewalld_enabled: false
signaling_letsencrypt_certificate_enabled: false