vmware-samples/packer-examples-for-vsphere

Photon Build Failures

Kennochas opened this issue · 8 comments

Code of Conduct

  • I have read and agree to the project's Code of Conduct.

Project Version

latest

VMware vSphere

7.0U3

HashiCorp Packer

10.0.1

HashiCorp Packer Plugin for VMware vSphere

1.2.1

Guest Operating System

Photon

Environment Details

No response

Description

Currently, Photon is unable to build due to the following

    vsphere-iso.linux-photon: TASK [configure : lineinfile] **************************************************
    vsphere-iso.linux-photon: changed: [default]
    vsphere-iso.linux-photon:
    vsphere-iso.linux-photon: TASK [configure : Setting the hostname.] ***************************************
    vsphere-iso.linux-photon: fatal: [default]: FAILED! => {"changed": false, "msg": "hostname module cannot be used on platform Linux (Photon)"}
    vsphere-iso.linux-photon:
    vsphere-iso.linux-photon: PLAY RECAP *********************************************************************
    vsphere-iso.linux-photon: default                    : ok=13   changed=7    unreachable=0    failed=1    skipped=10   rescued=0    ignored=0
    vsphere-iso.linux-photon:


Expected Behavior

Build a photon template

Actual Behavior

Build failure

Steps to Reproduce

Run a photon build.

Log Fragments and Files

No response

Screenshots

No response

Additional Context

No response

🤔 That's certainly a new one. Will look into it when time permits. Feel free to open a PR if you are able to track a resolution.

@rcroft-work
Are you observing the same in your pipeline?

@rcroft-work Are you observing the same in your pipeline?

@tenthirtyam - Photon is building without issue in my pipeline.

vsphere-iso.linux-photon:
vsphere-iso.linux-photon: TASK [configure : Setting the hostname.] ***************************************
vsphere-iso.linux-photon: changed: [default]
vsphere-iso.linux-photon:

I am building:

  • Photon OS 5.0 GA
  • Photon OS 4.0 Rev2

The ISOs used are the ones currently available from: https://github.com/vmware/photon/wiki/Downloading-Photon-OS

Many thanks for confirming, Richard!

Will take a look.

Its possible that the situation is different in a newer Ansible version.

Do you happen to know what version is available in your build that is working okay? @rcroft-work

I am using a Photon5.0-based container w/ Ansible/Packer/etc to build so the version of Ansible is the one that ships with it.

$ ansible --version
ansible [core 2.14.12]
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.7 (main, Jan  8 2024, 02:50:44) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
$

Versions of other components are:

hashicorp/vsphere v1.2.4
github.com/hashicorp/ansible v1.1.1
github.com/ethanmdavidson/git v0.6.2

HTH

Thanks,

I switched to installing ansible in a venv before execution, and it works fine. So it is something with Ubuntu's package for Ansible / something fixed in a future release that hasn't made it yet.

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.