You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
Maybe my idea is only applicable to this one specific operation - I'm not yet familiar with ALL operations - however, there could be others that work similarly to server.crontab().
When using server.crontab() to modify already existing cronjobs, the cronjob must have a cron_name identifier set on it, otherwise it will make a new entry into your crontab. Since an existing cronjob must be identified in order to be modified, I find it a bit redundant that my pre-deployment "Detected Changes" output must now display both of the operations (identifying and modifying).
Solution 1
If this idea is something that is only applicable to server.crontab(), possibly the the Crontab facts could be enhanced so you could check if an identifier already exists in your crontab, then a second server.crontab() would no longer be necessary to use to verify cronjobs are identified before modifying them. Could be implemented something like this:
if not host.get_fact(Crontab, user=<user>, cron_name=<your identifer set by server.crontab()>):
# Cron identifier not found in crontab, will now identify the cronjob
server.crontab(
name="Identify Cron"
command=<command>
cron_name=<your identifer>
...
...
)
Solution 2
My alternative suggestion is to add an optional "Hidden" value to the global name argument so that an operation can be hidden from your pre-deployment "detected changes" output. In practice it would look something like this:
server.crontab(
# Identifying a cron, don't want shown in detected changes
name=Hidden,
command="<your command here>",
cron_name="<do a thing>"
...
...
...
)
Another way to implement this idea could be to add a global _hidden argument that would work something like this and accomplish the same thing:
server.crontab(
name="Identifying a cron",
command=<your command here>,
cron_name="<do a thing>"
...
...
...
# Don't want shown in detected changes
_hidden=True
)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
Maybe my idea is only applicable to this one specific operation - I'm not yet familiar with ALL operations - however, there could be others that work similarly to
server.crontab()
.When using
server.crontab()
to modify already existing cronjobs, the cronjob must have acron_name
identifier set on it, otherwise it will make a new entry into your crontab. Since an existing cronjob must be identified in order to be modified, I find it a bit redundant that my pre-deployment "Detected Changes" output must now display both of the operations (identifying and modifying).Solution 1
If this idea is something that is only applicable to
server.crontab()
, possibly the the Crontab facts could be enhanced so you could check if an identifier already exists in your crontab, then a secondserver.crontab()
would no longer be necessary to use to verify cronjobs are identified before modifying them. Could be implemented something like this:Solution 2
My alternative suggestion is to add an optional "Hidden" value to the global name argument so that an operation can be hidden from your pre-deployment "detected changes" output. In practice it would look something like this:
Another way to implement this idea could be to add a global
_hidden
argument that would work something like this and accomplish the same thing:The text was updated successfully, but these errors were encountered: