Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] Cannot alias Shellvar already declared #39

Open
jcpunk opened this issue Aug 4, 2022 · 0 comments
Open

[Regression] Cannot alias Shellvar already declared #39

jcpunk opened this issue Aug 4, 2022 · 0 comments

Comments

@jcpunk
Copy link

jcpunk commented Aug 4, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.18.0
  • Ruby: ruby-3.0.3-159.el9.x86_64
  • Distribution: RHEL 9
  • Module version: 3.2.0

How to reproduce (e.g Puppet code you use)

include stdlib::manage
stdlib::manage::create_resources:
    shellvar:
        set_hostname_early:
            ensure: present
            variable: GRUB_CMDLINE_LINUX
            target: /etc/default/grub
            value: "hostname=%{facts.fqdn}"
            array_append: true
            notify: Exec[refresh_grub2_config]
        set_console_blank_timeout:
            ensure: present
            variable: GRUB_CMDLINE_LINUX
            target: /etc/default/grub
            value: consoleblank=0
            array_append: true
            notify: Exec[refresh_grub2_config]
        remove_dracut_rhgb_splash:
            ensure: absent
            target: /etc/default/grub
            variable: GRUB_CMDLINE_LINUX
            array_append: true
            value:
                - rhgb
                - splash
            notify: Exec[refresh_grub2_config]
        remove_dracut_quiet:
            ensure: absent
            target: /etc/default/grub
            variable: GRUB_CMDLINE_LINUX
            array_append: true
            value: quiet
            notify: Exec[refresh_grub2_config]
    exec:
        refresh_grub2_config:
            path: /usr/bin:/usr/sbin
            command: grub2-mkconfig -o /boot/grub2/grub.cfg
            onlyif: test $(stat --format=%Y /etc/default/grub) -gt $(stat --format=%Y /boot/grub2/grub.cfg)
            provider: shell
mod 'puppetlabs-stdlib', '8.4.0'
mod 'puppet-augeasproviders_core', '3.2.0'
mod 'herculesteam-augeasproviders_shellvar', '4.1.0'

What are you seeing

Catalog fails to compile with voxpupuli module

What behaviour did you expect instead

Catalog continues to compile

Output log

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Cannot alias Shellvar[set_console_blank_timeout] to ["/etc/default/grub", "GRUB_CMDLINE_LINUX"] at (file: /etc/puppetlabs/code/environments/production/modules/stdlib/manifests/manage.pp, line: 49); resource ["Shellvar", "/etc/default/grub", "GRUB_CMDLINE_LINUX"] already declared (file: /etc/puppetlabs/code/environments/production/modules/stdlib/manifests/manage.pp, line: 49) (file: /etc/puppetlabs/code/environments/production/modules/stdlib/manifests/manage.pp, line: 49, column: 7) on node

Any additional information you'd like to impart

It appears that the array_append: true setting is either being lost in translation or not being propagated to the alias.

mod 'herculesteam-augeasproviders_core', '3.1.0' does not show this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant