RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1248837 - cloud-init log file should log user creation and password updating action
Summary: cloud-init log file should log user creation and password updating action
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cloud-init
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: pre-dev-freeze
: ---
Assignee: Lars Kellogg-Stedman
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-30 23:51 UTC by Julie
Modified: 2015-08-04 17:31 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-04 17:23:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Cloud_init_log (33.37 KB, image/png)
2015-07-30 23:55 UTC, Julie
no flags Details

Description Julie 2015-07-30 23:51:12 UTC
In run once, user can use cloud-init to create a new user/set user password or change existing user password. This is, however, no logged in /var/log/cloud-init-output.log. Based on the feedback from our customer (SPARQ Solutions), I would like to request this major action logged.

Comment 1 Julie 2015-07-30 23:55:17 UTC
Created attachment 1057870 [details]
Cloud_init_log

Did not log user creating and updating password

Comment 2 Oved Ourfali 2015-08-02 05:18:08 UTC
Sounds like a bug in cloud-init, and not in RHEV-M.
Setting as "virt" to get a formal answer about that.

Comment 3 Omer Frenkel 2015-08-02 08:48:51 UTC
indeed, cloud init log is owned by cloud init, moving.

Julie, could you provide the guest os version and cloud-init version?

Comment 5 Julie 2015-08-02 09:50:55 UTC
(In reply to Omer Frenkel from comment #3)
> indeed, cloud init log is owned by cloud init, moving.
> 
> Julie, could you provide the guest os version and cloud-init version?

[test@cloud-init1 ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[test@cloud-init1 ~]$ rpm -qa cloud-init
cloud-init-0.7.5-2.el6.x86_64

Cheers,
Julie

Comment 6 Lars Kellogg-Stedman 2015-08-04 17:23:23 UTC
cloud-init already logs this information.  It may not show up in /var/log/cloud-init.log, but it's available in the system journal.

Using this input:

    #cloud-config

    users:
      - default
      - name: lars
        gecos: Lars Kellogg-Stedman
        plain_txt_passwd: secret

I see this in the journal:

    # journalctl | grep lars
    Aug 04 12:22:55 citest.localdomain cloud-init[470]: [CLOUDINIT] __init__.py[DEBUG]: Adding user lars
    Aug 04 12:22:55 citest.localdomain cloud-init[470]: [CLOUDINIT] util.py[DEBUG]: Running hidden command to protect sensitive input/output logstring: ['useradd', 'lars', '--comment', 'Lars Kellogg-Stedman', '-m']
    Aug 04 12:22:55 citest.localdomain useradd[3349]: new group: name=lars, GID=1000
    Aug 04 12:22:55 citest.localdomain useradd[3349]: new user: name=lars, UID=1000, GID=1000, home=/home/lars, shell=/bin/bash
    Aug 04 12:22:56 citest.localdomain cloud-init[470]: [CLOUDINIT] util.py[DEBUG]: Running command ['passwd', '-l', 'lars'] with allowed return codes [0] (shell=False, capture=True)
    Aug 04 12:22:58 citest.localdomain cloud-init[3614]: ci-info: no authorized ssh keys fingerprints found for user lars.
    [root@citest ~]# grep lars /var/log/cloud-init.log 
    Aug  4 12:22:58 localhost cloud-init: ci-info: no authorized ssh keys fingerprints found for user lars.

Note that in the above we see both output from cloud-init itself as well as from the 'useradd' command, which also generates log entries when creating new users and groups.

For systems not running journald, these messages should be available in the system log, typically '/var/log/messages'.

Comment 7 Lars Kellogg-Stedman 2015-08-04 17:31:51 UTC
Note that for password changes with an existing account, I see:

Aug 04 13:29:28 citest.localdomain cloud-init[476]: [CLOUDINIT] __init__.py[INFO]: User operator already exists, skipping.
Aug 04 13:29:28 citest.localdomain cloud-init[476]: [CLOUDINIT] util.py[DEBUG]: Running command ['passwd', '-l', 'operator'] with allowed return codes [0] (shell=False, capture=True)


Note You need to log in before you can comment on or make changes to this bug.