Newer
Older
config_date_time: "{{ ansible_date_time.date }}_{{ ansible_date_time.hour }}-{{ ansible_date_time.minute }}-{{ ansible_date_time.second }}"
update_cache: yes
state: present
pkg:
- curl
- openssh-server
- ca-certificates
- tzdata
- perl
- gnupg
- apt-transport-https
update_cache: yes
state: present
pkg:
- debian-archive-keyring
when: ansible_distribution == 'Debian'
- name: Add an Apt signing key, uses whichever key is at the URL
ansible.builtin.apt_key:
url: https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
state: present
- name: Add specified repository into sources list
ansible.builtin.apt_repository:
repo: deb https://packages.gitlab.com/gitlab/gitlab-ce/{{ ansible_distribution | lower }}/ {{ ansible_distribution_release | lower }} main
- name: Install gitlab-ce
ansible.builtin.apt:
update_cache: yes
state: present
pkg:
- gitlab-ce
backup: yes
register: gitlab_config
notify: Reconfigure gitlab
- debug: var=gitlab_config.backup_file
- name: Backup previous gitlab config
ansible.builtin.copy:
dest: "/opt/gitlab.rb"
src: "{{ gitlab_config.backup_file }}"
remote_src: true
when: gitlab_config.changed
path: "{{ gitlab_config.backup_file }}"
state: absent
when: gitlab_config.changed