cc_puppet start service error on lunar

Bug #2002969 reported by Alberto Contreras
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Calvin Mwadime Makokha

Bug Description

cc_puppet fails to start the puppet service on Ubuntu Lunar.

Cloud config to reproduce it:
```yaml
#cloud-config
puppet:
  install: true
  install_type: packages
  start_service: true
```

$ cat /var/log/cloud-init.log
...
2023-01-16 11:07:57,416 - util.py[DEBUG]: Running module puppet (<module 'cloudinit.config.cc_puppet' from
 '/usr/lib/python3/dist-packages/cloudinit/config/cc_puppet.py'>) failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/config/modules.py", line 246, in _run_modules
    ran, _r = cc.run(
  File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 67, in run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 185, in run
    results = functor(*args)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_puppet.py", line 321, in handle
    _autostart_puppet(log)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_puppet.py", line 135, in _autostart_puppet
    subp.subp(["systemctl", "enable", "puppet.service"], capture=False)
  File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 335, in subp
    raise ProcessExecutionError(
cloudinit.subp.ProcessExecutionError: Unexpected error while running command.
Command: ['systemctl', 'enable', 'puppet.service']
Exit code: 1
Reason: -
Stdout: -
Stderr: -
...

The issue seems to be that puppet 7.20.0-1 is a transitional dummy package pointing to puppet-agent and puppet.service was renamed to puppet-agent.service but cloud-init is not aware of this and tries to enable the old puppet.service.

In puppet 7.16 puppet.service was an alias pointing to puppet-agent.service [1].

[1] https://changelogs.ubuntu.com/changelogs/pool/universe/p/puppet-agent/puppet-agent_7.20.0-1/changelog

Revision history for this message
Alberto Contreras (aciba) wrote :
description: updated
Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Chad Smith (chad.smith)
Changed in cloud-init:
status: Triaged → Fix Committed
assignee: nobody → calvin (mwadime)
assignee: calvin (mwadime) → Calvin Mwadime Makokha (calvinmwadime)
Revision history for this message
Alberto Contreras (aciba) wrote : Fixed in cloud-init version 23.1.

This bug is believed to be fixed in cloud-init in version 23.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.