diff --git a/roles/debian/gitlab/defaults/main.yml b/roles/debian/gitlab/defaults/main.yml index 225d7a2cf..d4c2243e3 100644 --- a/roles/debian/gitlab/defaults/main.yml +++ b/roles/debian/gitlab/defaults/main.yml @@ -96,3 +96,4 @@ gitlab: redirect_http_to_https: "true" # must be enabled if you're using LetsEncrypt above redirect_http_to_https_port: 80 # must be 80 if you're using LetsEncrypt above custom_nginx_config: "" # include extra config, for example "include /etc/nginx/conf.d/example.conf;" + block_removed_ldap_users_on_calendar: "*-*-* 02:30:00" diff --git a/roles/debian/gitlab/tasks/main.yml b/roles/debian/gitlab/tasks/main.yml index ce93c19b6..762c26ba8 100644 --- a/roles/debian/gitlab/tasks/main.yml +++ b/roles/debian/gitlab/tasks/main.yml @@ -128,6 +128,16 @@ ansible.builtin.command: /opt/gitlab/bin/gitlab-ctl start when: gitlab.force_stop +- name: Create systemd timer to sync removed LDAP users. + ansible.builtin.include_role: + name: contrib/systemd_timers + vars: + timers: + block_removed_ldap_users: + timer_command: "/usr/bin/gitlab-rake gitlab:cleanup:block_removed_ldap_users BLOCK=true" + timer_OnCalendar: "{{ gitlab.block_removed_ldap_users_on_calendar }}" + when: gitlab.ldap.enable + # @TODO - this task fails in CI with GitHub Actions because PostGreSQL isn't running - name: Run the GitLab configuration script for config that cannot be set in gitlab.rb. ansible.builtin.command: /opt/gitlab/bin/gitlab-rails runner /etc/gitlab/gitlab-config.rb