server_sync

server_sync

A tiny role, which establish synchronization of configured folders between hosts in the group.

Requirements

Inventory group of sync_hosts must look like follow:

all:
  hosts:
    proxy1:
      ansible_host: 1.2.3.4
      server_sync_master: true
    proxy2:
      ansible_host: 1.2.3.5
vars:
  ansible_python_interpreter: "/usr/bin/env python3"
children:
  sync_group:
    hosts:
      proxy1:
      proxy2:
    vars:
      sync_folders: ['/etc/ssl/nginx/', '/etc/letsencrypt/']
      post_sync_hook: 'systemctl restart nginx'

If host defines variable "server_sync_master: true" the systemd timer on the host will be enabled to execute daily ansible playbook (ansible-playbook -i /etc/server_sync/inventory /etc/server_sync/sync.yml).

Example

- name: Generate/detect SSH keys for servers
  hosts: sync_group
  tasks:
    - include_role:
        name: opentelekomcloud_infra.server_sync
        tasks_from: generate_ssh_key.yml

- name: Gather SSH keys per groups
  hosts: sync_group
  tasks:

    - include_role:
        name: opentelekomcloud_infra.server_sync
      vars:
        sync_group_name: sync_group
About

Enable synchronization between servers (i.e. HA configs)

Install
ansible-galaxy install opentelekomcloud-infra/ansible-role-server-sync
GitHub repository
License
apache-2.0
Downloads
17
Owner
Infrastructure projects of the OTC