samdoran / ansible-role-gitlab

Ansible role for GitLab CE Omnibus
30 stars 21 forks source link

Ubuntu 20.04 | Install fails due to missing Repository GPG key #15

Open dh4nav opened 2 years ago

dh4nav commented 2 years ago

Using the role as is on Ubuntu 20.04 resulted in the following:

(myhomedir_redacted)/ansible-install-gitlab$ ansible-playbook playbook_gitlab.yml 

PLAY [all] ********************************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [ansible-role-gitlab : Include distribution specific variables] **********************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [ansible-role-gitlab : include_tasks] ************************************************************************************************************************************************************************************************************************************
included: (myhomedir_redacted)/ansible-install-gitlab/roles/ansible-role-gitlab/tasks/install-Debian.yml for localhost

TASK [ansible-role-gitlab : DEBIAN | Create GitLab repository] ****************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: W:GPG error: https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F, E:The repository 'https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu focal InRelease' is not signed."}

PLAY RECAP ********************************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Manually adding the key as per https://docs.gitlab.com/omnibus/update/package_signatures#fetching-new-keys-before-2020-04-06 fixed the issue temporarily

Playbook used:

- hosts: all
  become: yes

  vars:
     gitlab_days_old_backups: 7

  roles:
     - ansible-role-gitlab

Hostfile /etc/ansible/hosts:

localhost