Skip to content

Flatcar Container Linux not properly discovered #69516

@dongsupark

Description

@dongsupark

SUMMARY

Flatcar Container Linux is not properly discovered by Ansible, especially while setting hostname.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

hostname

ANSIBLE VERSION
ansible --version
ansible 2.9.7
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['.../.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.8/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.8.2 (default, Feb 28 2020, 00:00:00) [GCC 10.0.1 20200216 (Red Hat 10.0.1-0.8)]
OS / ENVIRONMENT

Guest OS: Flatcar Container Linux Alpha 2492.0.0
Host: Fedora 32

STEPS TO REPRODUCE
  1. Clone image builder.
  2. Adjust files for Flatcar.
  3. Run packer build, which creates Flatcar image, provisions a host.
EXPECTED RESULTS

No error

ACTUAL RESULTS

Failure like:

flatcar-alpha: TASK [sysprep : Set hostname] **************************************************
    flatcar-alpha: fatal: [default]: FAILED! => {"changed": false, "msg": "hostname module cannot be  used on platform Linux (Flatcar)"}^

For info, in Flatcar you can see for example:

$ cat /etc/os-release 
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=2492.0.0
VERSION_ID=2492.0.0
BUILD_ID=2020-04-28-2210
PRETTY_NAME="Flatcar Container Linux by Kinvolk 2492.0.0 (Rhyolite)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar-linux.org/"
BUG_REPORT_URL="https://issues.flatcar-linux.org"
FLATCAR_BOARD="amd64-usr"

$ cat /etc/lsb-release 
DISTRIB_ID="Flatcar Container Linux by Kinvolk"
DISTRIB_RELEASE=2492.0.0
DISTRIB_CODENAME="Rhyolite"
DISTRIB_DESCRIPTION="Flatcar Container Linux by Kinvolk 2492.0.0 (Rhyolite)"

As far as I understand, so far Ansible only supported CoreOS Container Linux, which will be soon EOL. Recently there was an attempt to support Fedora CoreOS or RedHat CoreOS, which was not merged. I am not sure if there is any recent progress about that.

So would it be reasonable to simply add new code for Flatcar, just like CoreOS Container Linux?

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects_2.9This issue/PR affects Ansible v2.9bugThis issue/PR relates to a bug.has_prThis issue has an associated PR.moduleThis issue/PR relates to a module.python3support:coreThis issue/PR relates to code supported by the Ansible Engineering Team.systemSystem category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions