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

Nodejs package is installed before apt is updated #171

Closed
atrepca opened this issue Oct 2, 2015 · 2 comments
Closed

Nodejs package is installed before apt is updated #171

atrepca opened this issue Oct 2, 2015 · 2 comments

Comments

@atrepca
Copy link
Contributor

atrepca commented Oct 2, 2015

OS: Ubuntu 14.04.2 LTS
Puppet version: 3.7.2-1puppetlabs1
Nodejs module version: 0.8.0

Puppet code snippet:

  $npm_packages = [ 'bower','grunt','grunt-cli', ]
  package { $npm_packages:
    ensure   => present,
    provider => 'npm',
  }
  class { 'nodejs':
    repo_url_suffix       => 'node_0.12',
    nodejs_package_ensure => '0.12.7-1nodesource1~trusty1',
    before                => Package[$npm_packages],
  }

Puppet run output:

Info: Retrieving plugin
Info: Caching catalog for REMOVED
Info: Applying configuration version '1443784901'
Notice: /Stage[main]/Nodejs::Repo::Nodesource/Nodejs::Repo::Nodesource::Apt/Apt::Source[nodesource]/Apt::Setting[list-nodesource]/File[/etc/apt/sources.list.d/nodesource.list]/ensure: created
Info: /Stage[main]/Nodejs::Repo::Nodesource/Nodejs::Repo::Nodesource::Apt/Apt::Source[nodesource]/Apt::Setting[list-nodesource]/File[/etc/apt/sources.list.d/nodesource.list]: Scheduling refresh of Class[Apt::Update]
Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install nodejs=0.12.7-1nodesource1~trusty1' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 192 not upgraded.
E: Can't find a source to download version '0.12.7-1nodesource1~trusty1' of 'nodejs:amd64'
Wrapped exception:
Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install nodejs=0.12.7-1nodesource1~trusty1' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 192 not upgraded.
E: Can't find a source to download version '0.12.7-1nodesource1~trusty1' of 'nodejs:amd64'
Error: /Stage[main]/Nodejs::Install/Package[nodejs]/ensure: change from absent to 0.12.7-1nodesource1~trusty1 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install nodejs=0.12.7-1nodesource1~trusty1' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 192 not upgraded.
E: Can't find a source to download version '0.12.7-1nodesource1~trusty1' of 'nodejs:amd64'
Notice: /Stage[main]/Nodejs/Anchor[::nodejs::end]: Dependency Package[nodejs] has failures: true
Warning: /Stage[main]/Nodejs/Anchor[::nodejs::end]: Skipping because of failed dependencies
Notice: /Package[bower]: Dependency Package[nodejs] has failures: true
Warning: /Package[bower]: Skipping because of failed dependencies
Notice: /Package[grunt-cli]: Dependency Package[nodejs] has failures: true
Warning: /Package[grunt-cli]: Skipping because of failed dependencies
Notice: /Package[grunt]: Dependency Package[nodejs] has failures: true
Warning: /Package[grunt]: Skipping because of failed dependencies
Info: Class[Apt::Update]: Scheduling refresh of Exec[apt_update]
Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 events
Notice: Finished catalog run in 15.63 seconds

The next Puppet run installs node successfully.

@juniorsysadmin
Copy link
Member

The apt module makes the apt update frequency an explicit value that is set in that module - we don't want to ruin traceability by doing it in this one.

@atrepca
Copy link
Contributor Author

atrepca commented Nov 14, 2015

Fair enough, thanks @juniorsysadmin.

For the record, this is new behavior introduced by apt 2.x, more info in ticket MODULES-2190.

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

2 participants