Skip to content

bug: Restart runner if custom_env changed #237

@lukasz-mitka

Description

@lukasz-mitka

Summary

https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/run-scripts#triggering-the-scripts

Note that any change to the .env file will require restarting the runner.

It doesn't cause issues when runner is first installed since the custom_env is created before, but when custom_env is modified afterwards it should trigger runner restart.

I could add restart as external task, but custom_env task is not registered.

Issue Type

Bug Report

Ansible Version

ansible [core 2.18.6]
  config file = /home/user/github-runners/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.flox/run/x86_64-linux.default.dev/lib/python3.12/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /nix/store/xpzn3bbrzvqbqnm5bgkwg87v2wcbmyfg-python3.12-ansible-core-2.18.6/bin/ansible
  python version = 3.12.10 (main, Apr  8 2025, 11:35:47) [GCC 14.2.1 20250322] (/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12)
  jinja version = 3.1.6
  libyaml = True

Steps to Reproduce

  1. Run your ansible playbook
  2. Add custom_env
  3. Run your ansible playbook

Changes in .env are not visible until runner is restarted

Expected Results

I expected new variable to be available, but it wasn't until the runner was restarted.

Actual Results

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions