この GitHub アクションを使用しています: https://github.com/roles-ansible/check-ansible-ubuntu-focal-action
name: Ansible check ubuntu:focal
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ansible check with ubuntu:focal
uses: roles-ansible/check-ansible-ubuntu-focal-action@master
with:
targets: "local.yml"
group: "workstations"
hosts: "localhost"
ハングし、ジョブをキャンセルすると、ログに次のように表示されます。
Setting up tzdata (2021a-0ubuntu0.20.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
Error: The operation was canceled.
つまり、インタラクティブな入力が configure されるのを待つ docker コンテナーのケースですtzdata
。
自分のコードでこれを解決するにはどうすればよいですか? これまでに考えられる唯一の解決策は、GitHub Action のアップストリーム リポジトリをフォークし、コマンドのDockerfile
前に次の行を追加することです。RUN apt-get
ARG DEBIAN_FRONTEND=noninteractive
でも自分で解決できるならアップストリームへの貢献は避けたい。
何か案は?
参考までに、これはDockerfile
GitHub アクションのアップストリーム リポジトリの現在のものです: https://github.com/roles-ansible/check-ansible-ubuntu-focal-action/blob/master/Dockerfile
FROM ubuntu:focal
LABEL "maintainer"="L3D <l3d@c3woc.de>"
LABEL "repository"="https://github.com/roles-ansible/check-ansible-ubuntu-focal-action.git"
LABEL "homepage"="https://github.com/roles-ansible/check-ansible-ubuntu-focal-action"
LABEL "com.github.actions.name"="check-ansible-ubuntu-focal"
LABEL "com.github.actions.description"="Check ansible role or playbook with Ubuntu focal"
LABEL "com.github.actions.icon"="aperture"
LABEL "com.github.actions.color"="green"
RUN apt-get update -y && apt-get install -y \
software-properties-common \
build-essential \
libffi-dev \
libssl-dev \
python3-dev \
python3-pip \
git \
systemd
RUN pip3 install setuptools && pip3 install ansible
RUN ansible --version
ADD ansible-docker.sh /ansible-docker.sh
ENTRYPOINT ["/ansible-docker.sh"]