diff --git a/defaults/main.yml b/defaults/main.yml index b42ab67..a4232d3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -86,3 +86,21 @@ repo_ssh_keypairs_install_ca: "{{ openstack_ssh_keypairs_authorities }}" repo_ssh_keypairs_principals: - user: "{{ repo_service_user_name }}" principals: "{{ repo_ssh_key_principals | default(['repo']) }}" + +# Temporary variable which allows the lsyncd/rsync installation to be disabled outside this +# role when transtioning to using a shared filesystem to sync contents between repo_servers. +# The default is to enable the sync manager to give backward compatibility and allow code to +# merge. +repo_server_enable_sync_manager: True + +# Multiple repo servers must have a shared /var/www/repo +repo_server_systemd_mounts: [] + +# Example using remote shared filesystem to synchronise the repo contents between +# several repo servers +#repo_server_systemd_mounts: +# - what: "gluster-server:gluster-volume-name" +# where: "/var/www/repo" +# type: glusterfs +# state: 'started' +# enabled: true diff --git a/tasks/main.yml b/tasks/main.yml index c7d5619..3468864 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -66,7 +66,9 @@ state: absent - include: repo_sync_manager.yml - when: inventory_hostname == groups['repo_all'][0] + when: + - repo_server_enable_sync_manager + - inventory_hostname == groups['repo_all'][0] tags: - repo_server-config diff --git a/tasks/repo_pre_install.yml b/tasks/repo_pre_install.yml index 4f815ea..d8ef708 100644 --- a/tasks/repo_pre_install.yml +++ b/tasks/repo_pre_install.yml @@ -29,6 +29,13 @@ createhome: "yes" home: "{{ repo_service_home_folder }}" +- name: Mount any remote volumes + include_role: + name: systemd_mount + vars: + systemd_mounts: "{{ repo_server_systemd_mounts }}" + when: repo_server_systemd_mounts | length > 0 + - name: File and directory setup (non-root user) file: path: "{{ item.path }}"