Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Debian) Install GitLab Runner fail when update in 22.04 #327

Closed
cchaudier opened this issue Apr 29, 2024 · 2 comments
Closed

(Debian) Install GitLab Runner fail when update in 22.04 #327

cchaudier opened this issue Apr 29, 2024 · 2 comments
Assignees

Comments

@cchaudier
Copy link
Contributor

cchaudier commented Apr 29, 2024

Intro

The role fails to update package gitlab-runner with version 16.9.1-1 on Debian/Ubuntu 22.04 with gitlab runner already install.

Info about the environment

Ansible version

$ ansible --version
ansible [core 2.16.3]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /builds/.venv/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /builds/.venv/bin/ansible
  python version = 3.11.9 (main, Apr 24 2024, 11:58:32) [GCC 12.2.0] (/builds.venv/bin/python)
  jinja version = 3.1.2
  libyaml = True

Gitlab-runner role version

roles:
  - name: riemers.gitlab-runner
    src: https://github.com/riemers/ansible-gitlab-runner
    version: "82dd6ce26ac3ff7a8d8ec1ae8b626db50156db53"

Server

My server is Ubuntu 22.04.4 LTS.

GitLab runner is already installed.

$ apt list --installed | grep runner
  gitlab-runner/jammy,now 16.8.1 amd64 [installed,upgradable to: 16.11.0-1]

Error description

TASK [riemers.gitlab-runner : (Debian) Install GitLab Runner] ******************
fatal: [runner1]: FAILED! => {"cache_update_time": 1714383521, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      --simulate install 'gitlab-runner=16.9.1-1' --allow-downgrades' failed: E: Held packages were changed and -y was used without --allow-change-held-packages.\n", "rc": 100, "stderr": "E: Held packages were changed and -y was used without --allow-change-held-packages.\n", "stderr_lines": ["E: Held packages were changed and -y was used without --allow-change-held-packages."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nSuggested packages:\n  docker-engine\nThe following held packages will be changed:\n  gitlab-runner\nThe following packages will be upgraded:\n  gitlab-runner\n1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Suggested packages:", "  docker-engine", "The following held packages will be changed:", "  gitlab-runner", "The following packages will be upgraded:", "  gitlab-runner", "1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded."]}
{
    "cache_update_time": 1714378710,
    "cache_updated": false,
    "changed": false,
    "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      --simulate install 'gitlab-runner=16.9.1-1' --allow-downgrades' failed: E: Held packages were changed and -y was used without --allow-change-held-packages.\n",
    "rc": 100,
    "stderr": "E: Held packages were changed and -y was used without --allow-change-held-packages.\n",
    "stderr_lines": [
        "E: Held packages were changed and -y was used without --allow-change-held-packages."
    ],
    "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following packages were automatically installed and are no longer required:\n  libflashrom1 libftdi1-2\nUse 'sudo apt autoremove' to remove them.\nSuggested packages:\n  docker-engine\nThe following held packages will be changed:\n  gitlab-runner\nThe following packages will be upgraded:\n  gitlab-runner\n1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.\n",
    "stdout_lines": [
        "Reading package lists...",
        "Building dependency tree...",
        "Reading state information...",
        "The following packages were automatically installed and are no longer required:",
        "  libflashrom1 libftdi1-2",
        "Use 'sudo apt autoremove' to remove them.",
        "Suggested packages:",
        "  docker-engine",
        "The following held packages will be changed:",
        "  gitlab-runner",
        "The following packages will be upgraded:",
        "  gitlab-runner",
        "1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded."
    ]
}

I think you must had the allow_change_held_packages on apt modules calls when allow_downgrade is true

@cchaudier
Copy link
Contributor Author

cchaudier commented Apr 30, 2024

I've fixe the probleme on my DevEnv I can propose a PR this week.
@riemers I'ts possible to assigne the issue to me ?

cchaudier added a commit to FroggitFR/ansible-gitlab-runner that referenced this issue May 2, 2024
`allow_downgrade` has been added in ansible-core 2.12
`allow_change_held_packages` has been added in ansible-core 2.13
Fix issue riemers#327
cchaudier added a commit to FroggitFR/ansible-gitlab-runner that referenced this issue May 2, 2024
`allow_downgrade` has been added in ansible-core 2.12
`allow_change_held_packages` has been added in ansible-core 2.13
Fix issue riemers#327
cchaudier added a commit to FroggitFR/ansible-gitlab-runner that referenced this issue May 2, 2024
`allow_downgrade` has been added in ansible-core 2.12
`allow_change_held_packages` has been added in ansible-core 2.13
Fix issue riemers#327
cchaudier added a commit to FroggitFR/ansible-gitlab-runner that referenced this issue May 2, 2024
`allow_downgrade` has been added in ansible-core 2.12
`allow_change_held_packages` has been added in ansible-core 2.13
Fix issue riemers#327
@cchaudier
Copy link
Contributor Author

Thank's @guenhter
I've sumit the PR #328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant