Jira (PUP-3761) puppet agent --onetime not honored

14 views
Skip to first unread message

Dan Bode (JIRA)

unread,
Dec 11, 2014, 5:39:27 PM12/11/14
to puppe...@googlegroups.com
Dan Bode created an issue
 
Puppet / Bug PUP-3761
puppet agent --onetime not honored
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2014/12/11 2:38 PM
Priority: Normal Normal
Reporter: Dan Bode

when running the following command:

````
puppet agent --noop puppet-master.service.consul --test --onetime
````

(NOTE: --onetime added for clarify here, it is also part of the --test alias)

I get the following error:

````
Notice: Skipping run of Puppet configuration client; administratively disabled (Reason: 'Disabled by default on new installations');
Use 'puppet agent --enable' to re-enable.
````

After reading about -

enable, it looks like I would not want to enable this option ( -onetime means that I just want to run puppet once, and I don't necessarily want it to run in the background. It seems as if --test, --onetime, and --no-daemonize, have been rendered unsupported by this admin lock.

Am I missing something, or are these options not going to be supported anymore? That would be a shame b/c they were really useful

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.7#6337-sha1:2ed701e)
Atlassian logo

Josh Cooper (JIRA)

unread,
Dec 15, 2014, 1:12:27 PM12/15/14
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
when running the following command:

```` {noformat}
puppet agent --noop puppet-master.service.consul --test --onetime
```` {noformat}

(NOTE: --onetime added for clarify here, it is also part of the --test alias)

I get the following error:

```` {noformat}
Notice: Skipping run of Puppet configuration client; administratively disabled (Reason: 'Disabled by default on new installations');
Use 'puppet agent --enable' to re-enable.
```` {noformat}

After reading about
 \  - \ -enable, it looks like I would not want to enable this option (--onetime means that I just want to run puppet once, and I don't necessarily want it to run in the background. It seems as if --test, --onetime, and --no-daemonize, have been rendered unsupported by this admin lock.

Am I missing something, or are these options not going to be supported anymore? That would be a shame b/c they were really useful :(

Josh Cooper (JIRA)

unread,
Dec 15, 2014, 1:35:29 PM12/15/14
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Assignee: Dan Bode

Josh Cooper (JIRA)

unread,
Dec 15, 2014, 1:35:29 PM12/15/14
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3761
 
Re: puppet agent --onetime not honored

Dan Bode If the agent is administratively disabled, then both foreground and background puppet agent runs are disabled. Are you asking that puppet agent when running in the foreground with onetime, should be allowed to run (ignoring the lock file)?

Dan Bode (JIRA)

unread,
Dec 15, 2014, 1:49:27 PM12/15/14
to puppe...@googlegroups.com
Dan Bode commented on Bug PUP-3761

It appears that setting this flat to --enable means that the puppet agent will start running in the background (is that not true?)

Dan Bode (JIRA)

unread,
Dec 15, 2014, 1:50:31 PM12/15/14
to puppe...@googlegroups.com
Dan Bode commented on Bug PUP-3761

maybe --enable should just be added to the --test alias?

Josh Cooper (JIRA)

unread,
Dec 15, 2014, 2:08:32 PM12/15/14
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3761

I don't think we want -

test/onetime to imply -enable, since that would introduce race conditions where the background agent could run between the time the lock is removed and when the foreground agent runs.

Dan Bode (JIRA)

unread,
Dec 15, 2014, 2:30:27 PM12/15/14
to puppe...@googlegroups.com
Dan Bode commented on Bug PUP-3761

I need to look into this more. After looking at the code I can tell this isn't something new. I was a little confused b/c this message is what I see after a fresh Puppet install (ie: things are disabled by default). I may need to recreate and try to understand why I'm seeing it (b/c I didn't see any recent commits merged into 3.x that would cause this to be the default behavior)

Dan Bode (JIRA)

unread,
Dec 15, 2014, 5:52:30 PM12/15/14
to puppe...@googlegroups.com
Dan Bode commented on Bug PUP-3761

I had another look today, and by default puppet agent --test doesn't work (the main thing that I'm confused about)

I remember this command always just working before, so it seems like a significant break in backwards compat.
Also you mentioned race conditions related to running puppet from the foreground. What is the safe way to run it?

````
service puppet stop
puppet agent --enable
puppet agent -t
puppet agent --disable
service puppet start
````

Josh Cooper (JIRA)

unread,
Dec 19, 2014, 6:10:08 PM12/19/14
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-3761

There was a behavior change between 2.7.26 (the last release in the 2.7.x series) and 3.0.0. In 2.7.x, you could continue to run puppet agent in the foreground even if the agent was disabled. That's no longer true in 3.0.0 and up:

0 ~/work/puppet (2.7.26)  $ bundle exec puppet agent -t
/Users/josh/work/puppet/lib/puppet/external/pson/pure.rb:7:in `<module:PSON>': iconv will be deprecated in the future, use String#encode instead.
...
info: Applying configuration version '1419023831'
notice: Finished catalog run in 0.11 seconds
2 ~/work/puppet (2.7.26)  $ git checkout 3.0.0
Previous HEAD position was 50bd24a... Merge pull request #39 from MosesMendoza/maint/2.7.x/update_packaging
HEAD is now at 340fdf8... Update lib/puppet/version.rb for 3.0.0
0 ~/work/puppet (3.0.0)  $ bundle update
...
Your bundle is updated!
Gems in the groups development and extra were not installed.
0 ~/work/puppet (3.0.0)  $ bundle exec puppet agent -t
...
Skipping run of Puppet configuration client; administratively disabled (Reason: 'reason not specified');
Use 'puppet agent --enable' to re-enable.
This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Dan Bode (JIRA)

unread,
Dec 19, 2014, 6:31:05 PM12/19/14
to puppe...@googlegroups.com
Dan Bode commented on Bug PUP-3761

I'm going to go ahead and close since it's not new behavior. Obviously, I'm doing something different on my end that caused me to start seeing it.

Jesse Hathaway (Jira)

unread,
Mar 23, 2023, 4:12:02 PM3/23/23
to puppe...@googlegroups.com

It would be really nice if running in the foreground skipped the lock or if a flag was added to skip the lock. Otherwise there is a race condition as Dan Bode mentioned between enabling puppet and kicking off a run in the foreground.

This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Jesse Hathaway (Jira)

unread,
Mar 24, 2023, 12:35:01 PM3/24/23
to puppe...@googlegroups.com

Josh Cooper any chance we could re-open this issue?

Reply all
Reply to author
Forward
0 new messages