voxpupuli / puppet-zypprepo

Puppet description of a zypper repository
Apache License 2.0
10 stars 22 forks source link

Repo doesnt actually gets enabled #59

Closed dadav closed 3 years ago

dadav commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

class profile::system::repositories {
  # Defaults
  $defaults = {
    enabled      => 1,
    autorefresh  => 1,
    gpgcheck     => 1,
    type         => 'rpm-md',
    keeppackages => 0,
    priority     => 100,
  }

  zypprepo {
      default:
        * => $defaults,;

      'foo':
        baseurl  => "http://foot/rpm/adm/${::operatingsystemmajrelease}/",
        gpgcheck => '0',;

      'bar':
        baseurl  => "http://bar/rpm/${::enc['stage']}/${::operatingsystemmajrelease}/",
        gpgcheck => '0',;

  }

  Zypprepo <||>
  ->Package <||>
}

I'm running puppet agent -t on the client

What are you seeing

Both repositories are still disabled.

What behaviour did you expect instead

The repository get actually enabled.

Output log

Info: Applying configuration version 'puppetpu-fix_zypper_repo_bug-4980fa9e8bb'
Notice: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/enabled: enabled changed '0' to 1 (corrective)
Notice: /Stage[main]/Profile::System::Repositories/Zypprepo[bar]/enabled: enabled changed '0' to 1 (corrective)

Any additional information you'd like to impart

There are no errors in the log (like a running zypper instance is blocking the write operation). It just does nothing...

kenyon commented 3 years ago

What do you see with puppet agent --test --debug?

dadav commented 3 years ago

The only parts that are zypprepo related are these:

...
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[vim]^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[ntp]^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[puppet-agent]^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[rsyslog]^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[openssh]^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[sssd-proxy]^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/before: before to Package[sssd]^[[0m
...
^[[0;36mDebug: Prefetching inifile resources for zypprepo^[[0m
^[[mNotice: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]/enabled: enabled changed '0' to 1 (corrective)^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[foo]: The container Class[Profile::System::Repositories] will propagate my refresh event^[[0m
^[[mNotice: /Stage[main]/Profile::System::Repositories/Zypprepo[bar]/enabled: enabled changed '0' to 1 (corrective)^[[0m
^[[0;36mDebug: /Stage[main]/Profile::System::Repositories/Zypprepo[bar]: The container Class[Profile::System::Repositories] will propagate my refresh event^[[0m
^[[0;36mDebug: Prefetching zypper resources for package^[[0m
^[[0;36mDebug: Executing: '/bin/rpm --version'^[[0m

If you need the full log, I will need some time to remove company related stuff^^

dadav commented 3 years ago

If i add some Puppet.notice in the self.store(resource) function and print the inifile contents, it shows the value as enabled=0.

dadav commented 3 years ago

set_property is never called durring my puppetrun. get_property is called and returns 0 for enabled, which is correct.

dadav commented 3 years ago

Even if I remove the enabled property manually from the repo file it won't work. Only if I remove the repo-file completly.

tuxmea commented 3 years ago

@dadav Please update zypprepo module to 3.1.1! Unluckily version 3.1.1 is not released on Puppet Forge, but available as git tag. see #56

dadav commented 3 years ago

@dadav Please update zypprepo module to 3.1.1! Unluckily version 3.1.1 is not released on Puppet Forge, but available as git tag. see #56

I can't find the tag https://github.com/voxpupuli/puppet-zypprepo/tags

I'll try the latest code tho, thanks for the hint!!

dadav commented 3 years ago

Yessss, the latest code works!! thx @tuxmea

dadav commented 3 years ago

Ok, the enabled property works now, but the type property doesn't work. The symptoms are the same.