Ask Your Question
0

Puppet Apply

asked 2017-02-26 17:53:37 -0500

speshin gravatar image

updated 2017-03-09 14:23:25 -0500

I have a module named cowsayings with the module structure that looks like this.

cowsayings/
├── examples
│   └── cowsay.pp
└── manifests
    └── cowsay.pp
2 directories, 2 files

cowsayings/manifests/cowsay.pp has the class definition below:-

class cowsayings::cowsay {
  package { 'cowsay':
    ensure   => present,
    provider => 'gem',
  }
}

cowsayings/examples/cowsay.pp has this:-

include cowsayings::cowsay

When i do puppet apply --noop /cowsayings/examples/cowsay.pp everything looks fine and i get the output below :-

Notice: Compiled catalog for learning.puppetlabs.vm in environment production in 0.80 seconds
Notice: /Stage[main]/Cowsayings::Cowsay/Package[cowsay]/ensure: current_value absent, should be present (noop)
Notice: Class[Cowsayings::Cowsay]: Would have triggered 'refresh' from 1 events
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Notice: Applied catalog in 0.58 seconds

But When i run puppet apply with noop flag it just displays :-

Notice: Compiled catalog for learning.puppetlabs.vm in environment production in 0.81 seconds

And then nothing happens and i waited for 5 mins and still nothing happened. Can someone help please ?

EDIT/UPDATE- I ran into this issue again and this time i let the system be for a while. This is what i got. Any help will be appreciated.

Notice: Compiled catalog for learning.puppetlabs.vm in environment production in 0.91 seconds Error: Execution of '/bin/yum -d 0 -e 0 -y install fortune-mod' returned 1: One of the configured repositories failed (Docker), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=docker ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable docker
    or
        subscription-manager repos --disable=docker

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=docker.skip_if_unavailable=true

failure: repodata/repomd.xml from docker: [Errno 256] No more mirrors to try. https://yum.dockerproject.org/repo/ma...: [Errno 12] Timeout on https://yum.dockerproject.org/repo/ma...: (28, 'Connection timed out after 30001 milliseconds') https://yum.dockerproject.org/repo/ma...: [Errno 12] Timeout on https://yum.dockerproject.org/repo/ma...: (28, 'Connection timed out after 30002 milliseconds') https ... (more)

edit retag flag offensive close merge delete

Comments

Have you tried specifying "modulepath"?

luksi1 gravatar imageluksi1 ( 2017-02-27 09:17:53 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2017-02-28 06:27:58 -0500

puser gravatar image

What is the exact command you are using? These should be your calls:

puppet apply examples/init.pp --noop 
Notice: Compiled catalog for puppet-suse.homeoffice.anfcorp.com in environment production in 0.07 seconds
Notice: /Stage[main]/Cowsayings/Notify[somedata]/message: current_value absent, should be somedata (noop)
Notice: Class[Cowsayings]: Would have triggered 'refresh' from 1 events
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Notice: Applied catalog in 0.04 seconds

OR

puppet apply examples/init.pp 
Notice: Compiled catalog for puppet-suse.homeoffice.anfcorp.com in environment production in 0.07 seconds
Notice: somedata
Notice: /Stage[main]/Cowsayings/Notify[somedata]/message: defined 'message' as 'somedata'
Notice: Applied catalog in 0.04 seconds

--noop has two dashes

Try modifying cowsay.pp and ensure absent. Run it without the --noop flag. Then switch it back to present and see what you get. What is your pwd on the learningvm? You shouldn't need to specify modulepath in the learningvm unless you changed something.

edit flag offensive delete link more

Comments

I might have changed some configuration, maybe the modulepath, so i reinstalled the another copy of vm and tried again. And it worked. Thanks for your responses.

speshin gravatar imagespeshin ( 2017-03-01 16:30:26 -0500 )edit

Hi, i have updated the question. Please have a look if you can help out. Thanks.

speshin gravatar imagespeshin ( 2017-03-09 14:24:22 -0500 )edit
0

answered 2017-03-09 14:37:15 -0500

speshin gravatar image

As the issue popped up again, this time instead of reinstalling the learning VM. I tried "Eric_Anderson" 's suggestion and deleted the resource with 'ensure => absent' and then used 'ensure => present'. This resolved the issue. Although, I would still like to know why it was happening. Thanks for the answers.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-02-26 17:53:37 -0500

Seen: 78 times

Last updated: Mar 09